wxHaskell icon indicating copy to clipboard operation
wxHaskell copied to clipboard

Random crashes in Windows upon use of (:~) with Event

Open sukhmel opened this issue 11 years ago • 1 comments

  1. When (:~) is used with set ... [on command ...], program crashes, and prints Segmentation fault/access violation in generated code message;
  2. Crashes occur frequently, but not always;
  3. In case when tested with only one object, crash never happens immediately after start;
  4. Upon use of (:=), everything works fine;
  5. Sample code is provided.

This issue was fully decribed in HeinrichApfelmus/reactive-banana#62.

  • when line with (:=), marked with a comment, is used, everything is perfectly fine
  • when (:~) is used, random crashes occur frequently.

> import Control.Monad (replicateM, mapM_)
> import Graphics.UI.WX

> main = start $ do
>        pad     <- frame [ ]                     
>        buttons <- replicateM 2
>                 $ button pad  []

>        mapM_ (flip set [on command := return ()]) buttons -- OK
>        mapM_ (flip set [on command :~ const (return ())]) buttons

sukhmel avatar Jun 23 '14 21:06 sukhmel

Cannot reproduce bug with this environment:

  • wxWidgets: 2.9.5
  • ghc: 7.6.3
  • MinGW (for wxWidgets build): 5.1.16
  • MinGW (for wx build) - default for Haskell Platform.
  • MSYS: 1.0
  • wx: 0.90.1.1

swamp-agr avatar Jul 27 '14 10:07 swamp-agr