public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20919] New: Floating point functions in cmath (like isinf, isnan) recurse and cause stack overflow.
@ 2005-04-09 19:28 temporal at gauge3d dot org
2005-04-09 19:30 ` [Bug libstdc++/20919] " pinskia at gcc dot gnu dot org
2005-04-09 19:32 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: temporal at gauge3d dot org @ 2005-04-09 19:28 UTC (permalink / raw)
To: gcc-bugs
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.
--
Summary: Floating point functions in cmath (like isinf, isnan)
recurse and cause stack overflow.
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: temporal at gauge3d dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20919
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libstdc++/20919] Floating point functions in cmath (like isinf, isnan) recurse and cause stack overflow.
2005-04-09 19:28 [Bug c++/20919] New: Floating point functions in cmath (like isinf, isnan) recurse and cause stack overflow temporal at gauge3d dot org
@ 2005-04-09 19:30 ` pinskia at gcc dot gnu dot org
2005-04-09 19:32 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-09 19:30 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |libstdc++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20919
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libstdc++/20919] Floating point functions in cmath (like isinf, isnan) recurse and cause stack overflow.
2005-04-09 19:28 [Bug c++/20919] New: Floating point functions in cmath (like isinf, isnan) recurse and cause stack overflow temporal at gauge3d dot org
2005-04-09 19:30 ` [Bug libstdc++/20919] " pinskia at gcc dot gnu dot org
@ 2005-04-09 19:32 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-09 19:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-09 19:32 -------
*** This bug has been marked as a duplicate of 19322 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20919
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-04-09 19:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-09 19:28 [Bug c++/20919] New: Floating point functions in cmath (like isinf, isnan) recurse and cause stack overflow temporal at gauge3d dot org
2005-04-09 19:30 ` [Bug libstdc++/20919] " pinskia at gcc dot gnu dot org
2005-04-09 19:32 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).