Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxmaxima crashes on gnome 3 with 2 displays #1092

Closed
jose-matos opened this issue Mar 5, 2019 · 7 comments
Closed

wxmaxima crashes on gnome 3 with 2 displays #1092

jose-matos opened this issue Mar 5, 2019 · 7 comments
Labels
Bug in external framework This bug is in an external framework and might not be fixable from wxMaxima.

Comments

@jose-matos
Copy link

A fedora user reported a crash on Gnome 3 with 2 or more displays:
https://bugzilla.redhat.com/show_bug.cgi?id=1680656

The bug report has more debug information, in particular
https://bugzilla.redhat.com/show_bug.cgi?id=1680656#c14

says
"Also its probably worth noting, the wxmaxima crash dialog has the message:

../src/common/dpycmn.cpp(119): assert "n < GetCount()" failed in wxDisplay(): An invalid index was passed to wxDisplay"

@gunterkoenigsmann
Copy link
Member

Thanks for notifying me. Let's see if I can find out what causes this problem.

@samtygier
Copy link

Wtih wxMaxima-19.03.1-1.fc29 from https://koji.fedoraproject.org/koji/buildinfo?buildID=1228558 I still see the same crash. Is there anything more I can do to help debug?

@gunterkoenigsmann
Copy link
Member

What would help here would be a fully symbolic backtrace of the crash. On Ubuntu such a thing could be created the following way:

  • Install the debug symbols package for wxMaxima: The information which line number in the code corresponds to which memory address tends to be long.

  • install gdb

  • type the following into an console:

    gdb wxmaxima
    run

    backtrace

gdb will then output the info which line of which function caused the crash, which parameters the function has been called with and which function has called this one with which parameters and so on...

@samtygier
Copy link

Here is the backtrace with current git master.

../src/common/dpycmn.cpp(119): assert "n < GetCount()" failed in wxDisplay(): An invalid index was passed to wxDisplay

(wxmaxima:2580): Gtk-WARNING **: 14:26:13.968: gtk_window_set_titlebar() called on a realized window

Thread 1 "wxmaxima" received signal SIGTRAP, Trace/breakpoint trap.
raise (sig=sig@entry=5) at ../sysdeps/unix/sysv/linux/raise.c:50
50	  return ret;
Missing separate debuginfos, use: dnf debuginfo-install libsoup-2.64.2-1.fc29.x86_64 libunistring-0.9.10-4.fc29.x86_64 openssl-libs-1.1.1b-5.fc29.x86_64 orc-0.4.28-3.fc29.x86_64 sqlite-libs-3.26.0-1.fc29.x86_64
(gdb) bt
#0  0x00007ffff6c72f0f in raise (sig=sig@entry=5) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7041eae in wxTrap() () at ../src/common/appbase.cpp:1051
#2  0x00007ffff757375d in wxGUIAppTraits::ShowAssertDialog(wxString const&) (this=<optimized out>, msg=...)
    at ../src/gtk/utilsgtk.cpp:345
#3  0x00007ffff70468d7 in ShowAssertDialog(wxString const&, int, wxString const&, wxString const&, wxString const&, wxAppTraits*) (file=..., line=<optimized out>, func=..., cond=..., msgUser=..., traits=0xa2f5f0)
    at /usr/include/c++/8/bits/char_traits.h:398
#4  0x00007ffff7046b14 in wxAppConsoleBase::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)
    (this=this@entry=0x9b8ee0, file=<optimized out>, line=119, func=<optimized out>, cond=<optimized out>, msg=<optimized out>) at ../include/wx/string.h:3488
#5  0x00007ffff75416e4 in wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)
    (this=0x9b8ee0, file=<optimized out>, line=<optimized out>, func=<optimized out>, cond=<optimized out>, msg=<optimized out>) at ../src/gtk/app.cpp:540
#6  0x00007ffff7046de4 in wxDefaultAssertHandler(wxString const&, int, wxString const&, wxString const&, wxString const&) (file=..., line=119, func=..., cond=..., msg=...) at ../include/wx/string.h:4179
#7  0x00007ffff7043775 in wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)
    (file=file@entry=0x7ffff77cacf0 "../src/common/dpycmn.cpp", line=line@entry=119, func=func@entry=0x7ffff77cad80 <wxDisplay::wxDisplay(unsigned int)::__FUNCTION__> "wxDisplay", cond=cond@entry=0x7ffff77cad09 "n < GetCount()", msg=msg@entry=0x7ffff77cac08 L"An invalid index was passed to wxDisplay") at ../include/wx/string.h:3488
