OS/2, eCS & ArcaOS - Technical > Programming

libc panic

(1/2) > >>

Jochen Schäfer:
Hi.

I'm porting nginx. I was able to build a binary and nginx can serve me static HTML pages.
I can stop nginx via process signaling. That just works fine.
But if I want to restart nginx, I get the following:

--- Code: ---nginx: [alert] shmget(384) failed (22: Invalid argument)

LIBC PANIC!!
safesem mutex requested failed, rc=0x6. pmtx=5fe10960:{.hmtx=0x800100fb .fShared
=0x1}
pid=0x0fbb ppid=0x0b43 tid=0x0001 slot=0x009c pri=0x0200 mc=0x0001 ps=0x0017
U:\WORK\NGINX\OBJS\NGINX.EXE
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

--- End code ---

Now, I have to reboot to get nginx running again.

I have the newest klibc installed and the binary is compiled with gcc 4.9.2.
Does anyone have suggestions, how to handle the problem?

Bye Jochen

PS: If someone wants to test the port, PM me.  I'll send you the binary.

Dave Yeo:
Try adding -Zhigh-mem to your LDFLAGS

Jochen Schäfer:
I have already compiled nginx with -Zhigh-mem.
Actually, I used:

--- Code: ---CFLAGS = -D__EMX__ -DEMX -DOS2 -Zmt  -D__ST_MT_ERRNO__ -g -march=pentium -mtune=pentium4 -static-libgcc
--- End code ---
and

--- Code: ---LDFLAGS = -Zomf -Zmap -Zhigh-mem -Zstack 8000 -D__ST_MT_ERRNO__ -static-libgcc -lmmap -Zexe
--- End code ---

Joop:
All libc panics I had with Java had to do with a short of available memory. I don't know if this is the same in your situation.

Jochen Schäfer:
I don't think, it's an memory problem. The problem is consistently the start of nginx after a previous shutdown.

The nginx code for the use of shared memory relies on the automatic removal of shared memory at process shutdown.
My guess is, that klibc ignores this flag and by the time nginx is started the second time, the shared semaphore is still in use and can't be recreated.
That leads to the lib panic.
Does someone know whether I can fetch a list of shared memory segments to release?

Navigation

[0] Message Index

[#] Next page

Go to full version