<div dir="ltr"><div><div><div><div><div><font><font face="verdana,sans-serif"><font><font><font><font>I wrote a multithreaded GUI program for a research project using gtk2hs, and it works fine on fedora 17, which uses ghc 7.0.4.  It crashes almost as soon as it starts when compiled and run on fedora 18 (ghc 7.4.1).  There&#39;s a message on the console that it was killed because of a segmentation fault and that&#39;s about all it tells me.  I tracked down the code that causes crash, and it seems to happen because I add an action to the gtk loop:<br>


<br></font></font></font></font></font></font></div><font><font face="verdana,sans-serif"><font><font><font><font>timeoutAddFull action ...<br><br></font></font></font></font></font></font></div><font><font face="verdana,sans-serif"><font><font><font><font>and the crash happens when the action runs the first time.  I thought it was a bug in ghc 7.4.1, because I found a bug report that talks about a crash involving STM and multithreading, and supposedly was fixed in 7.4.2.  So I set up a virtual machine and installed fedora 18 then upgraded it to rawhide to try my program under 7.4.2.  But, the same crash happens on my rawhide machine.<br>


<br>However, it happened that I had to disable selinux on my rawhide machine using the boot command line because something started going wrong, still not sure what (hey, it&#39;s rawhide).  Now my program does not crash.  I just tested this on my fedora 18 laptop (still ghc 7.4.1) using both the version compiled on fedora 18 and the files from where I compiled it on rawhide: when I disable selinux, my program runs fine, but when it&#39;s enabled (even if set to permissive rather than enforcing) my program seg faults.<br>


<br></font></font></font></font></font></font></div><font><font face="verdana,sans-serif"><font><font><font><font>There&#39;s nothing useful in /var/log/messages, no indication of what selinux is unhappy about.  I did find this: <a href="http://www.haskell.org/pipermail/haskell-cafe/2007-August/031120.html" target="_blank">http://www.haskell.org/pipermail/haskell-cafe/2007-August/031120.html</a> but at least in that problem, there was a definite error message about memory mapping, and I&#39;m not getting one.<br>


<br>So as best I can tell, ghc 7.4.1&amp;2 must both be doing something strange, maybe marking some piece of memory as data instead of code, maybe when performing calls to gtk, maybe in building thunks for use by timeoutAddFull, and eventually triggering a security problem.<br>


<br></font></font></font></font></font></font></div><font><font face="verdana,sans-serif"><font><font><font><font>My program is huge, and I&#39;m trying to narrow down the problem, but it must be some unexpected interaction between ghc&#39;s newer run time systems, gtk, and selinux.<br>


<br></font></font></font></font></font></font></div><div><font><font face="verdana,sans-serif"><font><font><font><font>I&#39;ve posted a bug report with a small program that generates the same error:<br><br><a href="http://hackage.haskell.org/trac/ghc/ticket/7629">http://hackage.haskell.org/trac/ghc/ticket/7629</a><br>

</font></font></font></font></font></font></div><div><font><font face="verdana,sans-serif"><font><font><font><font><br>
In the mean time, has anyone else run into this problem?<br><br></font></font></font></font></font></font></div><div><font><font face="verdana,sans-serif"><font><font><font><font>-- Garrett Mitchener</font></font></font></font></font></font></div>


<font><font face="verdana,sans-serif"><font><font><font><font></font></font></font></font></font></font></div>