[GHC] #8242: Infinite loop with addCFinalizerToWeak

GHC ghc-devs at haskell.org
Sat Sep 14 08:38:49 CEST 2013


#8242: Infinite loop with addCFinalizerToWeak
------------------------------------------------+--------------------------
        Reporter:  akio                         |            Owner:
            Type:  bug                          |           Status:  new
        Priority:  normal                       |        Milestone:
       Component:  Runtime System               |          Version:  7.6.3
      Resolution:                               |         Keywords:
Operating System:  Linux                        |     Architecture:  x86_64
 Type of failure:  Incorrect result at runtime  |  (amd64)
       Test Case:                               |       Difficulty:
        Blocking:                               |  Unknown
                                                |       Blocked By:
                                                |  Related Tickets:
------------------------------------------------+--------------------------
Changes (by ezyang):

 * status:  closed => new
 * resolution:  fixed =>


Comment:

 Hate to be a wet sock but this test is failing in Windows.

 {{{
 bash.exe-3.1$ gdb 'c:/Users/ezyang/Dev/ghc-dyn/inplace/bin/ghc-stage2.exe'
 -ex "run -fforce-re
 comp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts
 -fno-ghci-history T
 8242.hs --interactive -v0 -ignore-dot-ghci +RTS -I0.1 -DS -RTS"
 GNU gdb (GDB) 7.5
 Copyright (C) 2012 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 "i686-pc-mingw32".
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>...
 Reading symbols from c:\Users\ezyang\Dev\ghc-dyn\inplace\bin\ghc-
 stage2.exe...done.
 Starting program: c:\Users\ezyang\Dev\ghc-dyn\inplace\bin\ghc-stage2.exe
 -fforce-recomp -dcore-
 lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-
 history T8242.hs --int
 eractive -v0 -ignore-dot-ghci +RTS -I0.1 -DS -RTS
 [New Thread 20508.0x52b0]
         52b0: cap 0: initialised
 [New Thread 20508.0x52b4]
 [New Thread 20508.0x5078]
 [New Thread 20508.0x510c]
 [New Thread 20508.0x52f4]
 *Main> :set prog T8242
 *Main> :set args
 *Main> GHC.TopHandler.runIOFastExit Main.main Prelude.>> Prelude.return ()
         510c: cap 1: initialised
 [New Thread 20508.0x201c]

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 20508.0x510c]
 0x01d9d521 in LOOKS_LIKE_INFO_PTR_NOT_NULL (p=2863311360)
     at includes/rts/storage/ClosureMacros.h:248
 248         return info->type != INVALID_OBJECT && info->type <
 N_CLOSURE_TYPES;
 (gdb) bt
 #0  0x01d9d521 in LOOKS_LIKE_INFO_PTR_NOT_NULL (p=2863311360)
     at includes/rts/storage/ClosureMacros.h:248
 #1  0x01d9d564 in LOOKS_LIKE_INFO_PTR (p=2863311360)
     at includes/rts/storage/ClosureMacros.h:253
 #2  0x01d9d591 in LOOKS_LIKE_CLOSURE_PTR (p=0x42ddc70)
     at includes/rts/storage/ClosureMacros.h:258
 #3  0x01d9d65b in checkClosureShallow (p=0x42ddc70) at rts\sm\Sanity.c:87
 #4  0x01d9d618 in checkLargeBitmap (payload=0x42d1e3c,
 large_bitmap=0x4176e24, size=1)
     at rts\sm\Sanity.c:69
 #5  0x01d9d7c9 in checkStackFrame (c=0x42d1e34) at rts\sm\Sanity.c:129
 #6  0x01d9d925 in checkStackChunk (sp=0x42d1e34, stack_end=0x42d1eb0) at
 rts\sm\Sanity.c:177
 #7  0x01d9e394 in checkSTACK (stack=0x42d1af4) at rts\sm\Sanity.c:497
 #8  0x01d9e4f3 in checkTSO (tso=0x42d1eb0) at rts\sm\Sanity.c:535
 #9  0x01d861fb in scheduleHandleYield (cap=0x2a838e8, t=0x42d1eb0,
 prev_what_next=1)
     at rts\Schedule.c:1209
 #10 0x01d85565 in schedule (initialCapability=0x2a838e8, task=0x24465b0)
     at rts\Schedule.c:533
 #11 0x01d87483 in scheduleWorker (cap=0x2a838e8, task=0x24465b0) at
 rts\Schedule.c:2363
 #12 0x01dab1c2 in workerStart (task=0x24465b0) at rts\Task.c:385
 #13 0x74f8850d in UnregisterBadMemoryNotification () from
 C:\Windows\SysWOW64\kernel32.dll
 #14 0x024465b0 in ?? ()
 #15 0x76ffbf39 in ?? ()
 #16 0x76ffbf0c in ?? ()
 #17 0x00000000 in ?? ()
 (gdb) f 2
 #2  0x01d9d591 in LOOKS_LIKE_CLOSURE_PTR (p=0x42ddc70)
     at includes/rts/storage/ClosureMacros.h:258
 258         return LOOKS_LIKE_INFO_PTR((StgWord)(UNTAG_CLOSURE((StgClosure
 *)(p)))->header.info
 );
 (gdb) p/x *(void**)p
 $1 = 0xaaaaaa00
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8242#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list