php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28157 error: storage size of `obj' isn't known
Submitted: 2004-04-26 15:42 UTC Modified: 2004-12-21 08:00 UTC
Votes:11
Avg. Score:4.8 ± 0.4
Reproduced:11 of 11 (100.0%)
Same Version:7 (63.6%)
Same OS:4 (36.4%)
From: ralf at kuerbis dot org Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5CVS-2004-04-26 (dev) OS: Solaris 9, AIX, BSD
Private report: No CVE-ID: None
 [2004-04-26 15:42 UTC] ralf at kuerbis dot org
Description:
------------
Hi!

Trying to compile the PHP5 RC2 version on Solaris 9, the 
compile run breaks with following error:

[...]
/opt/sunsite/compile/production/php5-200404261230/ext/standard/proc_open.c:876: error: dereferencing pointer to incomplete type
/opt/sunsite/compile/production/php5-200404261230/ext/standard/proc_open.c:898: error: dereferencing pointer to incomplete type
[...many, many more...]

/opt/sunsite/compile/production/php5-200404261230/ext/standard/proc_open.c:898: error: dereferencing pointer to incomplete type
/opt/sunsite/compile/production/php5-200404261230/ext/standard/proc_open.c: At top level:
/opt/sunsite/compile/production/php5-200404261230/Zend/zend.h:283: error: storage size of `obj' isn't known
make: *** [ext/standard/proc_open.lo] Error 1

gcc --version
gcc (GCC) 3.3.2
(from sunfreeware.com)

uname -a
SunOS groundzero 5.9 Generic_112233-11 sun4u sparc SUNW,Ultra-60

Here the configure options (copied from config.nice...):

CFLAGS='-I/usr/include' \
LDFLAGS='-lstdc++' \
CC='gcc' \
'./configure' \
'--prefix=/opt/www' \
'--with-apxs=/opt/www/bin/apxs' \
'--with-mysql=/opt/mysql' \
'--with-sockets' \
'--enable-memory-limit' \
'--enable-trans-sid' \
'--sysconfdir=/opt/www/conf' \
'--with-config-file-path=/opt/www/conf' \
'--with-mcrypt=/usr/local' \
'--with-tsrm-pthreads' \
'--with-gnu-ld' \
'--with-dom=/usr/local' \
'--with-dom-xslt=/usr/local' \
'--with-dom-exslt' \
'--with-libxml-dir=/usr/local' \
'--enable-xslt' \
'--with-gd' \
'--with-zlib=/usr/local' \
'--with-xsl=/usr/local' \

As you can see above, this happens with the newest CVS and the RC2 version, but not with RC1. The RC1 runs perfectly on the same machine since one week or so.

If you need further info or some testing, please tell me. 

Best regards,
   Ralf



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-28 22:52 UTC] pds+php at alloy dot net
In ext/standard/proc_open.c, adding the following lines before #define _XOPEN_SOURCE and #define _BSD_SOURCE gets around this compile problem:

#include <fcntl.h>
#include <sys/termios.h>
 [2004-04-29 12:16 UTC] wez@php.net
This probably isn't portable to eg: Linux, so we still need to find a better fix; however, I no longer have access to a Solaris 9 machine, so this could prove difficult.
 [2004-04-29 12:30 UTC] ralf at kuerbis dot org
If you need my help in testing on a Solaris 9 machine (Ultra 1 at home and some Enterprise 420R/220R at business), just drop me a mail. 

Best regards,
   Ralf
 [2004-05-03 19:27 UTC] mose at netvision dot net dot il
The compliation error comes from the lack of these lines:
/*
 * shorthand type definitions for unsigned storage classes
 */
typedef	uchar_t		uchar;
typedef	ushort_t	ushort;
typedef	uint_t		uint;
typedef ulong_t		ulong;

in sys/types


For me (OSF4.0f) it's under 'ifndef _XOPEN_SOURCE_EXTENDED' control.
 [2004-05-05 18:29 UTC] com dot ntlworld at round7 dot mark
