
#7629: segmentation fault in compiled program, involves gtk, selinux -----------------------------------------------------------------+---------- Reporter: wgmitchener | Owner: simonmar Type: bug | Status: infoneeded Priority: high | Milestone: 7.6.2 Component: Runtime System | Version: 7.4.2 Keywords: segmentation fault, multithreading, selinux, gtk | Os: Linux Architecture: x86 | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------------+---------- Comment(by wgmitchener): Got it: ghc-7.4.2/rts/Adjustor.c:380 createAdjustor calls allocateExec (rts/sm/Storage.c) which calls ffi_closure_alloc. So in createAdjustor, line 381, we should have (if I'm reading the libffi documentation correctly) adjustorStub is a pointer in data address space to the adjustor stub code is a pointer in code address space to the very same spot in memory and sure enough they are off by 0x1000: {{{ (gdb) print adjustorStub $3 = (AdjustorStub *) 0xb7ffc00c (gdb) print code $4 = (void *) 0xb7ffd00c }}} which means the correct calculation of the relative call should be {{{ *(long*)&adjustorStub->call[1] = ((char*)&adjustorCode) - ((char*)code + 5); // code instead of adjustorStub }}} Apparently code and data and done with different segment settings under SELinux. Chaos follows. Going to rebuild GHC 7.4.2 with that change and see if this works... -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7629#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler