Ticket #194 (assigned defect)

Opened 2 years ago

Last modified 1 year ago

Compile error on OpenBSD 3.8 with PHP 5.1.4

Reported by: troex Assigned to: hans (accepted)
Priority: major Milestone:
Component: eAccelerator Version: 0.9.5
Keywords: openbsd Cc:

Description

I'm able to compile eA for PHP 4.4.1, but it fails for PHP 5.1.4 (cgi-fcgi) on OpenBSD 3.8

gcc-3.3.5
automake-1.9
autoconf-2.59

Tried 0.9.5/beta1/beta2/rc1 and latest svn version, the error stay the same:

# /opt/php5/bin/phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025

# ./configure --with-php-config=/opt/php5/bin/php-config --enable-eaccelerator=shared 
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... yes
checking build system type... i386-unknown-openbsd3.8
checking host system type... i386-unknown-openbsd3.8
checking target system type... i386-unknown-openbsd3.8
checking for PHP prefix... /opt/php5
checking for PHP includes... -I/opt/php5/include/php -I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM -I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext
checking for PHP extension directory... /opt/php5/lib/php/extensions/no-debug-non-zts-20050922
checking for PHP installed headers prefix... /opt/php5/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable eaccelerator support... yes, shared
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking mandatory system headers... yes
checking for ext/session/php_session.h... yes
checking whether union semun is defined in sys/sem.h... yes
checking for sysvipc shared memory support... no
checking for mmap shared memory support... yes
checking for mmap on /dev/zero shared memory support... yes
checking for anonymous mmap shared memory support... yes
checking for posix mmap shared memory support... no
checking for best shared memory type... anonymous mmap
checking for spinlock semaphores support... yes
checking for pthread semaphores support... no
checking for posix semaphores support... no
checking for sysvipc semaphores support... yes
checking for fcntl semaphores support... yes
checking for flock semaphores support... yes
checking for best semaphores type... spinlock
checking for sched_yield... no
checking for mprotect... yes
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... openbsd3.8 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... openbsd3.8 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
configure: creating ./config.status
config.status: creating config.h

# make
/bin/sh /usr/src/svn/eaccelerator/libtool --mode=compile gcc  -I. -I/usr/src/svn/eaccelerator -DPHP_ATOM_INC -I/usr/src/svn/eaccelerator/include -I/usr/src/svn/eaccelerator/main -I/usr/src/svn/eaccelerator -I/opt/php5/include/php -I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM -I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/src/svn/eaccelerator/eaccelerator.c -o eaccelerator.lo
mkdir .libs
 gcc -I. -I/usr/src/svn/eaccelerator -DPHP_ATOM_INC -I/usr/src/svn/eaccelerator/include -I/usr/src/svn/eaccelerator/main -I/usr/src/svn/eaccelerator -I/opt/php5/include/php -I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM -I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/src/svn/eaccelerator/eaccelerator.c  -fPIC -DPIC -o .libs/eaccelerator.o
/bin/sh /usr/src/svn/eaccelerator/libtool --mode=compile gcc  -I. -I/usr/src/svn/eaccelerator -DPHP_ATOM_INC -I/usr/src/svn/eaccelerator/include -I/usr/src/svn/eaccelerator/main -I/usr/src/svn/eaccelerator -I/opt/php5/include/php -I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM -I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/src/svn/eaccelerator/optimize.c -o optimize.lo
 gcc -I. -I/usr/src/svn/eaccelerator -DPHP_ATOM_INC -I/usr/src/svn/eaccelerator/include -I/usr/src/svn/eaccelerator/main -I/usr/src/svn/eaccelerator -I/opt/php5/include/php -I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM -I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/src/svn/eaccelerator/optimize.c  -fPIC -DPIC -o .libs/optimize.o
/usr/src/svn/eaccelerator/optimize.c: In function `compute_live_var':
/usr/src/svn/eaccelerator/optimize.c:194: error: `intptr_t' undeclared (first use in this function)
/usr/src/svn/eaccelerator/optimize.c:194: error: (Each undeclared identifier is reported only once
/usr/src/svn/eaccelerator/optimize.c:194: error: for each function it appears in.)
/usr/src/svn/eaccelerator/optimize.c:194: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:194: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:195: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:198: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:198: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:201: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:209: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:210: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:211: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:222: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:222: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:227: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:230: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:256: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:256: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:336: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:351: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:354: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:358: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:361: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c:365: error: syntax error before "end"
/usr/src/svn/eaccelerator/optimize.c: In function `optimize_bb':
/usr/src/svn/eaccelerator/optimize.c:1657: error: `intptr_t' undeclared (first use in this function)
/usr/src/svn/eaccelerator/optimize.c:2194: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:2219: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:2237: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:2261: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:2326: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:2559: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c: In function `reassign_registers':
/usr/src/svn/eaccelerator/optimize.c:3235: error: `intptr_t' undeclared (first use in this function)
/usr/src/svn/eaccelerator/optimize.c:3235: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:3248: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:3254: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:3261: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:3269: error: syntax error before "op"
/usr/src/svn/eaccelerator/optimize.c:3281: error: syntax error before "op"
*** Error code 1