Just FYI, this isn't limited solely to Solaris 9, the same problem also occurs on Solaris 8, if you have access to one of those systems but not 9...

-Mark
Reverse email address to reply
 [2004-05-06 23:35 UTC] ab5602 at wayne dot edu
This problem occured and the fix worked while compiling RC2 on Solaris 8.
 [2004-05-17 22:46 UTC] ab5602 at wayne dot edu
This problem occured and the fix worked while compiling RC2 on Solaris
7 also.
 [2004-05-26 16:38 UTC] Bjorn dot Wiberg at its dot uu dot se
I am experiencing the same problem on IBM AIX 5.2.0.0, using gcc 3.3.2 from http://www.bullfreeware.com/ and PHP 5.0.0RC2.
 [2004-05-26 16:57 UTC] wez@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Please try the next php 5 snapshot dated after this message.
 [2004-05-26 17:00 UTC] ralf at kuerbis dot org
Hi !

The newer snapshots are working with Solaris 9. 

Best regards,
   Ralf
 [2004-05-27 08:59 UTC] Bjorn dot Wiberg at its dot uu dot se
Unfortunately the problem persists on AIX 5.2.0.0 with the php5-200405270430 snapshot.

The errors begin with:

--- snip ---
In file included from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/includ
e/sys/wait.h:62,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/includ
e/stdlib.h:314,
                 from /usr/local/src/php5-200405270430/main/php_config.h:2437,
                 from /usr/local/src/php5-200405270430/Zend/zend_config.h:1,
                 from /usr/local/src/php5-200405270430/Zend/zend.h:53,
                 from /usr/local/src/php5-200405270430/main/php.h:34,
                 from /usr/local/src/php5-200405270430/ext/standard/proc_open.c:
25:
/usr/include/sys/resource.h:216: error: parse error before "longlong_t"
/usr/include/sys/resource.h:218: error: parse error before "ru_idrss"
/usr/include/sys/resource.h:219: error: parse error before "ru_isrss"
/usr/include/sys/resource.h:220: error: parse error before "ru_minflt"
/usr/include/sys/resource.h:221: error: parse error before "ru_majflt"
/usr/include/sys/resource.h:222: error: parse error before "ru_nswap"
/usr/include/sys/resource.h:223: error: parse error before "ru_inblock"
/usr/include/sys/resource.h:224: error: parse error before "ru_oublock"
/usr/include/sys/resource.h:225: error: parse error before "ru_msgsnd"
/usr/include/sys/resource.h:226: error: parse error before "ru_msgrcv"
/usr/include/sys/resource.h:227: error: parse error before "ru_nsignals"
/usr/include/sys/resource.h:228: error: parse error before "ru_nvcsw"
/usr/include/sys/resource.h:229: error: parse error before "ru_nivcsw"
In file included from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/includ
e/sys/signal.h:378,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/includ
e/sys/wait.h:66,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/includ
e/stdlib.h:314,
                 from /usr/local/src/php5-200405270430/main/php_config.h:2437,
                 from /usr/local/src/php5-200405270430/Zend/zend_config.h:1,
                 from /usr/local/src/php5-200405270430/Zend/zend.h:53,
                 from /usr/local/src/php5-200405270430/main/php.h:34,
                 from /usr/local/src/php5-200405270430/ext/standard/proc_open.c:
25:
/usr/include/sys/context.h:169: error: parse error before "sigset64_t"
/usr/include/sys/context.h:172: error: parse error before '}' token
In file included from /usr/local/src/php5-200405270430/Zend/zend.h:222,
                 from /usr/local/src/php5-200405270430/main/php.h:34,
                 from /usr/local/src/php5-200405270430/ext/standard/proc_open.c:
25:
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:41: error: parse error before
 "uint"
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:41: warning: no semicolon at 
end of struct or union
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:44: error: parse error before
 "orig_lineno"
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:44: warning: type defaults to
 `int' in declaration of `orig_lineno'
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:44: warning: data definition 
has no type or storage class
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:53: error: parse error before
 ':' token
