Opened 10 years ago

Closed 10 years ago

#2805 closed defect (fixed)

Atlas Colorpicker crashes on Linux

Reported by: agentx Owned by: ben
Priority: Should Have Milestone: Alpha 17
Component: Atlas editor Keywords:
Cc: Patch:

Description

Happens for sun & water, A16 and current SVN, std and dialog say:

../src/gtk/colour.cpp(207): assert "IsOk()" failed in Blue(): invalid colour
BACKTRACE:
[1] wxColour::Blue() const
[2] wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
[3] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[4] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[5] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[6] wxEvtHandler::TryHereOnly(wxEvent&)
[7] wxEvtHandler::ProcessEventLocally(wxEvent&)
[8] wxEvtHandler::ProcessEvent(wxEvent&)
[9] wxWindowBase::TryAfter(wxEvent&)
[10] wxEvtHandler::ProcessEvent(wxEvent&)
[11] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[12] wxWindowBase::HandleWindowEvent(wxEvent&) const
[13] g_cclosure_marshal_VOID__VOIDv
[14] g_signal_emit_valist
[15] g_signal_emit
[16] gtk_button_clicked
[17] g_cclosure_marshal_VOID__VOIDv
[18] g_signal_emit_valist
[19] g_signal_emit
[20] gtk_button_released
[21] g_closure_invoke
[22] g_signal_emit_valist
[23] g_signal_emit
[24] gtk_propagate_event
[25] gtk_main_do_event
[26] g_main_context_dispatch
[27] g_main_loop_run
[28] gtk_main
[29] wxGUIEventLoop::DoRun()
[30] wxEventLoopBase::Run()
[31] wxAppConsoleBase::MainLoop()
[32] wxAppConsoleBase::OnRun()
[33] wxAppBase::OnRun()
[34] wxEntry(int&, wchar_t**)
[35] wxEntry(int&, char**)
[36] Atlas_StartWindow
[37] BeginAtlas(CmdLineArgs const&, DllLoader const&) /Daten/Projects/Osiris/ps/trunk/build/workspaces/gcc/../../../source/tools/atlas/GameInterface/GameLoop.cpp:322
[38] ATLAS_Run /Daten/Projects/Osiris/ps/trunk/build/workspaces/gcc/../../../source/ps/GameSetup/Atlas.cpp:54
[39] ATLAS_RunIfOnCmdLine(CmdLineArgs const&, bool) /Daten/Projects/Osiris/ps/trunk/build/workspaces/gcc/../../../source/ps/GameSetup/Atlas.cpp:78
[40] RunGameOrAtlas /Daten/Projects/Osiris/ps/trunk/build/workspaces/gcc/../../../source/main.cpp:442
[41] main /Daten/Projects/Osiris/ps/trunk/build/workspaces/gcc/../../../source/main.cpp:556
[42] __libc_start_main
[43] _start

Change History (16)

comment:1 by Niek, 10 years ago

