[GHC] #11299: T5435_gcc_v fails on ARM

#11299: T5435_gcc_v fails on ARM -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Runtime | Version: 7.10.3 System | Keywords: | Operating System: Unknown/Multiple Architecture: arm | Type of failure: Runtime crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The `rts/T5435_gcc_v` testcase fails on ARM. As far as I can tell there are two principle failure modes: hanging and segmentation faulting. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------- Comment (by bgamari): A segmentation fault look like this, {{{ $ gdb --args ./T5435_v_gcc v ./T5435_load_v_gcc.o ... (gdb) run Starting program: /mnt/ext/exp/ghc/testsuite/tests/rts/T5435_v_gcc v ./T5435_load_v_gcc.o [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux- gnueabihf/libthread_db.so.1". initializer run Program received signal SIGSEGV, Segmentation fault. __GI__IO_fflush (fp=0xe3403000) at iofflush.c:40 40 iofflush.c: No such file or directory. (gdb) bt #0 __GI__IO_fflush (fp=0xe3403000) at iofflush.c:40 #1 0xb6ff6150 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------- Description changed by bgamari: Old description:
The `rts/T5435_gcc_v` testcase fails on ARM. As far as I can tell there are two principle failure modes: hanging and segmentation faulting.
New description: The `rts/T5435_gcc_v` testcase sometimes fails on ARM. As far as I can tell there are two principle failure modes: hanging and segmentation faulting. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------- Comment (by bgamari): Here's another outcome with a useful backtrace due to compiling with `-debug`, {{{ (gdb) run Starting program: /mnt/ext/exp/ghc/testsuite/tests/rts/T5435_v_gcc v ./T5435_load_v_gcc.o [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux- gnueabihf/libthread_db.so.1". post-initLinker post-if Program received signal SIGILL, Illegal instruction. 0xb6ff7000 in ?? () (gdb) bt #0 0xb6ff7000 in ?? () #1 0x002be160 in ocRunInit_ELF (oc=0x0) at rts/Linker.c:5685 #2 0x002be160 in ocRunInit_ELF (oc=0x38e9d8) at rts/Linker.c:5685 #3 0x002b9ea4 in resolveObjs_ () at rts/Linker.c:2447 #4 0x002b9f30 in resolveObjs () at rts/Linker.c:2475 #5 0x0000ad3c in r3ze_info$def () Backtrace stopped: previous frame identical to this frame (corrupt stack?) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------- Comment (by bgamari): I believe the issue here may be incomplete instruction cache flushing. With this patch, {{{#!patch diff --git a/rts/Linker.c b/rts/Linker.c index aadd8d4..1101dea 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2748,8 +2748,10 @@ static void ocFlushInstructionCache( ObjectCode *oc ) { // Object code + printf("Flushed %p - %p\n", oc->image, oc->image + oc->fileSize); __clear_cache(oc->image, oc->image + oc->fileSize); // Jump islands + printf("Flushed %p - %p\n", oc->symbol_extras, &oc->symbol_extras[oc->n_symbol_extras]); __clear_cache(oc->symbol_extras, &oc->symbol_extras[oc->n_symbol_extras]); } @@ -5706,6 +5708,7 @@ static int ocRunInit_ELF( ObjectCode *oc ) init_start = (init_t*)init_startC; init_end = (init_t*)(init_startC + shdr[i].sh_size); for (init = init_start; init < init_end; init++) { + printf("init %p\n", init); (*init)(argc, argv, envv); } } }}} I see the following output on failure, {{{ Flushed 0xb6ff7000 - 0xb6ff753c Flushed 0xb6ff6008 - 0xb6ff6138 init 0xb6ff6190 Program received signal SIGILL, Illegal instruction. 0xb6ff7000 in ?? () }}} Indeed it looks like the location with the initializer (0xb6ff6190) was never flushed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1708 Wiki Page: | -------------------------------------+---------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D1708 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1708 Wiki Page: | -------------------------------------+---------------------------------- Comment (by bgamari): The test survives 500 runs without failure with Phab:D1708. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM -------------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1708 Wiki Page: | -------------------------------------+---------------------------------- Comment (by bgamari): It also seems that this fixed the `linker_unload` test! Yay! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11299: T5435_gcc_v fails on ARM
-------------------------------------+----------------------------------
Reporter: bgamari | Owner: bgamari
Type: bug | Status: patch
Priority: normal | Milestone: 8.0.1
Component: Runtime System | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: arm
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1708
Wiki Page: |
-------------------------------------+----------------------------------
Comment (by Ben Gamari

#11299: T5435_gcc_v fails on ARM -------------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Runtime System | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1708 Wiki Page: | -------------------------------------+---------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11299#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC