[GHC] #11300: outofmem RTS testcase fails on ARM

#11300: outofmem RTS testcase fails on ARM --------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Linux Architecture: arm | Type of failure: Runtime crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: --------------------------------+---------------------------------- The `outofmem` RTS testcase fails on ARM, {{{ =====> outofmem(normal) 1 of 1 [0, 0, 0] cd . && $MAKE -s --no-print-directory outofmem outofmem.run.stdout 2> outofmem.run.stderr Actual stdout output differs from expected: --- ./outofmem.stdout.normalised 2015-12-27 17:21:08.718240403 +0100 +++ ./outofmem.run.stdout.normalised 2015-12-27 17:21:08.718240403 +0100 @@ -1 +1 @@ -exit(251) \ No newline at end of file +exit(1) \ No newline at end of file *** unexpected failure for outofmem(normal) }}} In particular, {{{ $ make outofmem make[1]: Entering directory '/mnt/ext/exp/ghc/testsuite/tests/rts' '/mnt/ext/exp/ghc/inplace/test spaces/ghc-stage2' -fforce-recomp -dcore- lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-warn- tabs -fno-warn-missed-specialisations -v0 --make -fforce-recomp outofmem.hs -o outofmem make[1]: Leaving directory '/mnt/ext/exp/ghc/testsuite/tests/rts' outofmem: out of memory (requested 1074790400 bytes) exit(1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Comment (by bgamari): The problem appears to be that the RTS is failing to allocate, {{{ $ gdb ./outofmem ... Reading symbols from ./outofmem...done. (gdb) break stg_exit Breakpoint 1 at 0x32a378: file rts/RtsStartup.c, line 533. (gdb) run Starting program: /mnt/ext/exp/ghc/testsuite/tests/rts/outofmem [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux- gnueabihf/libthread_db.so.1". outofmem: out of memory (requested 1074790400 bytes) Breakpoint 1, stg_exit (n=1) at rts/RtsStartup.c:533 533 if (exitFn) (gdb) bt #0 stg_exit (n=1) at rts/RtsStartup.c:533 #1 0x0034d5a8 in my_mmap_or_barf (addr=0x76900000, size=1074790400, operation=3) at rts/posix/OSMem.c:225 #2 0x0034d710 in osGetMBlocks (n=1025) at rts/posix/OSMem.c:285 #3 0x00370e68 in getCommittedMBlocks (n=1025) at rts/sm/MBlock.c:534 #4 0x00370f68 in getMBlocks (n=1025) at rts/sm/MBlock.c:580 #5 0x0033facc in alloc_mega_group (mblocks=1025) at rts/sm/BlockAlloc.c:327 #6 0x0033fbdc in allocGroup (n=262145) at rts/sm/BlockAlloc.c:354 #7 0x0034a0c8 in allocate (cap=0x3f02c0 <MainCapability>, n=268435459) at rts/sm/Storage.c:818 #8 0x00353070 in stg_newByteArrayzh$def () Backtrace stopped: previous frame identical to this frame (corrupt stack?) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Changes (by thomie): * cc: Phyx (added) Comment: Fails on Windows as well. See this addition of `testsuite/tests/rts/outofmem.stdout-i386-unknown- mingw32` in https://phabricator.haskell.org/D1340?vs=on&id=4578#788ffc72. And this discussion on irc: {{{ "15-10-21T18:56:56"< thomie > Phyx-: the only comment I have now is, are you sure about updated output for outofmem? Last time I checked, I didn't quite understand what that test was supposed to do. "15-10-21T18:57:38"< Phyx- > thomie: I am, but I was actually going to undo it and see if I can't het it to output the expected error code. "15-10-21T18:58:13"< Phyx- > thomie: the problem is that when the exception is thrown, it's hitting the VEH handlers, which call stg_exit(1); "15-10-21T18:58:32"< Phyx- > so it never enters main again. "15-10-21T18:58:54"< thomie > ok, I'll look at it later. "15-10-21T18:59:37"< Phyx- > it's a bit unrelated to the patch I changed it in, so i was going to make anothe diff for it. and see what the exception i get is and see how to handle it in the VEH stuff. "15-10-21T19:00:02"< Phyx- > I don't know how the errors are handled under linux, but I find it odd that it can return to main.. "15-10-21T19:08:52"< Phyx- > thomie: Basically, the test is checking to see if this line is hit https://github.com/ghc/ghc/blob/master/rts/RtsMain.c#L80 but on Windows it just won't get there as it exits here https://github.com/ghc/ghc/blob/master/rts/win32/veh_excn.c#L65 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Changes (by bgamari): * cc: simonmar (added) Comment: Simonmar, perhaps you could shed some light on how this is supposed to work? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Changes (by Phyx-): * cc: Phyx (removed) * cc: Phyx- (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Changes (by bgamari): * cc: Phyx- (removed) * cc: Phyx (added) Comment: I have also noticed failures of this sort on Windows. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Changes (by bgamari): * cc: Phyx (removed) * cc: Phyx- (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Comment (by simonmar): On Linux this test triggers the `stg_exit(EXIT_HEAPOVERFLOW)` here: https://phabricator.haskell.org/diffusion/GHC/browse/master/rts/sm/MBlock.c;... It repeatedly allocates 2GB arrays and eventually runs out of the 1TB address space. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Comment (by Phyx-): Oh I see. The `EXIT_HEAPOVERFLOW` is returned directly from there. Then this should be trivial to fix for Windows. Just have to pass the correct exit codes to `stg_exit` here https://github.com/ghc/ghc/blob/master/rts/win32/veh_excn.c#L65 I'll take care of that tonight. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1753 Wiki Page: | ----------------------------------+---------------------------------- Changes (by Phyx-): * differential: => Phab:D1753 Comment: Fix the output on Windows. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11300: outofmem RTS testcase fails on ARM ----------------------------------+------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #11422 | Differential Rev(s): Wiki Page: | ----------------------------------+------------------------------- Changes (by Phyx-): * differential: Phab:D1753 => * related: => #11422 Comment: Created a new issue for the Windows failure. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

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

#11300: outofmem RTS testcase fails on ARM
----------------------------------+----------------------------------
Reporter: bgamari | Owner: bgamari
Type: bug | Status: patch
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version: 7.10.3
Resolution: | Keywords:
Operating System: Linux | Architecture: arm
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: #11422 | Differential Rev(s): Phab:D1787
Wiki Page: |
----------------------------------+----------------------------------
Comment (by Ben Gamari

#11300: outofmem RTS testcase fails on ARM ----------------------------------+---------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #11422 | Differential Rev(s): Phab:D1787 Wiki Page: | ----------------------------------+---------------------------------- Comment (by bgamari): Merged to `ghc-8.0` as 30caafe829ce93a2e303b506cea21395b0a725eb. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11300#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

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