This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/10630: scsh built with -O2 gives bus error (-O0 does not)


>Number:         10630
>Category:       optimization
>Synopsis:       scsh built with -O2 gives bus error (-O0 does not)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 05 15:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     stktrc@yahoo.com
>Release:        3.2
>Organization:
>Environment:
Solaris 8 (SunOS 5.8)
>Description:
The build of scsh uses -O2 for optimization by default.  This results in the command "scsh -o srfi-27 -c 1" giving a bus error roughly 50% of the times it is invoked.  The rest of the times it works without a problem.

This is only observed on Solaris.  This could not be reproduced on Linux for example.

Here is a backtrace:

$ /tmp/scsh/lib/scsh/scshvm -o /tmp/scsh/lib/scsh/scshvm -i /tmp/scsh/lib/scsh/scsh.image -o srfi-27
zsh: bus error (core dumped)  /tmp/scsh/lib/scsh/scshvm -o /tmp/scsh/lib/scsh/scshvm -i  -o srfi-27
$ gdb /tmp/scsh/lib/scsh/scshvm core
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
Core was generated by `/tmp/scsh/lib/scsh/scshvm -o /tmp/scsh/lib/scsh/scshvm -i /tmp/scsh/lib/scsh/sc'.
Program terminated with signal 10, Bus Error.
Reading symbols from /usr/lib/libelf.so.1...done.
Loaded symbols for /usr/lib/libelf.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libgen.so.1...done.
Loaded symbols for /usr/lib/libgen.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libm.so.1...done.
Loaded symbols for /usr/lib/libm.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1
#0  0x55a1c in mrg32k3a_pack_state1 (state=6547739) at c/srfi/srfi-27.c:135
135       S48_SET_VALUE(result, state_t, s);
(gdb) bt
#0  0x55a1c in mrg32k3a_pack_state1 (state=6547739) at c/srfi/srfi-27.c:135
#1  0x43c70 in s48_external_call (sch_proc=5111115, proc_name=5111123, nargs=1, char_argv=0x138deb4 "") at c/external.c:162
#2  0x2ad44 in s48_restart (proc_361X=465955, nargs_362X=5) at c/scheme48vm.c:6996
#3  0x386e0 in s48_call_startup_procedure (startup_vector_1335X=0xffbef838, startup_vector_length_1336X=2) at c/scheme48vm.c:10897
#4  0x16864 in internal_s48_main (heap_size=5000000, stack_size=2500, _prog_name=0xffbef97c "/tmp/scsh/lib/scsh/scshvm", 
    object_file=0xffbef999 "/tmp/scsh/lib/scsh/scshvm", image_name=0xffbef9b6 "/tmp/scsh/lib/scsh/scsh.image", argc=2, argv=0xffbef838) at c/init.c:109
#5  0x1614c in main (argc=2, argv=0xffbef838) at c/main.c:72
(gdb) 
>How-To-Repeat:
download ftp://ftp.scsh.net/pub/scsh/0.6/scsh-0.6.4.tar.gz
tar xzf scsh-0.6.4.tar.gz
cd scsh-0.6.4
./configure
make
make install
scsh -o srfi-27 -c 1

bus error!
>Fix:
Work around: By exporting the environment variable CFLAGS with value "-O0" to disable optimizations during the build as described above, a build of scsh where the bus error does not occur is produced.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]