FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 02-01-2010, 07:34 AM
Gianluca Sforna
 
Default even with gcc -g -O0

On Mon, Feb 1, 2010 at 7:18 AM, Chuck Anderson <cra@wpi.edu> wrote:
>
> Program received signal SIGSEGV, Segmentation fault.
> playmonoi16 (dst=0x76ddc0, len=<value optimized out>,
> * *ch=<value optimized out>) at mixasm.c:1746

Sorry for asking the obvious, but this hit me several times... is this
mixasm.c file part of the sources you are compiling with -g -O0? if
it's in a library your code is using, you also need to recompile that
one with -O0.


--
Gianluca Sforna

http://morefedora.blogspot.com
http://www.linkedin.com/in/gianlucasforna
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-01-2010, 12:14 PM
Chuck Anderson
 
Default even with gcc -g -O0

On Mon, Feb 01, 2010 at 09:34:19AM +0100, Gianluca Sforna wrote:
> On Mon, Feb 1, 2010 at 7:18 AM, Chuck Anderson <cra@wpi.edu> wrote:
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > playmonoi16 (dst=0x76ddc0, len=<value optimized out>,
> > * *ch=<value optimized out>) at mixasm.c:1746
>
> Sorry for asking the obvious, but this hit me several times... is this
> mixasm.c file part of the sources you are compiling with -g -O0? if
> it's in a library your code is using, you also need to recompile that
> one with -O0.

Yup, it is part of the source. Many/most of the files are actually
compiled as shared objects, but everything is using -g -O0. Someone
on #gdb thinks this is a gcc bug.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-01-2010, 02:34 PM
David Malcolm
 
Default even with gcc -g -O0

On Mon, 2010-02-01 at 01:18 -0500, Chuck Anderson wrote:
> I'm trying to debug an issue for the upstream author of ocp and am
> running into an issue where gdb is showing "<value optimized out>" for
> variables even though I've compiled the program with gcc -g -O0. Are
> there any gcc/gdb gurus who can help?
>
> Compiler excerpts:
>
> gcc -g -O0 -fPIC -Wall -I.././ -I.././gnulib kickload.c -o kickload.o -c
> gcc -g -O0 -fPIC -Wall -I.././ -I.././gnulib compdate.c -o compdate.o -c
> ...
> gcc -g -O0 -fPIC -Wall -I./ -I./gnulib -o ocp boot/kickload.o -pthread -ldl goodies/helpc/ocphhc doc/opencp.dox ocp.hlp
>
> gdb output:
>
> Program received signal SIGSEGV, Segmentation fault.
> playmonoi16 (dst=0x76ddc0, len=<value optimized out>,
> ch=<value optimized out>) at mixasm.c:1746
> 1746 *(dst++)+=voltabs[0]
> (gdb) p dst
> $1 = (int32_t *) 0x76ddc0
> (gdb) p len
> $2 = <value optimized out>
> (gdb) p ch
> $3 = <value optimized out>
> (gdb) p *ch
> Cannot access memory at address 0x0
> (gdb) up
> #1 0x00007ffff5948257 in mixPlayChannel (dst=<value optimized out>,
> len=<value optimized out>, ch=0x779df0, stereo=<value optimized
> out>)
> at mixasm.c:2022
> 2022 playrout(dst, mylen, ch);
> (gdb) p stereo
> $4 = <value optimized out>
Not sure if it's the same bug, but I ran into similar issue when trying
to debug Python; see:
https://bugzilla.redhat.com/show_bug.cgi?id=556975
"Variables optimized out (python)"

Hope this is helpful
Dave


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-01-2010, 02:44 PM
Roberto Ragusa
 
Default even with gcc -g -O0

Chuck Anderson wrote:
> On Mon, Feb 01, 2010 at 09:34:19AM +0100, Gianluca Sforna wrote:
>> On Mon, Feb 1, 2010 at 7:18 AM, Chuck Anderson <cra@wpi.edu> wrote:
>>> Program received signal SIGSEGV, Segmentation fault.
>>> playmonoi16 (dst=0x76ddc0, len=<value optimized out>,
>>> ch=<value optimized out>) at mixasm.c:1746
>> Sorry for asking the obvious, but this hit me several times... is this
>> mixasm.c file part of the sources you are compiling with -g -O0? if
>> it's in a library your code is using, you also need to recompile that
>> one with -O0.
>
> Yup, it is part of the source. Many/most of the files are actually
> compiled as shared objects, but everything is using -g -O0. Someone
> on #gdb thinks this is a gcc bug.

One thing I would try is adding a

int *lenp=&len;

somewhere, just to make optimization a little more difficult for gcc.
Maybe you avoid the bug, if there is one.

--
Roberto Ragusa mail at robertoragusa.it
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-02-2010, 07:18 PM
Jan Kratochvil
 