/usr/local/src/php5-200405270430/Zend/zend_alloc.h:54: error: parse error before
 ':' token
--- snip ---

The following are the configure directives used (from config.nice):

CPPFLAGS='-I/usr/local/include' \
LDFLAGS='-L/lib -L/opt/freeware/lib -L/usr/local/lib' \
CC='/usr/local/bin/gcc' \
'./configure' \
'--disable-cgi' \
'--disable-cli' \
'--enable-calendar' \
'--enable-dba' \
'--enable-exif' \
'--enable-embedded-mysqli' \
'--enable-debug' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-mbstring' \
'--enable-memory-limit' \
'--enable-versioning' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-apxs2filter=/apache/bin/apxs' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-inifile' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir' \
'--with-mime-magic' \
'--with-mnogosearch' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl=/opt/freeware' \
'--with-png-dir' \
'--with-tiff-dir' \
'--with-zlib' \
'--with-zlib-dir' \
'--without-pear' \
"$@"

The /usr/include/sys/resource.h file, around line 216, contains:
/*                                                                              
 * The structure reflects struct rusage in 64-bit mode                          
 * and is 64-bit size invariant.                                                
 */
struct  trusage64
{
        struct timeval64 ru_utime;      /* user time used */
        struct timeval64 ru_stime;      /* system time used */
        longlong_t       ru_maxrss;
        longlong_t       ru_ixrss;      /* integral shared memory size */
        longlong_t       ru_idrss;      /* integral unshared data " */
        longlong_t       ru_isrss;      /* integral unshared stack " */
        longlong_t       ru_minflt;     /* page reclaims */
        longlong_t       ru_majflt;     /* page faults */
        longlong_t       ru_nswap;      /* swaps */
        longlong_t       ru_inblock;    /* block input operations */
        longlong_t       ru_oublock;    /* block output operations */
        longlong_t       ru_msgsnd;     /* messages sent */
        longlong_t       ru_msgrcv;     /* messages received */
        longlong_t       ru_nsignals;   /* signals received */
        longlong_t       ru_nvcsw;      /* voluntary context switches */
        longlong_t       ru_nivcsw;     /* involuntary " */
};

The /usr/include/sys/context.h file, around line 169, contains:

#if defined(_LONG_LONG) || defined(__64BIT__)
/*                                                                              
 * Kernel declaration of sigcontext for 64-bit process. this assumes            
 * int is 4-bytes. 32-bit and 64-bit API both use the sigcontext above.         
 * with sigset_t for 64-bits defined as two ints.                               
 */
struct sigcontext64 {
        int                sc_onstack;  /* sigstack state to restore */
        sigset64_t      sc_mask;        /* signal mask to restore */
        int                sc_uerror;   /* u_error to restore */
        struct __context64 sc_context;  /* 64-bit state         */
};

Finally, Zend/zend_alloc.h around line 41 contains:

typedef struct _zend_mem_header {
#if ZEND_DEBUG
    long magic;
    char *filename;
    uint lineno;
    int reported;
    char *orig_filename;
    uint orig_lineno;
# ifdef ZTS
    THREAD_T thread_id;
# endif
#endif
#if ZEND_DEBUG || !defined(ZEND_MM)
    struct _zend_mem_header *pNext;
    struct _zend_mem_header *pLast;
#endif
    unsigned int size:31;
    unsigned int cached:1;
} zend_mem_header;

Best regards,
Björn
 [2004-05-28 13:24 UTC] wez@php.net
Bjoern:
Please try to find out what causes longlong_t to be defined on your system and try to trace it back to one of the _XOPEN_SOURCE style definitions.  I heard someone suggest that defining _ALL_SOURCE helped on AIX, could you please try that too.
I tried to email you directly the other day, but the email address you have supplied appears to be invalid.
 [2004-05-28 15:32 UTC] Bjorn dot Wiberg at its dot uu dot se
Hi!