Could you give a little more info on your system? (This doesn't happen on windows and you seem to be the first one to encounter it on Linux...)

comment:2 by agentx, 10 years ago

It is Ubuntu Gnome 14.04. I can copy & paste something and re-compile, if it helps.

comment:3 by mimo, 10 years ago

The crash is reproducible for you ? could you describe which steps you follow to have it. I'm on kubuntu 14.04 and was not able to reproduce it.

comment:4 by historic_bruno, 10 years ago

It would be good to know which version of wxWidgets you're using, there are a number of bugs that only affect 2.8 or 3.0.

comment:5 by agentx, 10 years ago

The crash is reproducible for you?

Absolutely. I just choose a different color, accept and it fails.

$ python /usr/lib/python2.7/dist-packages/wxversion.py

['2.8-gtk2-unicode',
 '2.8-gtk2-unicode',
 '2.7.1-gtk2-ansi',
 '2.6-gtk2-unicode',
 '2.6-gtk2-ansi',
 '2.6-gtk-ansi',
 '2.5.3-gtk-ansi',
 '2.5.2-gtk2-unicode',
 '2.4-gtk-ansi']
True
True
False
Current sys.path:
['/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-i386-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode',
 '/tmp']

Asked for 2.4, (False):	 got: /tmp/wx-2.4-gtk-ansi
Asked for 2.5, (False):	 got: /tmp/wx-2.5.3-gtk-ansi
Asked for 2.5-gtk2, (False):	 got: /tmp/wx-2.5.2-gtk2-unicode
Asked for 2.5.2, (False):	 got: /tmp/wx-2.5.2-gtk2-unicode
Asked for 2.5-ansi, (False):	 got: /tmp/wx-2.5.3-gtk-ansi
Asked for 2.5-unicode, (False):	 got: /tmp/wx-2.5.2-gtk2-unicode
Asked for 2.6, (False):	 got: /tmp/wx-2.6-gtk2-unicode
Asked for 2.6-ansi, (False):	 got: /tmp/wx-2.6-gtk2-ansi
Asked for ['2.6-unicode', '2.7-unicode'], (False):	 got: /tmp/wx-2.6-gtk2-unicode
Asked for ['2.6', '2.7'], (False):	 got: /tmp/wx-2.7.1-gtk2-ansi
Asked for ['2.6-unicode', '2.7-unicode'], (True):	 got: /tmp/wx-2.6-gtk2-unicode
Asked for 2.4-unicode, (False):	 got: /tmp/wx-2.4-gtk-ansi
Asked for ['2.5.2', '2.5.3', '2.6'], (False):	 got: /tmp/wx-2.6-gtk2-unicode
Asked for 2.9:	 got Exception: Requested version of wxPython not found
Asked for incompatible versions, got Exception: A previously selected wx version does not match the new request.
EM: Asked for 2.6, (False):	 got: /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
EM: Asked for 2.6-unicode, (False):	 got: /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
EM: Asked for 2.6-unicode, (True):	 got: /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
EM: Asked for 2.9:	 got Exception: Requested version of wxPython not found

According to synaptic there is also:

libwxbase2.8-0
libwxbase3.0-0
libwxgtk2.8-0
libwxgtk3.0-0

comment:6 by historic_bruno, 10 years ago

We don't use wxPython, so that's not directly relevant, but I notice our build instructions now suggest the libwxgtk3.0-dev package, so if you followed them, you have 3.0. wx-config --version should tell you. Perhaps mimo has a different version. Also, is it a release or debug build?

comment:7 by mimo, 10 years ago

wx-config 2.8.12 for me, no debug build

comment:8 by Niek, 10 years ago

I can reproduce the error on Ubuntu 14.04 and with Alpha 16 (SVN untested).

wx-config --version gives me 3.0.0

comment:9 by agentx, 10 years ago

wx-config --version gives me 3.0.0

me too. Release build. Can I switch back to 2.8?

in reply to:  9 comment:10 by historic_bruno, 10 years ago

Replying to agentx:

wx-config --version gives me 3.0.0

me too. Release build. Can I switch back to 2.8?

Yes, I have a feeling it's a wxWidgets bug, maybe even fixed in their trunk or 3.0.1, but we will need more testing to know for sure.

comment:11 by agentx, 10 years ago

Resolution: worksforme
Status: newclosed

Works now after switching back to 2.8.

comment:12 by Niek, 10 years ago

How do you switch back to 2.8?

comment:13 by agentx, 10 years ago

Installed libwxbase2.8-dev, libwxgtk2.8-dev, wx2.8-headers, removed their *3.0-dev counterparts and recompiled. So this is a SVN solution.

comment:14 by historic_bruno, 10 years ago

Milestone: Alpha 17

comment:15 by historic_bruno, 10 years ago

Milestone: Alpha 17
Resolution: worksforme
Status: closedreopened

Did some debugging of this, and I think it really is a bug in our code, if one that's only noticeable in wxWidgets 3.0.

To summarize, we derive a color picker class from wxColourDialog, and part of it loads and saves the custom colors from the dialog via the wxColourData class. According to the documentation for wxColourData::GetCustomColour:

Returns custom colours associated with the colour dialog. Parameters i An integer between 0 and 15, being any of the 15 custom colours that the user has saved. The default custom colours are invalid colours.

We don't call IsOk() to check if the color is valid or not before using it, causing the assertion failure.

comment:16 by ben, 10 years ago

Owner: set to ben
Resolution: fixed
Status: reopenedclosed

In 15782:

Fixes crash in Atlas color picker tool, noticeable with wxWidgets 3.0. Colors returned by wxColourData::GetCustomColour aren't always valid, so we have to test them with IsOk() before accessing them. Fixes #2805

Note: See TracTickets for help on using tickets.