Default even with gcc -g -O0

On Mon, 01 Feb 2010 07:18:26 +0100, Chuck Anderson wrote:
> I'm trying to debug an issue for the upstream author of ocp and am
> running into an issue where gdb is showing "<value optimized out>" for
> variables even though I've compiled the program with gcc -g -O0.
[...]
> Compiler excerpts:
>
> gcc -g -O0 -fPIC -Wall -I.././ -I.././gnulib kickload.c -o kickload.o -c
> gcc -g -O0 -fPIC -Wall -I.././ -I.././gnulib compdate.c -o compdate.o -c
> ...
> gcc -g -O0 -fPIC -Wall -I./ -I./gnulib -o ocp boot/kickload.o -pthread -ldl goodies/helpc/ocphhc doc/opencp.dox ocp.hlp

If you list also the mixasm.c compilation line you would find:
gcc -g -O0 -fpic -Wall -I.././ -O mixasm.c -o mixasm.o -c

as there is explicit -O in dev/Makefile there. After removing it getting
a valid dump with no <value optimized out>.

For the -O build found one <value optimized out> as correct and one <value
optimized out> as some bug in either gdb or gcc but that is out of the scope
of this mail thread. -O0 -g works, NOTABUG.


Thanks,
Jan

#0 playmonoi16 (dst=0x71ff90, len=384, ch=0x72bfc0) at mixasm.c:1738
#1 0x00007ffff5d57cc7 in mixPlayChannel (dst=0x71ff90, len=384, ch=0x72bfc0, stereo=0) at mixasm.c:2022
#2 0x00007ffff5d55ba8 in putchn (chn=0x72bfc0, len=384, opt=0) at mix.c:129
#3 0x00007ffff5d55f14 in mixMixChanSamples (ch=0x7fffffffcc00, n=1, s=0x7ffff5d3fcc0, len=384, rate=22050, opt=0) at mix.c:180
#4 0x00007ffff405f312 in getchansample (this=0x7ffff4268a80, ch=9, buf=0x7ffff5d3fcc0, len=384, rate=22050, opt=0) at itplay.c:1817
#5 0x00007ffff4061fcd in itpGetLChanSample (ch=9, buf=0x7ffff5d3fcc0, len=384, rate=22050, opt=0) at itpplay.c:534
#6 0x00007ffff599375a in plDrawScopes () at cpiscope.c:365
#7 0x00007ffff5993fd0 in scoDraw () at cpiscope.c:464
#8 0x00007ffff598add2 in plmpDrawScreen () at cpiface.c:772
#9 0x00007ffff598ae30 in plmpCallBack () at cpiface.c:789
#10 0x00007ffff697be9e in _fsMain (argc=2, argv=0x7fffffffd088) at pfsmain.c:266
#11 0x00007ffff7dcc332 in init_modules (argc=2, argv=0x7fffffffd088) at pmain.c:207
#12 0x00007ffff7dcc472 in _bootup (argc=2, argv=0x7fffffffd088) at pmain.c:237
#13 0x00000000004022e0 in runocp (handle=0x6040d0, argc=2, argv=0x7fffffffd088) at kickload.c:518
#14 0x000000000040243a in main (argc=2, argv=0x7fffffffd088) at kickload.c:568
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-02-2010, 07:35 PM
Chuck Anderson
 
Default even with gcc -g -O0

On Tue, Feb 02, 2010 at 09:18:07PM +0100, Jan Kratochvil wrote:
> On Mon, 01 Feb 2010 07:18:26 +0100, Chuck Anderson wrote:
> > I'm trying to debug an issue for the upstream author of ocp and am
> > running into an issue where gdb is showing "<value optimized out>" for
> > variables even though I've compiled the program with gcc -g -O0.
> [...]
> > Compiler excerpts:
> >
> > gcc -g -O0 -fPIC -Wall -I.././ -I.././gnulib kickload.c -o kickload.o -c
> > gcc -g -O0 -fPIC -Wall -I.././ -I.././gnulib compdate.c -o compdate.o -c
> > ...
> > gcc -g -O0 -fPIC -Wall -I./ -I./gnulib -o ocp boot/kickload.o -pthread -ldl goodies/helpc/ocphhc doc/opencp.dox ocp.hlp
>
> If you list also the mixasm.c compilation line you would find:
> gcc -g -O0 -fpic -Wall -I.././ -O mixasm.c -o mixasm.o -c
>
> as there is explicit -O in dev/Makefile there. After removing it getting
> a valid dump with no <value optimized out>.
>
> For the -O build found one <value optimized out> as correct and one <value
> optimized out> as some bug in either gdb or gcc but that is out of the scope
> of this mail thread. -O0 -g works, NOTABUG.

Thanks a bunch for this!
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 06:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org