|
From: Sven U. <ub...@em...> - 2004-04-29 11:38:05
|
Hello, one of my ioctl() calls fails with errno=3DEFAULT (Bad address). valgrind reports the following messages about this call. What does=20 it mean that some address is "0 bytes after a block of size 268 alloc'd"? If it was some non-zero bytes after an allocated block,=20 I understand that it would be reading/writing a wrong place in memory. But when it is 0 bytes, it seems like all right? =3D=3D1234=3D=3D Syscall param ioctl(generic) contains unaddressable byte= (s) =3D=3D1234=3D=3D at 0x402FD074: ioctl (in /lib/libc-2.2.5.so) =3D=3D1234=3D=3D by 0x4091B189: c6stats_client_read_result (combo6lib/= combo6stats.c:76) =3D=3D1234=3D=3D by 0x40229CD1: mapi_read_results (mapi.c:411) =3D=3D1234=3D=3D by 0x80486D4: main (testcombo6.c:31) =3D=3D1234=3D=3D Address 0x415A68F0 is 0 bytes after a block of size 268= alloc'd =3D=3D1234=3D=3D at 0x40027CEA: malloc (vg_replace_malloc.c:160) =3D=3D1234=3D=3D by 0x4091B0C6: c6stats_client_init (combo6lib/combo6s= tats.c:59) =3D=3D1234=3D=3D by 0x40229BB6: get_results_info (mapi.c:380) =3D=3D1234=3D=3D by 0x40229C74: mapi_read_results (mapi.c:405) Sven _________________________________________________________________________= _______ Zna=E8kov=FD notebook za 25.990 K=E8 v=E8. DPH? Ale jist=EC! DEXX N25i s = Intel Celeron 2,4 GHz, 256 MB RAM a 64 MB grafickou kartou u=BE za tuto = neuv=EC=F8itelnou cenu. http://www.email.cz/dexx |
|
From: Jorrit T. <Jor...@uz...> - 2004-04-29 11:55:08
|
Sven Ubik wrote: >Hello, > >one of my ioctl() calls fails with errno=EFAULT (Bad address). >valgrind reports the following messages about this call. What does >it mean that some address is "0 bytes after a block of size 268 >alloc'd"? If it was some non-zero bytes after an allocated block, >I understand that it would be reading/writing a wrong place in memory. >But when it is 0 bytes, it seems like all right? > > 0 bytes AFTER the block is still wrong. i.e. if you have a block of 10 bytes and you write at the 0'th byte after that block then you are still writing after the 10'th byte. Greetings, |
|
From: David E. <tw...@us...> - 2004-04-29 12:09:14
|
On Thu, 2004-04-29 at 13:37, Sven Ubik wrote:
> Hello,
>
> one of my ioctl() calls fails with errno=EFAULT (Bad address).
> valgrind reports the following messages about this call. What does
> it mean that some address is "0 bytes after a block of size 268
> alloc'd"? If it was some non-zero bytes after an allocated block,
> I understand that it would be reading/writing a wrong place in memory.
> But when it is 0 bytes, it seems like all right?
>
> ==1234== Syscall param ioctl(generic) contains unaddressable byte(s)
> ==1234== at 0x402FD074: ioctl (in /lib/libc-2.2.5.so)
> ==1234== by 0x4091B189: c6stats_client_read_result (combo6lib/combo6stats.c:76)
> ==1234== by 0x40229CD1: mapi_read_results (mapi.c:411)
> ==1234== by 0x80486D4: main (testcombo6.c:31)
>
> ==1234== Address 0x415A68F0 is 0 bytes after a block of size 268 alloc'd
> ==1234== at 0x40027CEA: malloc (vg_replace_malloc.c:160)
> ==1234== by 0x4091B0C6: c6stats_client_init (combo6lib/combo6stats.c:59)
> ==1234== by 0x40229BB6: get_results_info (mapi.c:380)
> ==1234== by 0x40229C74: mapi_read_results (mapi.c:405)
If you have a buffer like this:
char stuff[268];
then I think that "0 bytes after a block of size 268" means that you try
to access a byte at stuff[268], but the last valid byte in the buffer is
of course stuff[267].
--
Regards,
-\- David Eriksson -/-
SynCE - http://synce.sourceforge.net
CalcEm - http://calcem.sourceforge.net
ScummVM - http://scummvm.sourceforge.net
Desquirr - http://desquirr.sourceforge.net
SetiWrapper - http://setiwrapper.sourceforge.net
|
|
From: Nicholas N. <nj...@ca...> - 2004-04-29 12:40:30
|
On Thu, 29 Apr 2004, David Eriksson wrote: > If you have a buffer like this: > > char stuff[268]; > > then I think that "0 bytes after a block of size 268" means that you try > to access a byte at stuff[268], but the last valid byte in the buffer is > of course stuff[267]. This has tripped other people up before. Perhaps saying "1 byte after a block of size 268" would be less confusing? N |
|
From: Josef W. <Jos...@gm...> - 2004-04-29 13:19:39
|
On Thursday 29 April 2004 14:40, Nicholas Nethercote wrote: > This has tripped other people up before. Perhaps saying "1 byte after a > block of size 268" would be less confusing? Why not: "Adress xxx is outside a block of size 268, at byte offset 268" ? Or is this confusing as well? Josef > > N > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |
|
From: Jorrit T. <Jor...@uz...> - 2004-04-29 13:24:31
|
Josef Weidendorfer wrote: >On Thursday 29 April 2004 14:40, Nicholas Nethercote wrote: > > >>This has tripped other people up before. Perhaps saying "1 byte after a >>block of size 268" would be less confusing? >> >> > >Why not: "Adress xxx is outside a block of size 268, at byte offset 268" ? >Or is this confusing as well? > > > I think that is clearer at least. Greetings, |
|
From: Banibrata D. <du...@in...> - 2004-04-29 13:28:02
|
yes. this is much better. > -----Original Message----- > From: val...@li... > [mailto:val...@li...] On Behalf > Of Nicholas Nethercote > Sent: Thursday, April 29, 2004 6:10 PM > To: David Eriksson > Cc: ub...@em...; val...@li... > Subject: Re: [Valgrind-users] 0 bytes after a block alloc'd ??? > > > On Thu, 29 Apr 2004, David Eriksson wrote: > > > If you have a buffer like this: > > > > char stuff[268]; > > > > then I think that "0 bytes after a block of size 268" means > that you > > try to access a byte at stuff[268], but the last valid byte in the > > buffer is of course stuff[267]. > > This has tripped other people up before. Perhaps saying "1 > byte after a block of size 268" would be less confusing? > > N > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... > Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam > FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Valgrind-users mailing list Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |