Re: malfunctioning applications under limited stack size
- From: John Reiser <jreiserfl@xxxxxxxxxxx>
- Date: Thu, 16 Apr 2009 07:43:06 -0700
Recently, I observed several applications to malfunction when
stack size is limited to anything fewer then exactly 2 GB ...
What can be done to debug this?
Look in /var/log/messages for signs of the OutOfMemory (oom) killer.
Enable coredumps (ulimit -c; also set /proc/sys/kernel/core_uses_pid
and/or /proc/sys/kernel/core_pattern) then inspect the results with
"readelf --all <corefile>" to show the address space at the crash.
"cat /proc/<pid>/maps" to see what the address space looks like
when the process is running.
Track the address space using "strace -e trace=mmap,munmap,mprotect".
(Move the compiled binary executable somewhere else, then create an
executable shell script, using the original name, that invokes strace
on the moved binary.)
In the worst case, install a signal handler for SIGSEGV and SIGBUS,
where the handler does "cat /proc/self/maps" by itself without
using system() or stdio: open, {read, write}*, abort.
--
.
- References:
- Prev by Date: malfunctioning applications under limited stack size
- Next by Date: Re: Looking for Linux-friendly network cameras
- Previous by thread: malfunctioning applications under limited stack size
- Next by thread: how is updatedb running without a crontab entry?
- Index(es):
Relevant Pages
|