Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

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

confirmed
open
nobody
5
2014-07-17
2014-07-15
No

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: 0.91.0.0 (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

Discussion

  • Also see https://sourceforge.net/p/wxhaskell/bugs/92/ (symbol not being found on libwxc.dylib in the flat namespace). In there, the libraries are compiled with Apple's LLVM.

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

     

    Related

    Bugs: #90

  • I'll try with wxWidgets 3.0.1.

     
  • 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/
    ./configure
    ./bin/mk-cabal-clean
    ./bin/mk-cabal
    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