[GHC] #15260: Xmobar crashes with segmentation fault

GHC ghc-devs at haskell.org
Fri Jun 15 12:13:56 UTC 2018


#15260: Xmobar crashes with segmentation fault
----------------------------------+--------------------------------------
        Reporter:  Voronwe        |                Owner:  (none)
            Type:  bug            |               Status:  new
        Priority:  normal         |            Milestone:  8.6.1
       Component:  Compiler       |              Version:  8.5
      Resolution:                 |             Keywords:
Operating System:  Linux          |         Architecture:  x86_64 (amd64)
 Type of failure:  Runtime crash  |            Test Case:
      Blocked By:                 |             Blocking:
 Related Tickets:                 |  Differential Rev(s):
       Wiki Page:                 |
----------------------------------+--------------------------------------

Comment (by osa1):

 I wonder if this is a FFI misuse in X11 or xmobar. A `XNextEvent` FFI call
 overrides an info table pointer:

 {{{
 Hardware watchpoint 2: ((StgClosure*)0x4200029f90)->header.info

 Old value = (const StgInfoTable *) 0x0
 New value = (const StgInfoTable *) 0xcfe1f0
 <ghczmprim_GHCziTypes_ZC_con_info>
 0x00007fdcd3143927 in XNextEvent () from /usr/lib/x86_64-linux-
 gnu/libX11.so.6
 >>> bt
 #0  0x00007fdcd3143927 in XNextEvent () from /usr/lib/x86_64-linux-
 gnu/libX11.so.6
 #1  0x000000000041385c in XUtil_zdwnextEventzq_info ()
 #2  0x0000000000000011 in ?? ()
 #3  0x0000000000000000 in ?? ()
 }}}

 (because this is reverse-execution new and old values are swapped, so old
 value is actually the new value being written by XNextEvent)

 Before overriding the info table ptr the object is the string `" "`:

 {{{
 >>> call printClosure(0x4200029f90)
 ghc-prim:GHC.Types.:(0xfa1501, 0xfa02e9)
 >>> call printClosure(0xfa1501)
 ghc-prim:GHC.Types.C#(0x32#)
 >>> call printClosure(0xfa02e9)
 ghc-prim:GHC.Types.[](0xcfdac8#)
 }}}

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


More information about the ghc-tickets mailing list