Bill wrote:
> In my application, after it runs for about 3 hours, I am getting
> SIGSEGV signal with an si_code of SEGV_MAPERR (address not mapped to
> object) when it tries to do a malloc of 65536 bytes, which it does
> successfully numerous times before it gets this seg fault. Repeated
> trials show it happening at the same place.
>
> Any ideas what may be causing this or how I might go about determining
> the cause? I am running Linux 2.6.26 on PowerPC.
Take a look at "electric fence" or valgrind. They are tools to catch
malloc/free errors.
EFence will replace malloc/free with versions which allocate entire
pages for each item you malloc(), leaving holes between these, so it
catches bugs where you run over the end of the malloc'ed area. It will
also always return free()'d areas to the OS, catching bugs where you
reference stale pointers. The core dumps it produces are gigantic ;-)
Valgrind will trace your program's execution and alert you when the
program does illegal accesses (e.g. access the 101th element in a
100-sized array). It slows down the program extremely.
Josef
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details:
http://www.fujitsu-siemens.com/imprint.html