Thanks for your reply!

Adding -D_ALL_SOURCES to the CPPFLAGS variable when running configure solved the problem. I've investigated /usr/include/sys/types.h, where longlong_t is supposed to be defined, but the definition depends on _LONG_LONG, which I can't find getting set anywhere...

#ifdef _LONG_LONG
typedef long long longlong_t;         
typedef unsigned long long u_longlong_t;
#endif /* _LONG_LONG */

Best regards,
Björn
 [2004-05-28 15:43 UTC] Bjorn dot Wiberg at its dot uu dot se
Oops, small type, "-D_ALL_SOURCE".

Bestregards,
Björn
 [2004-05-28 16:13 UTC] Bjorn dot Wiberg at its dot uu dot se
Hi again!

However, almost all tests ('make test') fail with a "bailout" error:


================================================================================
/usr/local/src/php5-200405270430/tests/classes/array_access_003.phpt
================================================================================

---- EXPECTED OUTPUT
object::offsetGet(1)

Strict Standards: Only variable references should be returned by reference in %sarray_access_003.php on line %d
string(6) "fooBar"
object::offsetGet(2)
int(1)
object::offsetGet(2)
object::offsetGet(2)
int(2)
===DONE===
---- ACTUAL OUTPUT
object::offsetGet(1)

Strict Standards: Only variable references should be returned by reference in /usr/local/src/php5-200405270430/tests/classes/array_access_003.php on line 15
string(6) "fooBar"
object::offsetGet(2)
int(1)
object::offsetGet(2)
object::offsetGet(2)
int(2)
===DONE===
/usr/local/src/php5-200405270430/main/main.c(1699) : Bailed out without a bailout address!
---- FAILED


I'd of course appreciate any clues as to what might cause this.

Best regards,
Björn
 [2004-06-04 08:39 UTC] Bjorn dot Wiberg at its dot uu dot se
Hi again,

Please let me know if there is anything I can do to help resolve this issue. PHP 4 compiles cleanly on the same AIX (5.2.0.0) system.

Best regards,
Bj?rn
 [2004-06-16 11:11 UTC] Bjorn dot Wiberg at its dot uu dot se
This appears to be fixed in PHP 5.0.0RC3. Thanks!

Best regards,
Bj?rn
 [2004-06-16 11:22 UTC] Bjorn dot Wiberg at its dot uu dot se
Sorry, it seems I was a little too quick there -- the compile works fine, but the 'make test' tests still fail massively on AIX 5.2.0.0. :-/


================================================================================
/usr/local/src/php-5.0.0RC3/tests/run-test/test001.phpt
================================================================================

---- EXPECTED OUTPUT
abc
---- ACTUAL OUTPUT
abc
/usr/local/src/php-5.0.0RC3/main/main.c(1694) : Bailed out without a bailout address!
---- FAILED

================================================================================
002+ /usr/local/src/php-5.0.0RC3/main/main.c(1694) : Bailed out without a bailout address!
================================================================================

(And so it goes on...)

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   56
Exts tested     :   27
---------------------------------------------------------------------

Number of tests : 1211               679
Tests skipped   :  532 (43.9%) --------
Tests warned    :    1 (  0.1%) (  0.1%)
Tests failed    :  672 (55.5%) (99.0%)
Tests passed    :    6 (  0.5%) (  0.9%)
---------------------------------------------------------------------
Time taken      :  179 seconds
=====================================================================


Best regards,
Bj?rn
 [2004-08-03 08:23 UTC] Bjorn dot Wiberg at its dot uu dot se
It turned out that this only occurs when PHP 5 is compiled with --enable-debug; most tests work fine when --enable-debug is left out. So I guess the bug can be closed.

However -- should I worry about the debug error message? PHP 4.3.8 works fine with --enable-debug, and the bailout error message looks a little worrying to me. The simple scripts I've tried so far seem to be working, though.

I'd be very thankful for any input regarding this issue!

Best regards,
Bj?rn
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 12:01:32 2024 UTC