From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7070 invoked by alias); 5 May 2003 15:46:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7050 invoked by uid 71); 5 May 2003 15:46:00 -0000 Resent-Date: 5 May 2003 15:46:00 -0000 Resent-Message-ID: <20030505154600.7049.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, stktrc@yahoo.com Received: (qmail 6396 invoked by uid 48); 5 May 2003 15:45:15 -0000 Message-Id: <20030505154515.6395.qmail@sources.redhat.com> Date: Mon, 05 May 2003 15:46:00 -0000 From: stktrc@yahoo.com Reply-To: stktrc@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/10630: scsh built with -O2 gives bus error (-O0 does not) X-SW-Source: 2003-05/txt/msg00304.txt.bz2 List-Id: >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: