|
From: Jim C. <gre...@yg...> - 2002-08-31 07:13:44
|
Geoff Hutchison's bits of Fri, 30 Aug 2002 translated to: >Hmm. I thought that OS X 10.2 used gcc-3.1 for compiling just about >everything. (There were comments about how the improved PowerPC >performance would help app speed, etc.) > >I guess I'd suggest recompiling from scratch as I know the C++ ABI changed >between 2.95.x and 3.1 and it'll eventually change again with gcc-3.2. I have tried both 2.95.2 and 3.1 with the same result. I think there is a bug in htnotify's readPreAndPostamble(). Both htnotify_prefix_file and htnotify_suffix_file have a default value of "", but the code only checks for NULL when examining the values of prefixfile and suffixfile. The code then proceeds to create ifstream objects using the default values. Finally, the streams are checked with 'if (! in.bad())'; however the ifstream constructor sets failbit, rather than badbit, when it is unable to open the specified file. The result is that the code drops into a while loop and starts extracting from an undefined stream object. The problem doesn't occur in the 3.2 branch because in addition to checking for NULL prefixfile/suffixfile, the code also checks the values of *prefixfile and *suffixfile. I think that in both branches checking 'in.bad()' is the wrong thing to do. Verifying that in.good() is true seems most appropriate, though ensuring that in.fail() is not true is enough to prevent the problem I encountered. Jim |