Re: Application termination at some point



On Tue, Nov 17, 2009 at 11:23:54AM +0000, ds sundar gmail com wrote:
V> I know the bug is in my code and i want to fix that. I am new to linux  
programming and hence i am learning things now. I don't want you to fix 
the bug. What i all want to please let me know the ways that i can find 
the bug in my code.

Then again a summary:

- compile with -g and make sure the executables are not stripped, i.e.
  strip or install -s is not applied to them -- if you don't see
  function names and source code lines in gdb backtraces or valgrind
  output, then the debuggin info is missing

- compile with the lowest optimization level at which you can reproduce
  the problem (often -O0 works) to get better correspondence between the
  source code and the actual executable code

- the single most useful tool for debugging of memory-related problems
  is valgrind

- use G_SLICE=always-malloc when running GLib/Gtk+/GNOME apps under a
  memory debugger to avoid confusing reports

- learn to use gdb (and/or some graphical frontend to gdb)

- you might want to enable coredumps with
  ulimit -c unlimited
  so that programs dump core when they crash and you can examine them
  after the fact with gdb

Yeti




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]