Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  Bison crashes during PHP Build; fix diffs included

    Posted Wed March 13, 2019 01:21 PM

    Originally posted by: Michael Jack


    A bison program delivered in bison-3.0.4-1.aix6.1.ppc.rpm crashed when being used to build PHP source.

     

    I had to use the PHP 7.2.14 source rpm to rebuild the package using its spec file, so that I could add in the unixODBC package as a PHP module. The PHP 7.2.14 binary rpm is provided in 32 bit mode only, rather than 32 and 64 bit like other packages, and its spec file enforces flags and settings for 32 bit mode compilation.

     

    During compilation of the PHP source, the bison program crashed with a SIGSEGV error (Signal 11)

    ...

    Zend/zend_language_scanner.l: In function 'startup_scanner':
    Zend/zend_language_scanner.l:184:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
    Zend/zend_language_scanner.l: In function 'shutdown_scanner':
    Zend/zend_language_scanner.l:198:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
    make: 1254-059 The signal code from the last command is 11.


    Stop.

    The generated core dump showed it crashed in a call to posix_spawn_file_actions_init and was using bison_64 during a 32 bit compile

    My_Server:/opt/freeware/src/packages/BUILD/php-7.2.14# file /coredumps/core*
    /coredumps/core.10223794.13003739: AIX core file fulldump 64-bit, bison_64

    My_server:/opt/freeware/src/packages/BUILD/php-7.2.14# dbx /opt/freeware/bin/bison_64 /coredumps/core*
    Type 'help' for help.
    [using memory image in /coredumps/core.10223794.13003739]
    reading symbolic information ...warning: Unable to access the stab file. Some info may not be available


    Segmentation fault in posix_spawn_file_actions_init at 0x90000000026759c ($t1)
    0x90000000026759c (posix_spawn_file_actions_init+0x3c) 98640000         stb   r3,0x0(r4)
    (dbx) where
    posix_spawn_file_actions_init(??) at 0x90000000026759c
    create_pipe(??, ??, ??, ??, ??, ??, ??, ??) at 0x1000514c8
    create_pipe_bidi(??, ??, ??, ??, ??, ??, ??) at 0x100051a00
    output() at 0x10001f9d8
    main(??, ??) at 0x100000764
    (dbx) quit

    The object mode was set to 32 bit, where I would have expected the 32 bit bison program to have been used. The problem was due to the spec file found in bison-3.0.4-1.src.rpm, containing a "-maix64" CFLAG setting when it is being built in 32 bit mode. I repeated the problem after rebuilding the bison source rpm, then found and fixed the bit mode error and then the PHP compile succeeded.

     

    Below is a diff against the bison spec file to fix this problem, and other problems that the bison source build gave warnings about

    My_Server:/.../rpms/src/bison > /opt/freeware/bin/diff -Naur bison-3.0.4-1.spec bison-3.0.4-1mj1.spec
    --- bison-3.0.4-1.spec  2017-04-25 11:43:07 +0000
    +++ bison-3.0.4-1mj1.spec       2019-03-13 03:34:13 +0000
    @@ -101,7 +101,7 @@

     ## # now build the 32-bit version
     cd ../32bit
    -export CC="gcc -maix64 -D_LARGE_FILES"
    +export CC="gcc -maix32 -D_LARGE_FILES"
     #export CXX="/usr/vacpp/bin/xlC_r"
     export OBJECT_MODE=32

    @@ -126,7 +126,7 @@
     export AR="/usr/bin/ar -X64"
     export OBJECT_MODE=64
     make DESTDIR=${RPM_BUILD_ROOT} install
    -/usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || :
    +/usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/bison || :
     (
       cd ${RPM_BUILD_ROOT}%{_bindir}
       for f in *
    @@ -139,7 +139,7 @@
     export AR="/usr/bin/ar -X32"
     export OBJECT_MODE=32
     make DESTDIR=${RPM_BUILD_ROOT} install
    -/usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || :
    +/usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/bison || :
     (
       cd ${RPM_BUILD_ROOT}%{_bindir}
       for f in bison yacc
    @@ -215,7 +215,7 @@

     %files
     %defattr(-,root,system)
    -%doc 32bit/AUTHORS 32bit/AUTHORS 32bit/COPYING 32bit/ChangeLog 32bit/INSTALL 32bit/NEWS 32bit/README 32bit/THANKS
    +%doc 32bit/AUTHORS 32bit/COPYING 32bit/ChangeLog 32bit/INSTALL 32bit/NEWS 32bit/README 32bit/THANKS
     %{_bindir}/*
     %{_mandir}/man1/*
     %{_infodir}/bison*
    @@ -228,16 +228,16 @@
     %{_libdir}/*.a

     %changelog
    -* Tue Sep 21 2015 Tony Reix <tony.reix@bull.net> 3.0.4-1
    +* Mon Sep 21 2015 Tony Reix <tony.reix@bull.net> 3.0.4-1
     - Update to 3.0.4

    -* Thu Jul 07 2012 Gerard Visiedo <gerard.visiedo@bull.net> 2.5-1
    +* Sat Jul 07 2012 Gerard Visiedo <gerard.visiedo@bull.net> 2.5-1
     - Initial port on Aix6.1

     * Fri May 6 2011 Patricia Cugny <patricia.cugny@bull.net> 2.4.3-1
     - Update to 2.4.3

    -* Mon Jun 1 2010 Jean Noel Cordenner <jean-noel.cordenner> 2.4.2
    +* Tue Jun 1 2010 Jean Noel Cordenner <jean-noel.cordenner> 2.4.2
     - Update to 2.4.2

    Can this be added to the Bison AIX Toolbox package so it can be rebuilt to correct the problem?

     

    Thanks,

    Michael


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 2.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Wed March 13, 2019 01:34 PM

    Originally posted by: AyappanP


    Thanks for reporting the issue.

    We already fixed this issue in the updated bison-3.0.5 package in Toolbox.


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 3.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Wed March 13, 2019 01:44 PM

    Originally posted by: Michael Jack


    Hi Ayappan.

    Thanks for your quick response.

    The AIX Toolbox website is still showing version 3.0.4, not 3.0.5, both on the Alphabetic page view and date page views.

    My server is not internet connected, so I cannot sync with the yum repository to get the latest version, I have to rely on the website versions.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 4.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Wed March 13, 2019 01:48 PM

    Originally posted by: AyappanP


    Oh yes, we haven't updated the HTML page after recent package updates.

    We will do that soon. Meantime you can check in the FTP site.

    ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 5.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Thu March 14, 2019 08:57 AM

    Originally posted by: Michael Jack


    Hi again Ayappan.

    I uninstalled bison 3.0.4 last night and tried a PHP compile using bison 3.0.5. Unfortunately it crashes in the same place during the PHP compile.

    ...

    /opt/freeware/src/packages/BUILD/php-7.2.14/Zend/zend_virtual_cwd.h:324:0: note: this is the location of the previous definition
     # define VCWD_ACCESS(pathname, mode) access_aix(pathname, mode)

    Zend/zend_language_scanner.l: In function 'startup_scanner':
    Zend/zend_language_scanner.l:184:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
    Zend/zend_language_scanner.l: In function 'shutdown_scanner':
    Zend/zend_language_scanner.l:198:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
    make: *** [Makefile:543: /opt/freeware/src/packages/BUILD/php-7.2.14/Zend/zend_ini_parser.c] Segmentation fault (core dumped)
    error: Bad exit status from /var/tmp/rpm-tmp.6uYaab (%build)

     

    The coredump produced showed the same stack trace and assembler line as the one recorded above.

    When looking for why I am seeing a crash, there is no root cause that jumps out.
    The settings below are from the Bison spec file for 3.0.4, 3.0.5, and my locally fixed and built 3.0.4 version

    3.0.4 bison_64 compile - CC="gcc -maix64 -D_LARGE_FILES"      OBJECT_MODE=64
    3.0.4 bison_32 compile - CC="gcc -maix64 -D_LARGE_FILES"      OBJECT_MODE=32
    Both binary rpm package and locally built source rpm package program crashes (uses bison_64 when compiling the PHP package)

    3.0.5 bison_64 compile - CC="gcc -maix64 -O2"                 OBJECT_MODE=64
    3.0.5 bison_32 compile - CC="gcc -maix32 -O2  -D_LARGE_FILES" OBJECT_MODE=32
    Binary rpm package program crashes (uses bison_64 when compiling the PHP package)

    My    bison_64 compile - CC="gcc -maix64 -D_LARGE_FILES"      OBJECT_MODE=64
    My    bison_32 compile - CC="gcc -maix32 -D_LARGE_FILES"      OBJECT_MODE=32
    Locally built 3.0.4 source rpm package with the bison_32 change works (but uses bison_64 when compiling the PHP package)
    I can't see why my compiled version of bison_64 works when compiling PHP. It uses the same compile flags as the proper 3.0.4 package.

    I have built my version using the gcc-6.3.0-2 rpm package, on an AIX 6.1 machine (oslevel -s gives 6100-09-03-1415)

     

    In each case I have erased the existing install bison binary rpm file and then installed the new one


    Other than that, I can't see a root cause for the crash occurring on the newer 3.0.5 version.

    There are 32bit compile flags set during the PHP compile, and the build is using the /opt/freeware/bin/bison link to bison_64.

    Both the crashing and the working versions of bison_64 operate under the same 32 bit flags used during the PHP compile


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 6.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Thu March 14, 2019 09:29 AM

    Originally posted by: AyappanP


    Okay. Looks like "-O2 " could be a suspect.

    We will analyze it more and will fix it. Thanks for reporting the issue. 


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 7.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Thu March 14, 2019 03:43 PM

    Originally posted by: Michael Jack


    Further information

    For the bison 3.0.4 package, I took the website source rpm and compiled it locally without changes, then installed it and it failed during the PHP compile.

    I then corrected the 32 bit flags for 3.0.4 and recompiled it and installed it, and it worked for the PHP compile, even though it was using the 64bit bison.

    Today I have tried a local compile and install of the 3.0.5 source rpm from the AIX Toolbox website, without changes, and it works when compiling PHP.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 8.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Fri March 15, 2019 02:31 AM

    Originally posted by: AyappanP


    Okay. Thanks for the info. 

    We will check it.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 9.  Re: Bison crashes during PHP Build; fix diffs included

    Posted Thu June 20, 2019 08:19 AM

    Originally posted by: AyappanP


    Fixed and not an issue anymore. 


    #AIX-Open-Source-Software
    #AIXOpenSource