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 > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 11-25-2011, 05:17 PM
Jurij Smakov
 
Default Bug#635126: Standalone test case

Hi,

Attached is a standalone test case for this bug, obtained on an
up-to-date sid/sparc system. With it I see the following behavior:

jurij@debian:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/sparc-linux-gnu/4.6/lto-wrapper
Target: sparc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --with-long-double-128 --enable-checking=release --build=sparc-linux-gnu --host=sparc-linux-gnu --target=sparc-linux-gnu
Thread model: posix
gcc version 4.6.2 (Debian 4.6.2-5)
jurij@debian:~$
jurij@debian:~$ gcc -g -O2 -fno-tree-sra pack.c -o pack
jurij@debian:~$ ./pack
do_something called with item=-32767
do_something called with item=-123456
jurij@debian:~$
jurij@debian:~$ gcc -g -O2 pack.c -o pack
jurij@debian:~$ ./pack
do_something called with item=-32767
Bus error
jurij@debian:~$
jurij@debian:~$ gdb pack
GNU gdb (GDB) 7.3-debian
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jurij/pack...done.
(gdb) run
Starting program: /home/jurij/pack
do_something called with item=-32767

Program received signal SIGBUS, Bus error.
pack_unpack (s=0x1068a "37737635300", p=0x10692 "") at pack.c:62
62 memcpy (v.a, s, sizeof (int32_t));
(gdb) bt
#0 pack_unpack (s=0x1068a "37737635300", p=0x10692 "") at pack.c:62
#1 0xf7e64854 in __libc_start_main () from /lib/sparc-linux-gnu/libc.so.6
#2 0x00010378 in _start ()
(gdb)

I don't believe that it's related to the upstream bug Lucas mentioned,
as it was specifically triggered by using bit fields, which are not
used in any way here.

Best regards,
--
Jurij Smakov jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
 

Thread Tools




All times are GMT. The time now is 07:39 PM.

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