This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,825 Users
  • 2,269,775 Discussions
  • 7,916,823 Comments

Discussions

php-fpm works fine w/ 12.5; dumps core w/ 12.6b

RaiderOfTheLostSPARC
RaiderOfTheLostSPARC Member Posts: 259 Blue Ribbon

Hi, seems like PHP 7.1.4 doesn't like 12.6...

Fetch PHP 7.1.4 from http://www.php.net/downloads.php and run the following commands:

xzcat php-7.1.4.tar.xz| pax -rf -

cd php-7.1.4

wget https://raw.githubusercontent.com/OpenIndiana/oi-userland/oi/hipster/components/web/php/php-7_0/patches/03-event_port.patch

gpatch -p1 < 03-event_port.patch

patching file sapi/fpm/fpm/events/port.c

vi ext/fileinfo/libmagic/apprentice.c

Add  #include <stddef.h> , see https://bugs.php.net/bug.php?id=70492

PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/opt/developerstudio12.5/bin ./configure NM=/usr/gnu/bin/nm CPPFLAGS='-D_LARGEFILE64_SOURCE' CC=cc CFLAGS='-m64 -Ui386 -U__i386 -g -O -KPIC -DPIC -std=c11 -mt' LDFLAGS='-m64 -zaslr=enable -znxstack=enable -znxheap=enable -M /usr/lib/ld/map.noexbss -M /usr/lib/ld/map.noexdata -M /usr/lib/ld/map.pagealign -Bdirect -zignore -zstrip-class=comment -lumem' --prefix=/opt/php7 --enable-mbstring --with-openssl --enable-fpm --with-fpm-user=webservd --with-fpm-group=webservd --enable-opcache --with-pcre-regex=/usr

PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/opt/developerstudio12.5/bin gmake -j4

# with 12.5

TEST_PHP_EXECUTABLE=./sapi/cli/php ./sapi/cli/php run-tests.php sapi/fpm/tests/009.phpt

...

PASS FPM: Test Unix Domain Socket [sapi/fpm/tests/009.phpt]

# with 12.6

gmake clean

PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/opt/developerstudio12.6b/bin gmake -j4

TEST_PHP_EXECUTABLE=./sapi/cli/php ./sapi/cli/php run-tests.php sapi/fpm/tests/009.phpt

...

FAIL FPM: Test Unix Domain Socket [sapi/fpm/tests/009.phpt]

Hm?!

pstack core

core 'core' of 22939:   ./sapi/fpm/php-fpm -F -O -y /tmp/php/php-7.1.4/sapi/fpm/tests/test-fpm

0000000001a12f62 fpm_request_accepting () + 32

pstack: warning: librtld_db failed to initialize; symbols from shared libraries will not be available

Answers

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Apr 17, 2017 10:08AM

    What platform are you using: x86 or sparc, Solaris or Linux, and which OS version?

    Also please notice that some compiler default options have changed. Be sure the CC and cc commands are what you expect them to be.

  • RaiderOfTheLostSPARC
    RaiderOfTheLostSPARC Member Posts: 259 Blue Ribbon
    edited Apr 18, 2017 6:26AM

    Solaris 11.3 SRU18, x86 (see Tags)

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Apr 18, 2017 12:22PM

    I was unable to complete the build using Studio 12.6 Beta on Solaris 11.3/x86. I followed your download, patch, and config commands. The C compiler rejected /ext/spl/spl_observer.c with various errors. Maybe you omitted a step?

  • RaiderOfTheLostSPARC
    RaiderOfTheLostSPARC Member Posts: 259 Blue Ribbon
    edited Apr 18, 2017 12:41PM

    That happens when you run configure with the 12.6b compiler making configure believe you can use builtin expect (whatever that is), 12.5 is fine.

    See https://community.oracle.com/thread/4032905

    You have two options:

    1) run configure with the 12.5 compiler (as I did in the steps above)

    2) undef PHP_HAVE_BUILTIN_EXPECT in main/php_config.h after running configure

    EDIT: horrible layout corrected

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Apr 18, 2017 2:15PM

    Thanks. Now I can duplicate the problem.

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Apr 18, 2017 6:22PM

    Here's where we are now:

    We are not familiar with building PHP. It self-configures, and the output of the build command does not show any of the commands (cc, CC, etc). It's possible that the commands are relying on default behavior that has changed in Studio 12.6. That's the first thing I would look for if I could see the commands.

    The compilers emit a lot of warnings. It's possible that the runtime failure is due to questionable source code. That is the second thing I would look for. The easiest way to look into a warning is to generate a preprocessed file so that we can see the exact code the compiler sees. To do that, we need to see the commands that resulted in the warnings.

    Can you suggest how to get the makefiles to emit the commands as they are executed?

  • RaiderOfTheLostSPARC
    RaiderOfTheLostSPARC Member Posts: 259 Blue Ribbon
    edited Apr 19, 2017 6:35AM

    Uhm… Like this?

    PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/opt/developerstudio12.6b/bin:/usr/sbin gmake V=1 fpm

    ...

    /bin/sh /tmp/php-7.1.4/libtool --silent --preserve-dup-deps --mode=compile cc -I/tmp/php-7.1.4/sapi/fpm -Isapi/fpm/ -I/tmp/php-7.1.4/sapi/fpm/ -DPHP_ATOM_INC -I/tmp/php-7.1.4/include -I/tmp/php-7.1.4/main -I/tmp/php-7.1.4 -I/tmp/php-7.1.4/ext/date/lib -I/usr/include/libxml2 -I/usr/include/pcre -I/usr/include/openldap -I/tmp/php-7.1.4/ext/mbstring/oniguruma -I/tmp/php-7.1.4/ext/mbstring/libmbfl -I/tmp/php-7.1.4/ext/mbstring/libmbfl/mbfl -I/tmp/php-7.1.4/ext/sqlite3/libsqlite -I/tmp/php-7.1.4/TSRM -I/tmp/php-7.1.4/Zend  -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS  -I/usr/include -m64 -Ui386 -U__i386 -g -O -KPIC -DPIC -std=c11 -mt -DZEND_SIGNALS  -c /tmp/php-7.1.4/sapi/fpm/fpm/fpm_trace.c -o sapi/fpm/fpm/fpm_trace.lo

    ...

  • RaiderOfTheLostSPARC
    RaiderOfTheLostSPARC Member Posts: 259 Blue Ribbon
    edited Jul 1, 2017 3:59PM

    Seems to be the same issue as

    __sync Builtins works when compiled with -m32, broken with -m64

    As soon as I change

    #define atomic_cmp_set(a,b,c) __sync_bool_compare_and_swap(a,b,c)

    to

    #define atomic_cmp_set(a,b,c) __sync_bool_compare_and_swap(a,(atomic_t)b,c)

    everything is fine. Too bad the fix didn't make it into the 12.6 release

This discussion has been closed.