[opensuse-programming] is vsyslog() reentrant / thread-safe?
All, I've several core dumps that all point to vsyslog() being the culprit. I've got a chunk of heap-storage being overwritten by a formatted logline: <23>Apr 21 11:22:33 process[pid]: .... I was just wondering if vsyslog() and thread-safety would ring a bell with anyone? /Per Jessen, Zürich --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On Mon, 21 Apr 2008 18:35:34 +0200, Per Jessen wrote:
I've several core dumps that all point to vsyslog() being the culprit. I've got a chunk of heap-storage being overwritten by a formatted logline:
Have you tried compiling the app with -D_FORTIFY_SOURCE=2? This will add runtime stack and buffer overflow checking to your code (this is what nearly all code in openSUSE is compiled with and helps quite a lot) and may help in finding the place where the app blows up. Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Philipp Thomas wrote:
On Mon, 21 Apr 2008 18:35:34 +0200, Per Jessen wrote:
I've several core dumps that all point to vsyslog() being the culprit. I've got a chunk of heap-storage being overwritten by a formatted logline:
Have you tried compiling the app with -D_FORTIFY_SOURCE=2? This will add runtime stack and buffer overflow checking to your code (this is what nearly all code in openSUSE is compiled with and helps quite a lot) and may help in finding the place where the app blows up.
This is a runtime check? I'll try it. I get the situation about once a day. In the meantime I've changed my vsyslog() call to a call to vsnprintf+syslog - which didn't change anything. So maybe the right question is - is syslog() threadsafe? /Per Jessen, Zürich --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Per Jessen wrote:
This is a runtime check? I'll try it. I get the situation about once a day.
The -D_FORTIFY_SOURCE=2 didn't change anything.
In the meantime I've changed my vsyslog() call to a call to vsnprintf+syslog - which didn't change anything. So maybe the right question is - is syslog() threadsafe?
Well, I'm still seeing the following about once a day: a chunk of heap which I've malloc'ed is overwritten by a syslog line (from another thread): <23>Apr 27 03:08:46 distripg[20987]: response[2/1219288]: The <23> is very indicative of syslog(). I'm tempted to guard my syslog() call with an explicit mutex and see if that changes anything. /Per Jessen, Zürich --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
participants (2)
-
Per Jessen
-
Philipp Thomas