[erlang-questions] VM segfault on exit with wx

Michael Santos michael.santos@REDACTED
Sat Oct 2 00:46:05 CEST 2010


On Tue, Sep 28, 2010 at 01:44:12PM -0400, Mark Scandariato wrote:
> Seems like the VM segfaults on exit whenever I run anything that uses wx
> (this is a single processor system).
> 
> Let me know if you need any other info (or a core file or whatever).
> 
> Mark.
> 
> erlang@REDACTED:~/otp_src_R14B$ uname -a
> Linux ubuntu 2.6.28-19-generic #65-Ubuntu SMP Thu Sep 16 14:14:28 UTC 2010
> i686 GNU/Linux
> erlang@REDACTED:~/otp_src_R14B$ bin/cerl -debug -smp enable
> Erlang R14B (erts-5.8.1) [source] [smp:1:1] [rq:1] [async-threads:0] [hipe]
> [kernel-poll:false] [type-assertions] [debug-compiled] [lock-checking]
> 
> Eshell V5.8.1  (abort with ^G)
> 1> wx:demo().
> {wx_ref,35,wxFrame,<0.34.0>}
> 2> q().
> ok
> 3> Segmentation fault (core dumped)

Looks as if beam is crashing printing out an error message. The attached
patch seems to fix it.

diff --git a/lib/wx/c_src/wxe_return.cpp b/lib/wx/c_src/wxe_return.cpp
index 2c4f754..4c0e738 100644
--- a/lib/wx/c_src/wxe_return.cpp
+++ b/lib/wx/c_src/wxe_return.cpp
@@ -67,6 +67,6 @@ int wxeReturn::send() {
     if(res == -1) {
       wxString msg;
-      msg.Printf(wxT("Failed to send return or event msg"));
-      send_msg("internal_error", &msg);
+      if (msg.Printf(wxT("Failed to send return or event msg")) >= 0)
+        send_msg("internal_error", &msg);
     }
     reset();


More information about the erlang-questions mailing list