Closed p5pRT closed 19 years ago
lib/bigfltpm test fails in step 351. `perl' passes a NaN value to gcvt()\, which causes it to get SIGFPE and dump core. gdb backtrace follows.
#0 0x80019223 in PL_regflags () #1 0x80f721d in cvt () #2 0x80f71ae in ecvt () #3 0x80f7025 in gcvt () #4 0x80aa5bb in Perl_sv_2pv (sv=0x811cb50\, lp=0x804787c) at sv.c:2114 #5 0x80a23ce in Perl_pp_match () at pp_hot.c:956 #6 0x809f74c in Perl_runops_standard () at run.c:27 #7 0x805bd66 in S_run_body (oldscope=1) at perl.c:1401 #8 0x805ba3b in perl_run (my_perl=0x8116804) at perl.c:1325 #9 0x80590ee in main (argc=2\, argv=0x8047b18\, env=0x8047b24) at perlmain.c:52 #10 0x8058feb in .text ()
Hex dump of double value in question is:
0x00 0x00 0x00 0x00 0x00 0x00 0xf8 0x7f
It always causes my gcvt to get SIGFPE\, regardless of program which passed such an arg to it.
I do not know\, is such a behavior of perl considered proper (and gcvt must handle NaN's) or it is a bug in perl.
One possible solution of gcvt SIGFPE problem is using sprintf instead (in Gconvert macro). It runs normally and returns "nan". After fixing config.sh this way and rebuilding perl all tests succeed.
This problem is specific to 5.0.2 or earlier versions. Perhaps this explains why it was not detected before: perl is likely to have been ported only on 5.0.4 or later (-Bexport cc flag is valid only there).
On Fri\, 14 Apr 2000 17:32:06\, gin@mo.msk.ru wrote:
It always causes my gcvt to get SIGFPE\, regardless of program which passed such an arg to it.
I do not know\, is such a behavior of perl considered proper (and gcvt must handle NaN's) or it is a bug in perl.
Your platform likely needs to disable SIGFPE. See the end of unixish.h for examples.
Sarathy gsar@activestate.com
Is this still an issue with 5.8.6?
@schwern - Status changed from 'open' to 'stalled'
Again\, already posted the solution (\023a38fa0f7b94\-gin@​mo\.msk\.ru). `Gconvert' must be implemented on version 5.0.2 or earlier using `sprintf'\, not `gcvt'. Again\, check `hints/sco5.sh' or whatever sets default values for `Configure' on that system.
Moreover\, one can reproduce the way `Gconvert' is called by batcktrace from original bug report (\023a38f7561586\-gin@​mo\.msk\.ru) and write a test to be used by `Configure' / `hints' script to check how to implement `Gconvert' properly.
The RT System itself - Status changed from 'stalled' to 'open'
On Tue\, 14 Dec 2004\, Ilya N. Golubev wrote:
Again\, already posted the solution (\023a38fa0f7b94\-gin@​mo\.msk\.ru). `Gconvert' must be implemented on version 5.0.2 or earlier using `sprintf'\, not `gcvt'. Again\, check `hints/sco5.sh' or whatever sets default values for `Configure' on that system.
Yes\, that's in the bug database.
However\, the solution Sarathy suggested (ignoring SIGFPE) is also probably already implemented in 5.8.6 (see the end of perl.h)\, though I don't know if that implementation is working on SCO 5.0.2\, and I expect nobody is in a position to test it.
Moreover\, one can reproduce the way `Gconvert' is called by batcktrace from original bug report (\023a38f7561586\-gin@​mo\.msk\.ru) and write a test to be used by `Configure' / `hints' script to check how to implement `Gconvert' properly.
Configure does indeed contain a framework for testing various inputs to the Gconvert function and verifying that they work\, but that framework doesn't handle NaN values\, so it's not trivial to simply add in your suggested test. It's a good suggestion\, but would take a bit of work.
Still\, the following patch should be harmless and safe to apply. It simply instructs Configure to prefer sprintf() on SCO.
Andy Dougherty doughera@lafayette.edu
Andy Dougherty wrote:
Still\, the following patch should be harmless and safe to apply. It simply instructs Configure to prefer sprintf() on SCO.
diff -r -u perl-current/hints/sco.sh perl-andy/hints/sco.sh --- perl-current/hints/sco.sh Sun Jun 24 10:21:37 2001 +++ perl-andy/hints/sco.sh Wed Dec 15 10:13:25 2004
Thanks\, applied as #23655.
@rgs - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#3100 (status was 'resolved')
Searchable as RT3100$