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