LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Andrew Friedley (CNS Student Support) (saai_at_[hidden])
Date: 2004-01-08 15:14:51


I am attempting to build LAM 7.0.3 from source on a sun ultra enterprise
5000 system, with four ultrasparc 1 cpu's. The system is running debian
3.0r1 stable, with a custom 2.4.22 kernel. I am having trouble getting
SYSV semaphore support detected properly. During the configure process,
I see this:

checking for struct semid_ds... yes
checking if SYSV semaphores work... no
checking if SYSV semaphores work with -lrt... no
checking if SYSV semaphores work with -lcygipc... no
checking for SYSV semaphore support... no

***************************************************************
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
***************************************************************
  We could not detect SYSV semaphore support on your machine.
  If you believe your system has SYSV semaphore support, please
  contact the LAM/MPI mailing list (lam_at_[hidden])
***************************************************************
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
***************************************************************

checking for struct shmid_ds... yes
checking if SYSV shared memory works... yes
checking for SYSV shared memory support... yes

Looking at config.log, I see this:

configure:15092: checking if SYSV semaphores work
configure:15130: gcc -o conftest -O3 -DLAM_BUILDING=1 conftest.c >&5
configure:15133: $? = 0
configure:15135: ./conftest
./configure: line 1: 4635 Segmentation fault ./conftest$ac_exeext
configure:15138: $? = 139
configure: program exited with status 139
configure: failed program was:

.... (lines omitted)

| int main(int argc, char **argv){
| int semid;
| /* Create a private semaphore set */
| semid = semget (IPC_PRIVATE, 1, 0777);
| /* If successful try to release it */
| if( semid == -1 || semctl(semid, 0, IPC_RMID) == -1 ){
| exit(3); /* one of them failed */
| }
| return 0; /* semget() and semctl() work */
| }

I know for sure that SYSV support is properly enabled and supported by
the system, as other code (my own) that uses it works fine. I also
verified and made sure that SYSV support is enabled in my kernel.

I compiled & ran this program separately and it does indeed segfault. I
compiled and ran the same file on an x86 system without modification,
and it does not segfault. Debugging shows that the semctl() call is
where the program is segfaulting. The semctl manpage shows four
arguments, instead of three:

int semctl (int semid, int semnum, int cmd, union semun arg)

After defining the union as it is shown in the semctl manpage and
passing an unused instance of that union as the fourth argument to
semctl, the program runs correctly without a segfault.

This to me looks like a bug in the LAM configure. And, if the LAM
configure calls semctl() incorrectly, then I wouldn't be surprised if
the LAM code itself did so too. What can I do to solve this problem?

-- 
Andrew Friedley
CNS Computing - Student Staff
University of Northern Iowa