Re: Seg Faults



On Aug 6, 6:17 am, Matt <matt...@xxxxxxxxxxx> wrote:
Hey guys. I've got a general question here regarding segmentation
faults.

.....

So, as the programme is far too large to post up, I was hoping to draw
on the experience of you guys and come up with some possible sources
of this error. Any suggestions are welcome.


Without code, people can only offer generalities, like checking
pointers for NULL prior to dereferencing them, not using freed memory,
not using uninitialized pointers, not overwriting bounds of allocated
memory, etc. If you always crash at the same point in the program
(seen by logging/etc), it is usually straightforward to figure out
why. Add some print statements showing the objects in use (pointers,
etc), and figure out the problem that way. If you crash at random
points, that is trickier.

<OT>If you are on a system where a core file is available after a
segmentation fault, that can be helpful. Sometimes you need to enable
this (e.g. via ulimit on linux).

There are also lots of tools that can rescue you. If you always crash
in the same place, running under a debugger, putting a breakpoint
there, and looking at things can help. There are some tools, which
may be available on your system, some free, some not, like valgrind,
electric fence, purify, etc, that can be very nice for tracking down
this sort of problem. If you use glibc, the MALLOC_CHECK_ environment
variable set to 2 can occasionally help too, causes core dump on
bounds overwrites, though only when the memory is actually freed.
</OT>

-David

.



Relevant Pages

  • Re: Not Responding errors
    ... insufficient RAM memory. ... use this type of programme check these first observing how the page ... Software Updates - 5 (don't know if they're necessary so I haven't ... Event Type: Error Event Source: Automatic LiveUpdate Scheduler ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Not Responding errors
    ... You have many programmes requiring abnormal amounts of memory: ... Adobe PhotoShop ... when you close the programme. ... Software Updates - 5 (don't know if they're necessary so I haven't ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Not Responding errors
    ... To test your memory download memory test from here: ... You think it's Norton? ... Responding message for the programme you have started. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: msconfig
    ... I have AMD 2.8 running on an a850e HP maxed out at 1 gb add on memory. ... How much RAM memory do you have and what is your typical pagefile usage? ... you use this type of programme check these first observing how the page ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: how do you use pfmon.exe
    ... Pfmon displays a list of hard page faults in the command window while the ... might want to rerun Pfmon while limiting the amount of memory to see how your ... LeakyApp is a GUI tool included on the Windows 2000 Resource Kit CD. ...
    (microsoft.public.win2000.cmdprompt.admin)