GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:37:49Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/10043runtime fails in threaded way on SPARC (bus error -> unaligned access to data)2019-07-07T18:37:49Zkgardasruntime fails in threaded way on SPARC (bus error -> unaligned access to data)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 run...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.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.10.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"runtime fails in threaded way on SPARC (bus error -> unaligned access to data)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.1-rc2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hello,\r\nit 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\"\r\n{{{\r\nkarel@niagara:~/src/ghc-7.10.0.20150123/testsuite/tests/rts$ ./testblockalloc +RTS -I0\r\nBus Error (core dumped)\r\n}}}\r\n\r\nWhen run in debugger it points to assignment of 0 to tso->alloc_limit:\r\n{{{\r\nkarel@niagara:~/src/ghc-7.10.0.20150123/testsuite/tests/rts$ gdb ./testblockalloc\r\nGNU gdb 6.8\r\nCopyright (C) 2008 Free Software Foundation, Inc.\r\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\r\nand \"show warranty\" for details.\r\nThis GDB was configured as \"sparc-sun-solaris2.11\"...\r\nset ar(gdb) set args +RTS -I0\r\n(gdb) r\r\nStarting program: /home/karel/src/ghc-7.10.0.20150123/testsuite/tests/rts/testblockalloc +RTS -I0\r\nwarning: Lowest section in /lib/librt.so.1 is .dynamic at 00000074\r\nwarning: Lowest section in /lib/libdl.so.1 is .dynamic at 00000074\r\nwarning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074\r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x006b62d4 in createThread (cap=0x821ec0, size=256) at rts/Threads.c:113\r\n113 tso->alloc_limit = 0;\r\n(gdb) \r\n}}}\r\n\r\nusually bus error is generated by unaligned access to data. I'll have a look at it, but any idea is of course highly appreciated.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1kgardaskgardas