[Top][All Lists]

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

Re: SIGSEGV syslog(3) Part 2

From: Petr Vandrovec
Subject: Re: SIGSEGV syslog(3) Part 2
Date: Fri, 17 Jan 2003 15:10:24 +0100

On 17 Jan 03 at 9:00, Adam H.Pendleton wrote:
> 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==    Address 0x40F00A08 is 0 bytes after a block of size 4164 
> alloc'd

> 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?

And what size you pass to msgrcv? And you should run your program
with (exported) environment variable MALLOC_CHECK_ set to 2 (or at least 1),
with limit on core size set to != 0.
                                                    Petr Vandrovec

reply via email to

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