#17785 [Asn->Csd]: Unions by reference result in compile failure
| From: | msopacua@php.net | Date: | Sat, 23 Nov 2002 15:13:33 +0000 |
| Subject: | #17785 [Asn->Csd]: Unions by reference result in compile failure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-25642@lists.php.net to get a copy of this message | ||
ID: 17785
Updated by: msopacua@php.net
Reported By: msopacua@idg.nl
-Status: Assigned
+Status: Closed
Bug Type: Semaphore related
Operating System: BSD/OS 4.2
PHP Version: 4.0CVS-2002-06-16
Assigned To: msopacua
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-07-22 14:55:52] msopacua@idg.nl
Thanx Derick :-)
The problem seems to be more than a compiling issue only.
On FreeBSD (tested on 4.5 and 4.6) this compiles ok, but
than segfaults on it. The problem is however with the
sysvsem_sem struct:
Program received signal SIGSEGV, Segmentation fault.
0x813bdef in zif_sem_remove (ht=0,
return_value=0x3d3c4f16, this_ptr=0x0,
return_value_used=0) at
/home/mdev/cvs/php4/ext/sysvsem/sysvsem.c:391
391 if(semctl(sem_ptr->semid, 0, IPC_RMID,
&un) < 0) {
(gdb) bt
#0 0x813bdef in zif_sem_remove (ht=0,
return_value=0x3d3c4f16, this_ptr=0x0,
return_value_used=0) at
/home/mdev/cvs/php4/ext/sysvsem/sysvsem.c:391
#1 0x0 in ?? ()
(gdb) print un
$1 = {val = 656363, buf = 0xa03eb, array = 0xa03eb}
(gdb) print &un
$2 = (union semun *) 0xbfbfbdbc
(gdb) print sem_ptr
$3 = (sysvsem_sem *) 0xa03eb
(gdb) print sem_ptr->semid
Error accessing memory address 0xa03f3: Bad address.
I noticed that the union for FreeBSD is also different,
than the one declared in sysvsem.c - especially the
seminfo *__buf pointer is missing. So this may require
some more attention, than just a compile fix.
------------------------------------------------------------------------
[2002-07-13 18:21:58] derick@php.net
Assinging to Melvyn
------------------------------------------------------------------------
[2002-06-16 10:26:03] msopacua@idg.nl
/chroot/home/mdev/php4-200206160300/ext/sysvsem/sysvsem.c: In function
`zif_sem_remove':
/chroot/home/mdev/php4-200206160300/ext/sysvsem/sysvsem.c:382:
incompatible type for argument 4 of `semctl'
/chroot/home/mdev/php4-200206160300/ext/sysvsem/sysvsem.c:391:
incompatible type for argument 4 of `semctl'
The fix seems to be to replace &un by un in the corresponding lines.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17785&edit=1