--- Gopinathan <gnadaraj@cisco.com> wrote: > Hi, > > The syslog function in my program (which runs in kernal mode) is > crashing. From the stack trace I found that, the malloc function > is > causing heap correption in between the syslog calls. Iam using > redhat6.1 with glibc2.1.x.i386.rpm. > > To narrow down the problem, I have added some more syslog messages, > that > time the application is not crashing. So it is very clear that > syslog > function in turn uses malloc (actually syslog calls vsyslog and > vsyslog > calls malloc) and because of some reason it is corrupting the heap > and > it crashes. Iam not using any signals in my program. But Iam using > callback functions. > > This is my stack trace, > > (gdb) bt > #0 0x258d3ea8 in malloc () from /lib/libc.so.6 > #1 0x258d35ce in malloc () from /lib/libc.so.6 > #2 0x258ce15c in open_memstream () from /lib/libc.so.6 > #3 0x25929360 in vsyslog () from /lib/libc.so.6 > #4 0x259292bf in syslog () from /lib/libc.so.6 > : > : > : > > Will MALLOC_CHECK_ environment variable will help me out in some > way? <snip> I understand that the malloc() call is for user-level code, and should not be called from the kernel-level. Try kmalloc() instead. Harmony, --Christine __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/