I experience the crash on wxQT, where both GTK and MSW worked just fine.
I expect the progrm to at least not to crash
Backtrace:
Thread 1 "dbhandler" received signal SIGSEGV, Segmentation fault.
0x00007ffff6db6e00 in QPixmap::isNull() const () from /usr/lib64/libQt5Gui.so.5
(gdb) bt
#0 0x00007ffff6db6e00 in QPixmap::isNull() const () from
/usr/lib64/libQt5Gui.so.5
#1 0x00007ffff6dc4e3c in QIcon::addPixmap(QPixmap const&,
QIcon::Mode, QIcon::State) () from /usr/lib64/libQt5Gui.so.5
#2 0x00007ffff5103ce2 in wxToolBarTool::SetIcon (this=0x555555a50d70)
at ../src/qt/toolbar.cpp:119
#3 0x00007ffff51049ad in wxToolBar::DoInsertTool
(this=0x555555bb4170, pos=5, toolBase=0x555555a50d70) at
../src/qt/toolbar.cpp:296
#4 0x00007ffff5250184 in wxToolBarBase::InsertTool
(this=0x555555bb4170, pos=5, tool=0x555555a50d70) at
../src/common/tbarbase.cpp:201
#5 0x00007ffff5252fff in wxToolBarBase::DoInsertNewTool
(this=0x555555bb4170, pos=5, tool=0x555555a50d70) at
../include/wx/tbarbase.h:679
#6 0x00007ffff5250073 in wxToolBarBase::InsertTool
(this=0x555555bb4170, pos=5, toolid=6, label=..., bitmap=...,
bmpDisabled=..., kind=wxITEM_NORMAL, shortHelp=...,
longHelp=..., clientData=0x0) at ../src/common/tbarbase.cpp:186
#7 0x00007ffff524ff6d in wxToolBarBase::DoAddTool
(this=0x555555bb4170, toolid=6, label=..., bitmap=...,
bmpDisabled=..., kind=wxITEM_NORMAL, shortHelp=...,
longHelp=..., clientData=0x0) at ../src/common/tbarbase.cpp:169
#8 0x0000555555582717 in wxToolBarBase::AddTool (this=0x555555bb4170,
toolid=6, label=..., bitmap=..., bmpDisabled=..., kind=wxITEM_NORMAL,
shortHelp=...,
longHelp=..., clientData=0x0) at /usr/local/include/wx-3.2/wx/tbarbase.h:306
#9 0x000055555557c59c in MainFrame::InitToolBar (this=0x55555572c410,
toolBar=0x555555bb4170) at ../../dbhandler/mainframe.cpp:375
#10 0x00005555555792cc in MainFrame::MainFrame (this=0x55555572c410,
manager=0x55555572bdc0) at ../../dbhandler/mainframe.cpp:213
#11 0x0000555555571b10 in MyApp::OnInit (this=0x5555556219b0) at
../../dbhandler/docview.cpp:130
#12 0x0000555555574327 in wxAppConsoleBase::CallOnInit
(this=0x5555556219b0) at /usr/local/include/wx-3.2/wx/app.h:93
#13 0x00007ffff4ad44b4 in wxEntry (argc=@0x7ffff4c9b724: 1,
argv=0x555555625fc0) at ../src/common/init.cpp:481
#14 0x00007ffff4ad45be in wxEntry (argc=@0x7fffffffdbfc: 1,
argv=0x7fffffffdcf8) at ../src/common/init.cpp:509
#15 0x00005555555712b8 in main (argc=1, argv=0x7fffffffdcf8) at
../../dbhandler/docview.cpp:71
(gdb)
toolBar->AddTool( wxID_LIBRARY, _( "Library" ), wxBitmapBundle::FromSVG( "library", wxSize( 16, 16 ) ), wxBitmapBundle::FromSVG( "library", wxSize( 16, 16 ) ), wxITEM_NORMAL, _( "Library selector" ) );
Steps to reproduce the behaviour, please make them as detailed as possible.
For example:
THe library.h file is as follows:
static const char library[] =
R"xxx(
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I fixed my code and the crash is gone now.
However, the GTK port is not crashing, but just doesn't render the icon/tool.
So, I'll leave it up to core devs to close it.
The proper code is:
toolBar->AddTool( wxID_LIBRARY, _( "Library" ), wxBitmapBundle::FromSVG( library, wxSize( 16, 16 ) ), wxBitmapBundle::FromSVG( library, wxSize( 16, 16 ) ), wxITEM_NORMAL, _( "Library selector" ) );
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
There is literally not a single character difference between the original code and the "proper" code you posted, so I have no idea what are you trying to say, but I guess the real issue is that wxQt crashes, instead of just asserting, when being passed an invalid bitmap bundle or bitmap. If so, this indeed should be fixed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@vadz ,
There is literally not a single character difference between the original code and the "proper" code you posted,
I guess you "need a new glasses", in order to see the "library" vs library. ;-)
Anyway - yes wxGTK just doesn't render the item and wxQt crashes.
I am not sure that wxGTK should assert on the bad bitmap, but...
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
OK, yes, I missed the difference, thanks for pointing it out. It would certainly have been nicer to be a bit more explicit to begin with.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.