Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAN_COMPARE_BROKEN.DIV_BY_NAN_BUG (with patch) #8876

Closed
p5pRT opened this issue Apr 19, 2007 · 3 comments
Closed

NAN_COMPARE_BROKEN.DIV_BY_NAN_BUG (with patch) #8876

p5pRT opened this issue Apr 19, 2007 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 19, 2007

Migrated from rt.perl.org#42614 (status was 'resolved')

Searchable as RT42614$

@p5pRT
Copy link
Author

p5pRT commented Apr 19, 2007

From patrick.dugnolle@bnpparibas.com

Hi,

using the latest devel perl which is correcting the NAN_COMPARE_BROKEN bug
solved by Jan Dubois on Win32/MSVC6, I came accross the following bug​:

perl -MPOSIX -e "print 1.0/pow(-1,0.5)"

would trigger an "Illegal division by zero" error, instead of outputing
"-1.#IND" (the string representation of NaN on Win32)

It appears that changes #27576 and #27577 introducing NAN_COMPARE_BROKEN
are incomplete and need the following addendum

*** perl-5.9.4/pp.c Tue Aug 15 14​:37​:41 2006
--- perl-5.9.4/pp.c Thu Apr 19 14​:29​:22 2007
***************
*** 1276,1284 ****
  } /* right wasn't SvIOK */
  #endif /* PERL_TRY_UV_DIVIDE */
  {
! dPOPPOPnnrl;
! if (right == 0.0)
! DIE(aTHX_ "Illegal division by zero");
  PUSHn( left / right );
  RETURN;
  }
--- 1276,1288 ----
  } /* right wasn't SvIOK */
  #endif /* PERL_TRY_UV_DIVIDE */
  {
! dPOPPOPnnrl;
! #if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
! if (! Perl_isnan(right) && right == 0.0)
! #else
! if (right == 0.0)
! #endif
! DIE(aTHX_ "Illegal division by zero");
  PUSHn( left / right );
  RETURN;
  }

Let me know if you need further information

Patrick DUGNOLLE

perlbug -d


Flags​:
  category=
  severity=


Site configuration information for perl 5.9.4​:

Configured by 225028 at Thu Apr 19 10​:57​:25 2007.

Summary of my perl5 (revision 5 version 9 subversion 4) configuration​:
  Platform​:
  osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
  uname=''
  config_args='undef'
  hint=recommended, useposix=true, d_sigaction=undef
  useithreads=define, usemultiplicity=define
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
  optimize='-MD -Zi -DNDEBUG -O1',
  cppflags='-DWIN32'
  ccversion='12.00.8804', gccversion='', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='link', ldflags ='-nologo -nodefaultlib -debug -opt​:ref,icf
-libpath​:"c​:\Appli\GTS\Dev\Perl\lib\CORE" -machine​:x86'
  libpth=C​:\PROGRA1\MICROS3\VC98\lib
  libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
  perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
  libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl59.lib
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt​:ref,icf -libpath​:"c​:\Appli\GTS\Dev\Perl\lib\CORE" -machine​:x86'

Locally applied patches​:


@​INC for perl 5.9.4​:
  C​:/Appli/GTS/Dev/Perl/lib
  C​:/Appli/GTS/Dev/Perl/site/lib
  .


Environment for perl 5.9.4​:
  HOME (unset)
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)

PATH=C​:\Appli\GTS\Dev\Perl\bin;C​:\PROGRA1\MICROS3\Common\msdev98\BIN;C​:\PROGRA1\MICROS3\VC98\BIN;C​:\PROGRA1\MICROS3\Common\TOOLS\WINNT;C​:\PROGRA1\MICROS3\Common\TOOLS;C​:\Perl\site\bin;C​:\Perl\bin;C​:\Perl\bin\;C​:\WINDOWS\System32;C​:\WINDOWS;C​:\WINDOWS\System32\Wbem;C​:\infAppdata\Notes\data;C​:\Program
Files\IDEpro\Ultraedit92\;C​:\Program Files\Microsoft SQL
Server\80\Tools\BINN;C​:\Program
Files\OpenSource\PuTTY;X​:\Appli\Gts\Gnu32\Bin
  PERL_BADLANG (unset)
  SHELL (unset)

This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

  ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.

@p5pRT p5pRT closed this as completed Apr 20, 2007
@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2007

@rgs - Status changed from 'new' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2007

From @rgs

On 19/04/07, via RT patrick. dugnolle @​ bnpparibas. com
<perlbug-followup@​perl.org> wrote​:

using the latest devel perl which is correcting the NAN_COMPARE_BROKEN bug
solved by Jan Dubois on Win32/MSVC6, I came accross the following bug​:

perl -MPOSIX -e "print 1.0/pow(-1,0.5)"

would trigger an "Illegal division by zero" error, instead of outputing
"-1.#IND" (the string representation of NaN on Win32)

Thanks, I've applied your patch as change #30991 to bleadperl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant