from <cmath> 458 template<typename _Tp> 459 int 460 __capture_isnan(_Tp __f) { return isnan(__f); } 532 template<typename _Tp> 533 int 534 isnan(_Tp __f) { return __capture_isnan(__f); } Now, on line 460, the "isnan" call refers to a macro. However, that macro in turn expands to call a function which is also named "isnan". This ends up calling the function as defined on line 534 (is this correct behavior? I don't know). The result is, calling <cmath>'s isnan() causes infinite recursion and crashes with a stack overflow. Oopsies. This bug is present in the version of GCC that comes with FreeBSD 5.3.
*** This bug has been marked as a duplicate of 19322 ***