Stop in /usr/src/svn/eaccelerator (line 144 of Makefile).

Attachments

intptr_t.diff (413 bytes) - added by hans on 10/25/06 16:06:46.
intptr_t changes

Change History

10/25/06 15:25:39 changed by hans

  • owner changed from somebody to hans.
  • status changed from new to assigned.

Can you please locate your php_config.h and tell me if either HAVE_STDINT_H or HAVE_INTTYPES_H is defined in there?

TIA

10/25/06 15:33:49 changed by hans

ah never mind, that answer is already answered by configure :P

checking for inttypes.h... yes
checking for stdint.h... no

10/25/06 16:06:46 changed by hans

  • attachment intptr_t.diff added.

intptr_t changes

10/25/06 16:07:30 changed by hans

Can you please try the above patch? thanks.

10/25/06 17:45:59 changed by troex

thanks it helped, now eA compile just fine, will test how it work few hours later

11/01/06 12:12:42 changed by troex

As I said berfore i'm able to compile eA but now php5 seg faults on start with eA module loaded. I will make backtrace later, no time now, sorry.

11/17/06 08:10:08 changed by acacia1602

I've got the same problem, albeit under OpenBSD 4.0 (I upgraded this week). I've got a little time to help fix the problem, but I'm a newbie to PHP. If you help explain to me how to apply the patch, I can RTFM and supply the backtrace...

12/08/06 20:47:35 changed by troex

Here it is what i did, hope it can help:
1. configured php to load eA
2. # /opt/php5/bin/php --version Segmentation fault (core dumped)
3. # gdb /opt/php5/bin/php php.core

GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-openbsd3.8"...(no debugging symbols found)

Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libfreetype.so.9.8...done.
Loaded symbols for /usr/local/lib/libfreetype.so.9.8
Reading symbols from /usr/lib/libz.so.4.1...done.
Loaded symbols for /usr/lib/libz.so.4.1
Reading symbols from /usr/local/lib/libpng.so.4.2...done.
Loaded symbols for /usr/local/lib/libpng.so.4.2
Reading symbols from /usr/local/lib/libjpeg.so.62.0...done.
Loaded symbols for /usr/local/lib/libjpeg.so.62.0
Reading symbols from /usr/lib/libm.so.2.0...done.
Loaded symbols for /usr/lib/libm.so.2.0
Reading symbols from /opt/mysql5/lib/mysql/libmysqlclient.so.15.0...done.
Loaded symbols for /opt/mysql5/lib/mysql/libmysqlclient.so.15.0
Reading symbols from /usr/local/lib/libxml2.so.9.0...done.
Loaded symbols for /usr/local/lib/libxml2.so.9.0
Reading symbols from /usr/local/lib/libiconv.so.4.0...done.
Loaded symbols for /usr/local/lib/libiconv.so.4.0
Reading symbols from /usr/lib/libc.so.38.2...done.
Loaded symbols for /usr/lib/libc.so.38.2
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
Reading symbols from /opt/php5/lib/php/modules/eaccelerator.so...done.
Loaded symbols for /opt/php5/lib/php/modules/eaccelerator.so
#0  0x0d2db482 in memcpy () from /usr/lib/libc.so.38.2
(gdb) bt
#0  0x0d2db482 in memcpy () from /usr/lib/libc.so.38.2
#1  0x1c1bafc6 in _zend_hash_add_or_update ()
#2  0x1c1bc075 in zend_hash_copy ()
#3  0x0a166c99 in zm_activate_eaccelerator (type=1, module_number=25)
    at /usr/src/eaccelerator-0.9.5/eaccelerator.c:2109
#4  0x1c1b8bc1 in module_registry_request_startup ()
#5  0x1c1bbe58 in zend_hash_apply ()
#6  0x1c1b4bc5 in zend_activate_modules ()
#7  0x1c1822b4 in php_request_startup ()
#8  0x1c20fd75 in main ()
(gdb) 


01/29/07 23:35:33 changed by bart

In revision [287] I removed that piece of code that caused the segfault because it was no longer used. Do you use the stock php that comes with openbsd? Because if I recall correctly php in all bsd flavors is patched with suhosin/hardened-php, I'll try that here later on.

Can you try the version in svn?

06/23/07 14:17:48 changed by greg

For whatever reason this now works with latest SVN, PHP 5.2.2 on OpenBSD 4.2-CURRENT. Compiles fine after applying the patch and runs fine.