public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: stktrc@yahoo.com
To: gcc-gnats@gcc.gnu.org
Subject: optimization/10630: scsh built with -O2 gives bus error (-O0 does not)
Date: Mon, 05 May 2003 15:46:00 -0000	[thread overview]
Message-ID: <20030505154515.6395.qmail@sources.redhat.com> (raw)


>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:


             reply	other threads:[~2003-05-05 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-05 15:46 stktrc [this message]
2003-05-05 16:41 bangerth
2003-05-06 14:23 bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030505154515.6395.qmail@sources.redhat.com \
    --to=stktrc@yahoo.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).