#93 All wxHaskell samples crash on Mac OS X 10.9 Mavericks with "malloc: *** error for object 0x108c45870: pointer being freed was not allocated"


All the samples crash with the following message on run time,
just after a window and GUI being shown:

➜ wx git:(master) ✗ ./helloworld
helloworld(78137,0x7fff75e4b310) malloc: error for object 0x108c45870: pointer being freed was not allocated
set a breakpoint in malloc_error_break to debug
[1] 78137 abort ./helloworld

Arch: x86_64 (iMac 27" 2008)
OS: Mac OS X 10.9.3
XCode: 5.1.1
C compiler: gcc (MacPorts gcc48 4.8.2_2) 4.8.2
GHC: 7.6.3
Haskell Platform: haskell-platform-2013.2.0.0
wxWidgets: 2.9.5 (installed with brew install wxmac --devel)
wxHaskell: (from https://github.com/wxHaskell/wxHaskell.git)

All the wx* libraries and samples (with -fbuildSamples) from reactive-banana-wx have been built with:
cabal install --force-reinstalls --with-gcc=/opt/local/bin/gcc

1 Attachments


  • Henk-Jan van Tuyl

    This looks more like bug ticket 90; try wxWidgets 3.0.1, I have much less crashes since I installed it.



    Bugs: #90

  • Peter Hillerström

    I'll try with wxWidgets 3.0.1.

  • Peter Hillerström

    Thank you!!!

    Now all the samples on wxcore and contrib work, and all samples under wx also, except these had some problems:

    • CustomControl (doesn't show anything)
    • FileBrowse (crash: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread)
    • ListCtrl (crash on exit: Pure virtual function called! abort() called)
    • Print (first time: stack trace when selecting print preview, second time: crash: Performing @selector(clickedAction:) from sender wxNSMenuItem 0x7f9ffa62a840)
    • TimeFlows (crash: Exception Type: EXC_CRASH (SIGTRAP))
    • TimeFlowsEx (wWidgets debug alert: ../src/osx/carbon/graphics.cpp(143): assert "retval != __null" failed in wxMacCreateCGColor().

    Call stack:
    [00] wxMacCoreGraphicsPenData::wxMacCoreGraphicsPenData(wxGraphicsRenderer*, wxPen const&)
    [01] wxMacCoreGraphicsRenderer::CreatePen(wxPen const&)
    [02] wxGraphicsContext::CreatePen(wxPen const&) const
    [03] wxGraphicsContext::SetPen(wxPen const&)
    [04] wxDC::SetPen(wxPen const&)
    [05] wxDC_SetPen
    [06] s2qWp_info

    Do you want to stop the program?
    You can also choose [Cancel] to suppress further warnings.)

    Installed wxWidget from ports and rebuilt the samples:

    sudo port install wxWidgets-3.0 wxWidgets_select

    cd wxHaskell-git/
    cd samples
    cd wx
    for F in .hs; do ghc --make $F && echo $F | ruby -pe 'gsub(/.hs/, "")' | xargs macosx-app $1 ; done
    cd ..
    cd wxcore
    for F in
    .hs; do ghc --make $F && echo $F | ruby -pe 'gsub(/.hs/, "")' | xargs macosx-app $1 ; done
    cd ..
    cd contrib
    for F in *.hs; do ghc --make $F && echo $F | ruby -pe 'gsub(/.hs/, "")' | xargs macosx-app $1 ; done

    All the reactive-banana-wx smaples also work!

    cd reactive-banana/reactive-banana-wx
    cabal clean
    cabal configure
    cabal install -fbuildSamples --force-reinstalls

  • Henk-Jan van Tuyl

    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks