[Top][All Lists]

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

SIGSEGV syslog(3) Part 2

From: Adam H . Pendleton
Subject: SIGSEGV syslog(3) Part 2
Date: Fri, 17 Jan 2003 09:00:14 -0500

Having said the problem does not occur under valgrind was not exactly a false statement, but not exactly true, either. Here is the error that valgrind gives me, which may or may not be the cause of my problem:

==2630== Syscall param msgrcv(msgp->mtext) contains unaddressable byte(s)
==2630==    at 0x420DB231: (within /lib/i686/libc-2.2.93.so)
==2630==    by 0x8048E65: process_requests (program.c:100)
==2630==    by 0x80494DA: main (program.c:330)
==2630==    by 0x420158D4: (within /lib/i686/libc-2.2.93.so)
==2630== Address 0x40F00A08 is 0 bytes after a block of size 4164 alloc'd
==2630==    at 0x4003BA4E: malloc (in /usr/lib/valgrind/valgrind.so)
==2630==    by 0x8048E0A: process_requests (program.c:89)
==2630==    by 0x80494DA: main (program.c:330)
==2630==    by 0x420158D4: (within /lib/i686/libc-2.2.93.so)

The msgp structure looks like this:

struct msg
    long mtype;
    char a[50];
    char b[11];
    char c[PATH_MAX + 1];

The structure passed to msgrcv is allocate like this:

ptr = malloc(sizeof(struct msg));
memset(ptr, 0, sizeof(struct msg));

It is then passed to msgrcv. I'm assuming, perhaps incorrectly, that the above error and the code are the causes of my problem, but I am not seeing the problem. Could someone point out my mistake?


P.S. -- Once again I am not on the list so please CC me!  Thanks!

Attachment: PGP.sig
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]