Hi all,

the ToolBar::AddTool XS code doesn't check whether it's being passed a Wx::Bitmap at all. If you pass undef for the bitmap, you get a friendly segmentation fault.

General question: Is this kind of not checking the parameters on purpose (i.e "whoever uses this should know what she's doing") or is it a bug?

Cheers,
Steffen
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f820ac1e6e0 (LWP 27387)]
0x00007f820731616e in wxObject::Ref () from /usr/local/lib/perl/5.8.8/Alien/wxWidgets/gtk_2_8_8/lib/libwx_base-2.8.so.0
Current language:  auto; currently asm
(gdb) bt
#0 0x00007f820731616e in wxObject::Ref () from /usr/local/lib/perl/5.8.8/Alien/wxWidgets/gtk_2_8_8/lib/libwx_base-2.8.so.0 #1 0x00007f8207806511 in wxToolBar::CreateTool () from /usr/local/lib/perl/5.8.8/Alien/wxWidgets/gtk_2_8_8/lib/libwx_gtk2_core-2.8.so.0 #2 0x00007f8207884e7c in wxToolBarBase::InsertTool () from /usr/local/lib/perl/5.8.8/Alien/wxWidgets/gtk_2_8_8/lib/libwx_gtk2_core-2.8.so.0 #3 0x00007f820808ce45 in XS_Wx__ToolBarBase_AddToolNewShort () from /usr/local/lib/perl/5.8.8/auto/Wx/Wx.so
#4  0x00007f820a77f2b3 in Perl_pp_entersub () from /usr/lib/libperl.so.5.8
#5 0x00007f820a77db1e in Perl_runops_standard () from /usr/lib/libperl.so.5.8
#6  0x00007f820a7273d9 in Perl_call_sv () from /usr/lib/libperl.so.5.8
#7 0x00007f8208082975 in XS_Wx__ToolBarBase_AddTool () from /usr/local/lib/perl/5.8.8/auto/Wx/Wx.so
#8  0x00007f820a77f2b3 in Perl_pp_entersub () from /usr/lib/libperl.so.5.8
#9 0x00007f820a77db1e in Perl_runops_standard () from /usr/lib/libperl.so.5.8
#10 0x00007f820a727f1f in perl_run () from /usr/lib/libperl.so.5.8
#11 0x00000000004018cc in main ()
(gdb)

Reply via email to