Bug #17785 Updated: Unions by reference result in compile failure

From: Date: Mon, 22 Jul 2002 18:55:53 +0000
Subject: Bug #17785 Updated: Unions by reference result in compile failure
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14782@lists.php.net to get a copy of this message
ID: 17785 Updated by: msopacua@idg.nl Reported By: msopacua@idg.nl Status: Assigned Bug Type: Semaphore related Operating System: BSD/OS 4.2 PHP Version: 4.0CVS-2002-06-16 Assigned To: msopacua New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#14782) next »