qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] index out of bounds in qemu-0.10.2
@ 2009-04-16 22:49 Sergei Steshenko
  2009-04-18 18:25 ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Steshenko @ 2009-04-16 22:49 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

Hello,

I am compiling qemu-0.10.2 using the attached autogenerated 'configure'
wrapper (if anybody is interested in 'configure' command line options I'm
using_.

I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.

While running 'make' I've noticed this:

     41 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
     42 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
     43 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
     44 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
     45 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
     46 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
     47 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
     48 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
.

Once I had the same warnings compiling my own code, and 'gcc' was correct,
so most likely it's correct in this case too.

If so, please fix this.

Thanks,
  Sergei.


      

[-- Attachment #2: config_wrapper.sh --]
[-- Type: application/x-shellscript, Size: 5114 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] index out of bounds in qemu-0.10.2
  2009-04-16 22:49 [Qemu-devel] index out of bounds in qemu-0.10.2 Sergei Steshenko
@ 2009-04-18 18:25 ` Blue Swirl
  2009-04-19  0:23   ` andrzej zaborowski
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2009-04-18 18:25 UTC (permalink / raw)
  To: qemu-devel, Andrzej Zaborowski

On 4/17/09, Sergei Steshenko <sergstesh@yahoo.com> wrote:
> Hello,
>
>  I am compiling qemu-0.10.2 using the attached autogenerated 'configure'
>  wrapper (if anybody is interested in 'configure' command line options I'm
>  using_.
>
>  I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.
>
>  While running 'make' I've noticed this:
>
>      41 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
>      42 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>      43 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>      44 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>      45 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
>      46 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>      47 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>      48 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>  .
>
>  Once I had the same warnings compiling my own code, and 'gcc' was correct,
>  so most likely it's correct in this case too.
>
>  If so, please fix this.

My gcc and even sparse is completely silent, strange.

It's because of this area:

    uint8_t dcdc[3];

is saved like this:

    qemu_put_8s(f, &s->dcdc[3]);
    qemu_put_8s(f, &s->dcdc[3]);
    qemu_put_8s(f, &s->dcdc[3]);

and loaded like this:

    qemu_get_8s(f, &s->dcdc[3]);
    qemu_get_8s(f, &s->dcdc[3]);
    qemu_get_8s(f, &s->dcdc[3]);

which is of course wrong.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] index out of bounds in qemu-0.10.2
@ 2009-04-18 19:37 Sergei Steshenko
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Steshenko @ 2009-04-18 19:37 UTC (permalink / raw)
  To: qemu-devel, Andrzej Zaborowski




--- On Sat, 4/18/09, Blue Swirl <blauwirbel@gmail.com> wrote:

> From: Blue Swirl <blauwirbel@gmail.com>
> Subject: Re: [Qemu-devel] index out of bounds in qemu-0.10.2
> To: qemu-devel@nongnu.org, "Andrzej Zaborowski" <balrogg@gmail.com>
> Date: Saturday, April 18, 2009, 11:25 AM
> On 4/17/09, Sergei Steshenko <sergstesh@yahoo.com>
> wrote:
> > Hello,
> >
> >  I am compiling qemu-0.10.2 using the attached
> autogenerated 'configure'
> >  wrapper (if anybody is interested in 'configure'
> command line options I'm
> >  using_.
> >
> >  I am using self-built gcc-4.3.3, my OS is SUSE
> 10.3, 32 bits.
> >
> >  While running 'make' I've noticed this:
> >
> >      41
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c:
> In function ‘menelaus_load’:
> >      42
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114:
> warning: array subscript is above array bounds
> >      43
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114:
> warning: array subscript is above array bounds
> >      44
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114:
> warning: array subscript is above array bounds
> >      45
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c:
> In function ‘menelaus_save’:
> >      46
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94:
> warning: array subscript is above array bounds
> >      47
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94:
> warning: array subscript is above array bounds
> >      48
> /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94:
> warning: array subscript is above array bounds
> >  .
> >
> >  Once I had the same warnings compiling my own
> code, and 'gcc' was correct,
> >  so most likely it's correct in this case too.
> >
> >  If so, please fix this.
> 
> My gcc and even sparse is completely silent, strange.
> 
> It's because of this area:
> 
>     uint8_t dcdc[3];
> 
> is saved like this:
> 
>     qemu_put_8s(f, &s->dcdc[3]);
>     qemu_put_8s(f, &s->dcdc[3]);
>     qemu_put_8s(f, &s->dcdc[3]);
> 
> and loaded like this:
> 
>     qemu_get_8s(f, &s->dcdc[3]);
>     qemu_get_8s(f, &s->dcdc[3]);
>     qemu_get_8s(f, &s->dcdc[3]);
> 
> which is of course wrong.
> 
> 
> 

What is your 'gcc' version ?

I think 'gcc' strictness began from gcc-4.2.0, and the developers have been
adding strictness features since.

Thanks,
  Sergei.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] index out of bounds in qemu-0.10.2
  2009-04-18 18:25 ` Blue Swirl
@ 2009-04-19  0:23   ` andrzej zaborowski
  0 siblings, 0 replies; 4+ messages in thread
From: andrzej zaborowski @ 2009-04-19  0:23 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

2009/4/18 Blue Swirl <blauwirbel@gmail.com>:
> On 4/17/09, Sergei Steshenko <sergstesh@yahoo.com> wrote:
>> Hello,
>>
>>  I am compiling qemu-0.10.2 using the attached autogenerated 'configure'
>>  wrapper (if anybody is interested in 'configure' command line options I'm
>>  using_.
>>
>>  I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.
>>
>>  While running 'make' I've noticed this:
>>
>>      41 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
>>      42 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>>      43 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>>      44 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>>      45 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
>>      46 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>>      47 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>>      48 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>>  .
>>
>>  Once I had the same warnings compiling my own code, and 'gcc' was correct,
>>  so most likely it's correct in this case too.
>>
>>  If so, please fix this.
>
> My gcc and even sparse is completely silent, strange.
>
> It's because of this area:
>
>    uint8_t dcdc[3];
>
> is saved like this:
>
>    qemu_put_8s(f, &s->dcdc[3]);
>    qemu_put_8s(f, &s->dcdc[3]);
>    qemu_put_8s(f, &s->dcdc[3]);
>
> and loaded like this:
>
>    qemu_get_8s(f, &s->dcdc[3]);
>    qemu_get_8s(f, &s->dcdc[3]);
>    qemu_get_8s(f, &s->dcdc[3]);

Oops, good catch, I'll correct the indexes.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-19  0:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 22:49 [Qemu-devel] index out of bounds in qemu-0.10.2 Sergei Steshenko
2009-04-18 18:25 ` Blue Swirl
2009-04-19  0:23   ` andrzej zaborowski
  -- strict thread matches above, loose matches on Subject: below --
2009-04-18 19:37 Sergei Steshenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).