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
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:
#90I'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:
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
Also added my configuration to HaskellWiki:
http://www.haskell.org/haskellwiki/WxHaskell/Mac