#8  0x00007ffff7656f3e in wxDisplay::wxDisplay(unsigned int) (this=0x7fffffffa320, n=4294967295)
    at ../include/wx/display_impl.h:82
#9  0x00007ffff76469f5 in wxStandardDialogLayoutAdapter::DoMustScroll(wxDialog*, wxSize&, wxSize&) (dialog=
    0x1830310, windowSize=..., displaySize=...) at ../src/common/dlgcmn.cpp:907
#10 0x00007ffff7646adc in wxStandardDialogLayoutAdapter::MustScroll(wxDialog*, wxSize&, wxSize&)
    (displaySize=..., windowSize=..., dialog=<optimized out>, this=<optimized out>)
    at ../src/common/dlgcmn.cpp:897
#11 0x00007ffff7646adc in wxStandardDialogLayoutAdapter::CanDoLayoutAdaptation(wxDialog*)
    (this=<optimized out>, dialog=<optimized out>) at ../src/common/dlgcmn.cpp:654
#12 0x00007ffff75bc89e in wxDialog::Show(bool) (this=0x1830310, show=<optimized out>)
    at ../src/gtk/dialog.cpp:69
#13 0x00007ffff75bca0d in wxDialog::ShowModal() (this=0x1830310) at ../src/gtk/dialog.cpp:164
#14 0x000000000061c25c in wxMaxima::AlgebraMenu(wxCommandEvent&) (this=0xa63c90, event=...)
    at /var/tmp/wxmaxima/src/wxMaxima.cpp:5205
#15 0x00007ffff71ae492 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (entry=..., handler=<optimized out>, event=...) at ../include/wx/app.h:439
#16 0x00007ffff71ae5a3 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    (this=<optimized out>, event=..., self=self@entry=0xa63c90) at ../src/common/event.cpp:996
#17 0x00007ffff71ae900 in wxEvtHandler::TryHereOnly(wxEvent&) (this=0xa63c90, event=...)
    at ../src/common/event.cpp:1587
#18 0x00007ffff71ae773 in wxEvtHandler::DoTryChain(wxEvent&) (this=<optimized out>, event=...)
    at ../src/common/event.cpp:1552
#19 0x00007ffff71aea21 in wxEvtHandler::ProcessEvent(wxEvent&) (this=0xa64248, event=...)
    at ../src/common/event.cpp:1493
#20 0x00007ffff772504b in wxWindowBase::TryAfter(wxEvent&) (this=0xdb0d30, event=...)
    at ../include/wx/window.h:846
#21 0x00007ffff71ae7bb in wxEvtHandler::SafelyProcessEvent(wxEvent&) (this=<optimized out>, event=...)
    at ../src/common/event.cpp:1611
#22 0x00007ffff7726410 in wxWindowBase::HandleWindowEvent(wxEvent&) const (this=this@entry=0xdb0d30, event=...)
    at ../include/wx/window.h:846
#23 0x00007ffff76d9f39 in wxMenuBase::SendEvent(int, int)
    (this=this@entry=0xf269d0, itemid=itemid@entry=8533, checked=<optimized out>)
    at ../src/common/menucmn.cpp:666
#24 0x00007ffff75d2d6f in menuitem_activate(GtkWidget*, wxMenuItem*) (item=0xf69c60)
    at ../include/wx/menuitem.h:92
