RE: Syslog fixes a bug?

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

 



 
> -----Original Message-----
 Michael Wieher said
>
> Hey,
> 
> I have a program that dies mysteriously.
> 
> If I use syslog() to attempt to write data and see where it dies, it
> lives and works perfectly.
> 

Every time I had something like that it was buffer over/under run type
problem. When you make the change, some other thing comes after/before
the affected buffer in the  memory layout, such that writing it does not
cause program death . 
One time early in my c programming,  I spent ages scratching my head
when an extra 'printf' had the same effect you describe, before I knew
about that,  and eventually used 'Electric Fence' tool by Bruce Perens,
which found it right away ... as it was simply my program writing past
the end of a 'malloc'ed memory space
 >oops<  .. If it's more subtle then other debugging tools may help!
 Gdb, Dmalloc , dbmalloc, valgrind, etc. etc. ( unless you are
determined to stare the code in the eye yourself and eschew all
debuggign tools for weaklings  :-P )






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux