Opened 5 years ago

Closed 5 years ago

#10043 closed bug (fixed)

runtime fails in threaded way on SPARC (bus error -> unaligned access to data)

Reported by: kgardas Owned by: kgardas
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.10.1-rc2
Keywords: Cc:
Operating System: Solaris Architecture: sparc
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Hello, it looks like runtime has changed between 7.8 and 7.10 in a way it no longer works well on SPARC. Tested on SPARC/Solaris 2.11. Both compilers compiled as their are w/o any changes so both unregisterised. On 7.8 testblockalloc runs well, on 7.10.1-rc2 it fails in threaded way with "Bus error"

karel@niagara:~/src/ghc-7.10.0.20150123/testsuite/tests/rts$ ./testblockalloc +RTS -I0
Bus Error (core dumped)

When run in debugger it points to assignment of 0 to tso->alloc_limit:

karel@niagara:~/src/ghc-7.10.0.20150123/testsuite/tests/rts$ gdb ./testblockalloc
GNU gdb 6.8
Copyright (C) 2008 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-sun-solaris2.11"...
set ar(gdb) set args +RTS -I0
(gdb) r
Starting program: /home/karel/src/ghc-7.10.0.20150123/testsuite/tests/rts/testblockalloc +RTS -I0
warning: Lowest section in /lib/librt.so.1 is .dynamic at 00000074
warning: Lowest section in /lib/libdl.so.1 is .dynamic at 00000074
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074

Program received signal SIGSEGV, Segmentation fault.
0x006b62d4 in createThread (cap=0x821ec0, size=256) at rts/Threads.c:113
113         tso->alloc_limit = 0;
(gdb) 

usually bus error is generated by unaligned access to data. I'll have a look at it, but any idea is of course highly appreciated.

Change History (6)

comment:1 Changed 5 years ago by kgardas

Owner: set to kgardas

comment:2 Changed 5 years ago by kgardas

Status: newpatch

Fixed in Phab:D640

comment:3 Changed 5 years ago by kgardas

New patch provided in Phab:D657 -- thanks to Simon Marlow for his comments in Phab:D640.

comment:4 Changed 5 years ago by Karel Gardas <karel.gardas@…>

In b2be772a97f6e7fe9f1d1c28108949f81a13158b/ghc:

fix bus errors on SPARC caused by unalignment access to alloc_limit (fixes #10043)

Reviewers: austin, simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D657

comment:5 Changed 5 years ago by kgardas

Status: patchmerge

comment:6 Changed 5 years ago by thoughtpolice

Milestone: 7.10.1
Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10 (via 44c354d5e49187c8dda697b2d293931375f01709).

Note: See TracTickets for help on using tickets.