#28 0x00007ffff621d0a3 in <emit signal ??? on instance 0xf67530 [GtkMenuItem]>
    (instance=instance@entry=0xf67530, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
    #25 0x00007ffff62003dd in g_closure_invoke
    (closure=0xf6ca30, return_value=0x0, n_param_values=1, param_values=0x7fffffffd190, invocation_hint=0x7fffffffd110) at gclosure.c:810
    #26 0x00007ffff6213983 in signal_emit_unlocked_R
    (node=node@entry=0xa0b6e0, detail=detail@entry=0, instance=instance@entry=0xf67530, emission_return=emission_--Type <RET> for more, q to quit, c to continue without paging--
return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd190) at gsignal.c:3635
    #27 0x00007ffff621caaa in g_signal_emit_valist
    (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd350) at gsignal.c:3391
#29 0x00007ffff66d6f32 in gtk_widget_activate (widget=widget@entry=0xf67530 [GtkMenuItem]) at gtkwidget.c:7777
#30 0x00007ffff65a60b6 in gtk_menu_shell_activate_item
    (menu_shell=0xf04880 [GtkMenu], menu_item=0xf67530 [GtkMenuItem], force_deactivate=<optimized out>)
    at gtkmenushell.c:1375
#31 0x00007ffff65a6353 in gtk_menu_shell_button_release (widget=0xf04880 [GtkMenu], event=<optimized out>)
    at gtkmenushell.c:791
#32 0x00007ffff6727ac8 in _gtk_marshal_BOOLEAN__BOXEDv
    (closure=0x9fef30, return_value=0x7fffffffd690, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x9fef60) at gtkmarshalers.c:129
#33 0x00007ffff6200636 in _g_closure_invoke_va
    (closure=0x9fef30, return_value=0x7fffffffd690, instance=0xf04880, args=0x7fffffffd760, n_params=1, param_types=0x9fef60) at gclosure.c:873
#34 0x00007ffff621c524 in g_signal_emit_valist
    (instance=0xf04880, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd760)
    at gsignal.c:3300
#35 0x00007ffff621d0a3 in g_signal_emit
    (instance=instance@entry=0xf04880, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
#36 0x00007ffff66d3ce4 in gtk_widget_event_internal
    (widget=widget@entry=0xf04880 [GtkMenu], event=event@entry=0x14f1de0) at gtkwidget.c:7744
#37 0x00007ffff66d6abe in gtk_widget_event (widget=widget@entry=0xf04880 [GtkMenu], event=event@entry=0x14f1de0)
    at gtkwidget.c:7314
#38 0x00007ffff6590a36 in propagate_event_up
    (topmost=<optimized out>, event=<optimized out>, widget=0xf04880 [GtkMenu]) at gtkmain.c:2582
#39 0x00007ffff6590a36 in propagate_event
    (widget=<optimized out>, event=0x14f1de0, captured=<optimized out>, topmost=0x0) at gtkmain.c:2685
#40 0x00007ffff6592bf3 in gtk_main_do_event (event=0x14f1de0) at gtkmain.c:1915
#41 0x00007ffff6592bf3 in gtk_main_do_event (event=<optimized out>) at gtkmain.c:1685
#42 0x00007ffff6283a39 in _gdk_event_emit (event=event@entry=0x14f1de0) at gdkevents.c:73
#43 0x00007ffff62b5516 in gdk_event_source_dispatch
    (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gdkeventsource.c:367
#44 0x00007ffff5f7206d in g_main_dispatch (context=0x9ea000) at gmain.c:3182
#45 0x00007ffff5f7206d in g_main_context_dispatch (context=context@entry=0x9ea000) at gmain.c:3847
#46 0x00007ffff5f72438 in g_main_context_iterate
    (context=0x9ea000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3920
#47 0x00007ffff5f72762 in g_main_loop_run (loop=0x1512980) at gmain.c:4116
#48 0x00007ffff6591c5d in gtk_main () at gtkmain.c:1323
#49 0x00007ffff755c545 in wxGUIEventLoop::DoRun() (this=0xa56600) at ../src/gtk/evtloop.cpp:65
#50 0x00007ffff707fe21 in wxEventLoopBase::Run() (this=0xa56600) at ../src/common/evtloopcmn.cpp:78
#51 0x00007ffff7043b1a in wxAppConsoleBase::MainLoop() (this=0x9b8ee0) at ../src/common/appbase.cpp:334
#52 0x00007ffff70c9d0b in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>)
    at ../include/wx/app.h:439
#53 0x00000000005eae0a in main(int, char**) (argc=1, argv=0x7fffffffdc18) at /var/tmp/wxmaxima/src/main.cpp:54

@gunterkoenigsmann
Copy link
Member

Hmmm... ...here I am not doing anything at all: I just tell wxWidgets to show a modal dialogue - and it is wxWidgets who calls wxDisplay => Either gtk or wxWidgets contains a bug. But currently I don't see a workaround as I try to make not too many dialogues modal. But with some one cannot avoid that.

@gunterkoenigsmann
Copy link
Member

As a 2nd thought it definitely is wxWidgets: On creating the dialogue wxWidgets wants to know the DPI rate of the current screen
Which sounds pretty harmless. But the dialogue has not yet been placed on any screen at this time => assert failure. I hope that has been resolved in the wxWidgets 3.1 branch. But I don't own the equipment necessary for testing.

@jscott0
Copy link

jscott0 commented Dec 19, 2019

@gunterkoenigsmann I do, and if there were a wxWidgets 3.1 package in Debian I'd build it, but it's somewhat inconvenient otherwise. It looks like it's probably fixed by these changes and in particular this and this one

Edit nevermind, the switch from GTK 2 to GTK 3 appears to have fixed it for me.

@KubaO KubaO closed this as completed Jul 10, 2020
@KubaO KubaO added the Bug in external framework This bug is in an external framework and might not be fixable from wxMaxima. label Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug in external framework This bug is in an external framework and might not be fixable from wxMaxima.
Projects
None yet
Development

No branches or pull requests

5 participants