File Method
---- -------
caChannel.cc ::addMonitorObj
::removeMonitorObj
caRequestObject.cc ::setValueCbk (two places)
::convertData
caService.cc ::addReadFd
::removeReadFd
The errors were all of the same form, illustrated here by the instance
in caService::addReadFd():
caService::addReadFd (int fd)
{
if (numFds_){
int *newfds = new int[numFds_ + 1];
for (int i =0; i < numFds_; i++)
newfds[i] = fds_[i];
delete []fds_;
newfds[i] = fd;
<snip>
While the compiler only generated warnings, the resultant program
crashed with a Bus Error within caService::removeReadFd() during
process exit handling - presumably due to garbage values with the
newfds[] array.
Declaring the loop index variables at the start of each method
corrects the problem.
Aloha,
Peregrine
-------------------------------------------------------------------------------
Peregrine M. McGehee http://www.cfht.hawaii.edu/~mcgehee
Telescope Control Systems Group Canada-France-Hawaii Telescope
(808) 885-3178 P.O. Box 1597, Kamuela, Hawaii 96743