There is a hang in isnan() during fg start if simgear is built using gcc 3.3 compiler (which I installed about two months back) on mac os x.

Due to a variety of issues (mostly the weather 8-) ), I've not been able to look at this problem until recently, but I've got a fix for it that I'll give below.

Under gdb, breaking into the hang I have:

--------------------------------
No bindings for joystick 9
Joystick 9 not found
^C
Program received signal SIGINT, Interrupt.
isnan(double) (r=0) at soundmgr_openal.cxx:40
40 inline int (isnan)(double r) { return isnan(r); }
(gdb) Quit
(gdb) Quit
(gdb) bt
#0 isnan(double) (r=0) at soundmgr_openal.cxx:40
#1 0x00316ccc in SGSoundMgr::set_source_pos_all(float*) (this=0x1457cd50, pos=0xbffff440) at soundmgr_openal.cxx:40
#2 0x00004e50 in fgMainLoop() () at ../../src/Main/globals.hxx:290
#3 0x87521e18 in -[GLUTApplication run] ()
#4 0x8753bd28 in glutMainLoop ()
#5 0x000075b8 in fgMainInit(int, char**) (argc=1, argv=0x5c39ec) at main.cxx:958
#6 0x000031e0 in main (argc=1, argv=0x15fd5e00) at bootstrap.cxx:192
(gdb)


Program received signal SIGINT, Interrupt.
isnan(double) (r=0) at soundmgr_openal.cxx:40
40      inline int (isnan)(double r) { return isnan(r); }
(gdb) stepi
40      inline int (isnan)(double r) { return isnan(r); }
(gdb) u isnan
isnan(double) (r=0) at soundmgr_openal.cxx:40
40      inline int (isnan)(double r) { return isnan(r); }
(gdb)
---------------

The fix is to modify src/simgear/simgear/sound/soundmgr_openal.cxx as follows:

The original (1.16) reads:

#if defined (__APPLE__)
// any C++ header file undefines isinf and isnan
// so this should be included before <iostream>
inline int (isinf)(double r) { return isinf(r); }
inline int (isnan)(double r) { return isnan(r); }
#endif

the fix is to replace the above with:

#if defined (__APPLE__)
#  ifdef __GNUCC__
#    if __GNUCC__ == 3
#      if __GNUC_MINOR >= 3
#        include <math.h>
#      endif
#    endif
# else
    // any C++ header file undefines isinf and isnan
    // so this should be included before <iostream>
    inline int (isinf)(double r) { return isinf(r); }
    inline int (isnan)(double r) { return isnan(r); }
#  endif
#endif

Looks like the undefining of isnan, at least, is fixed using gcc 3.3 on mac os x. Could someone please check this fix into CVS?

Thanks!

Ima


_______________________________________________ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to