2

I followed these instructions to install wxWidgets (using Homebrew) and wxHaskell on OS X Lion. There were no errors.

When I try the examples here, the first Hello World example runs fine. However, when I try to run the Bouncing Balls example, I get:

Main(98350,0x7fff72edd960) malloc: * error for object 0x10e121580: pointer being freed was not allocated

I am building with

ghc --make Main.hs

When I simply run the executable, I get that error. If I use macosx-app to bundle it into an app, it simply crashes (presumably the same error). I've tried reinstalling both wxWidgets and the Haskell packages, but the error persists.

With gdb:

Main(10236,0x7fff72edd960) malloc: *** error for object 0x102b68580: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff83cc7ce2 in __pthread_kill ()
(gdb) backtrace
#0  0x00007fff83cc7ce2 in __pthread_kill ()
#1  0x00007fff891077d2 in pthread_kill ()
#2  0x00007fff890f8a7a in abort ()
#3  0x00007fff8915784c in free ()
#4  0x00007fff866d0702 in std::string::_Rep::_M_dispose ()
#5  0x00007fff866d0740 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string ()
#6  0x00000001017e779a in wxString::~wxString ()
#7  0x00000001018957c8 in wxEventBasicPayloadMixin::~wxEventBasicPayloadMixin ()
#8  0x0000000101879da5 in wxCommandEvent::~wxCommandEvent ()
#9  0x0000000101894b42 in wxEvtHandler_GetClosure ()
#10 0x0000000100276f91 in s19gn_info ()
Brandon oubiub
  • 311
  • 1
  • 3
  • 9
  • This is an error in C land. Could you try to use a debugger like `gdb` to run the program? You could at least get a stack trace then. – dflemstr Aug 05 '12 at 22:15
  • I updated the question with the output from gdb. – Brandon oubiub Aug 05 '12 at 22:39
  • Uh-oh! Could you try this [tiny collection of samples](https://github.com/kowey/debug-wx)? It goes in stages (wxWidgets, wxcore, wx). Ideally, it should have a wxc stage but I don't really know how to write it. Also, did you remember the --use-llvm flag when install wxmac via HomeBrew? Otherwise, try the mailing list. **Edit** OH sorry, just noticed you did run the hello worlds. Hmm, yeah please do try the mailing list – kowey Aug 06 '12 at 06:37

0 Answers0