Bug #73954 [Asn->Csd]: NAN check fails on Alpine Linux with musl

From: Date: Sun, 05 Feb 2017 01:34:43 +0000
Subject: Bug #73954 [Asn->Csd]: NAN check fails on Alpine Linux with musl
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207177@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73954&edit=1

 ID:                 73954
 Updated by:         ajf@php.net
 Reported by:        zaq178miami at gmail dot com
 Summary:            NAN check fails on Alpine Linux with musl
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            *General Issues
 Operating System:   Alpine Linux
 PHP Version:        Irrelevant
 Assigned To:        ajf
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=21d7878690c18124fa788f2aa22e505a4fa6ceeb
Log: Fix bug #73954


Previous Comments:
------------------------------------------------------------------------
[2017-02-05 00:17:44] ajf@php.net

…no, wait, I just can't read source code properly without syntax highlighting. Ignore me,
sorry.

------------------------------------------------------------------------
[2017-02-05 00:14:07] ajf@php.net

(Sure enough, it's mine. I moved it from ext/standard, but it was already in a different m4
file in Zend. Oops.)

------------------------------------------------------------------------
[2017-02-05 00:10:42] ajf@php.net

I'm not sure if that PR actually fixes the issue, but I'll test it.

Side-note: we currently define zend_isnan() twice, in both Zend.m4 and configure.m4. I don't
know why, that might be my fault.

------------------------------------------------------------------------
[2017-02-04 23:56:29] nikic@php.net

Note that there is a PR up to fix this issue: https://github.com/php/php-src/pull/2356

------------------------------------------------------------------------
[2017-02-04 23:47:21] ajf@php.net

Okay, I got an Alpine install up and running in a VM and I can reproduce this for php-src master:

localhost:~/php-src# uname -a; sapi/cli/php -v; sapi/cli/php -r 'function foo(in
t $x) {} var_dump(foo(NAN));'
Linux localhost 4.4.45-0-virtgrsec #1-Alpine SMP Thu Jan 26 14:32:43 GMT 2017 x86_64 Linux
PHP 7.2.0-dev (cli) (built: Feb  4 2017 23:35:47) ( NTS DEBUG )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
NULL

Whereas on macOS:

Andreas-MacBook-Air:php-src ajf$ uname -a; sapi/cli/php -v; sapi/cli/php -r 'function foo(int
$x) {} var_dump(foo(NAN));'
Darwin Andreas-MacBook-Air.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016;
root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
PHP 7.2.0-dev (cli) (built: Jan 31 2017 21:23:57) ( NTS DEBUG )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.2.0-dev, Copyright (c) 1999-2017, by Zend Technologies

Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type integer, float
given, called in Command line code on line 1 and defined in Command line code:1
Stack trace:
#0 Command line code(1): foo(NAN)
#1 {main}
  thrown in Command line code on line 1

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=73954


--
Edit this bug report at https://bugs.php.net/bug.php?id=73954&edit=1


Thread (20 messages)

« previous php.bugs (#207177) next »