Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: FW: SetIcon in sample programs causing BadAlloc error in gdk (wx2.8.3, SunStudio12, g++ 3.4.3)

0 views
Skip to first unread message

Vadim Zeitlin

unread,
Apr 8, 2008, 9:07:35 AM4/8/08
to
On Thu, 27 Mar 2008 19:01:39 -0600 "Bond, Gary D" <gary....@lmco.com> wrote:

BGD> I recently installed wx2.8.3 on a solaris box and encountered a runtime
BGD> problem

First of all you should really use wx 2.8.7, it's 100% compatible with
2.8.3 so you shouldn't have any trouble upgrading to it but it contains
many bug fixes and while I don't remember anything related to this one, you
should still try it first.

BGD> (actually the problem occurs in any sample using SetIcon).

So in the minimal sample too?

BGD> I used
BGD> configure to perform a debug build of gtk2. I ran the listctrl sample
BGD> and the application died with the following backtrace (I'm sorry it is
BGD> only a partial listing, but the program is on a classified system and I
BGD> cannot transfer the full backtrace to an unclassified host)

Just to confirm it, did you run it with --sync command line option?

BGD> exit
BGD> gdk_x_error
BGD> _XError
BGD> _XReplay
BGD> XSync
BGD> _gdk_x11_copy_to_image
BGD> gdk_drawable_copy_to_image
BGD> gdk_pixmap_copy_to_image
BGD> gdk_drawable_copy_to_image
BGD> gdk_pixbuf_get_from_drawable
BGD> wxBitMap::GetPixbuf
BGD> wxTopLevelWindowGTK::SetIcons
BGD> wxTopLevelWindowGTK::SetIcon
BGD> MyFrame::MyFrame
BGD> MyApp::OnInit
BGD> wxAppCOnsole::CallOnInit
BGD> wxEntry
BGD> main

Can you check if GetPixbuf() returns something valid (at least non NULL)?

BGD> Thanks for your assistance. Please let me know if you have any
BGD> questions.

It's really difficult to do anything about such bug without being able to
reproduce it or even see the details of the stack trace... Does the bug
appear only when using some visuals by chance? Which one do you use in
fact?

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Bond, Gary D

unread,
Apr 8, 2008, 1:17:03 PM4/8/08
to
Vadim,

Thanks for your reply. I caught the minimal sample in the debugger and
it is failing at the same location. In the wxBitmap::GetPixbuf method.
In answer to your question Does GetPixbuf return anything valid, the
answer is it never returns from GetPixbuf. The gtk error is triggered
in the GetPixbuf method where it is calling the
gdk_pixbuf_get_from_drawable on line 937 of src/gtk/bitmap.cpp. The
gdk_pixbuf_get_from_drawable function is passed
M_BMPDATA->m_mask->GetBitmap(), width and height, with all other
arguments 0. The width and height values are both 32. So it would seem
as though the mask might be a problem???

When I run the minimal program I get the following error:

The program 'minimal' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
(Details: serial 141 error_code 11 request_code 131 minor_code
5)

To generate the backtrace given in the earlier email I did use sync when
I ran the executable in the debugger (dbx).

Thanks for your assistance. I'll try to find out what it will take to
upgrade to 2.8.7. Unfortunately, it sometimes takes a miracle to do the
simplest things around here.

Thanks again,
Gary

Regards,
VZ

_______________________________________________
wx-users mailing list
wx-u...@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wx-users

Bond, Gary D

unread,
Apr 8, 2008, 4:15:56 PM4/8/08
to
Vadim,

I discovered one interesting item while looking into this problem. In
the wxBitmap::wxBitmap(const char* const* bits) (line 253 of
gtk/bitmap.cpp) constructor I found out that the
gdk_pixmap_create_from_xpm_d does change the mask argument. If after
the call I reset mask to 0 then the application runs, but it looks as
though no mask is created for the bitmap. I'm not sure why this
prevents the gdk error from occurring, but I thought it might be useful
for you or someone who knows more about gdk than I do.

Thanks again for your help. I'll keep trying to isolate the problem
further.

Sincerely,

Vadim Zeitlin

unread,
Apr 8, 2008, 5:04:53 PM4/8/08
to
On Tue, 08 Apr 2008 14:15:56 -0600 "Bond, Gary D" <gary....@lmco.com> wrote:

BGD> I discovered one interesting item while looking into this problem. In
BGD> the wxBitmap::wxBitmap(const char* const* bits) (line 253 of
BGD> gtk/bitmap.cpp) constructor I found out that the
BGD> gdk_pixmap_create_from_xpm_d does change the mask argument. If after
BGD> the call I reset mask to 0 then the application runs, but it looks as
BGD> though no mask is created for the bitmap. I'm not sure why this
BGD> prevents the gdk error from occurring, but I thought it might be useful
BGD> for you or someone who knows more about gdk than I do.

If gdk_pixmap_create_from_xpm_d() returns an invalid mask it would be a
bug in this function and while I don't really believe it, it could be
interesting to check if the crash still happens with the latest GTK+
versions (or at least if you can find any reference to any related bug
fixes in GTK+ change log). OTOH if it returns a valid bitmap and then it
results in an X error when it is used, this would mean that we somehow
corrupt it ourselves. But, again, I don't really see how would this
happen...

Vadim Zeitlin

unread,
Apr 8, 2008, 5:06:50 PM4/8/08
to
On Tue, 08 Apr 2008 11:17:03 -0600 "Bond, Gary D" <gary....@lmco.com> wrote:

BGD> To generate the backtrace given in the earlier email I did use sync when
BGD> I ran the executable in the debugger (dbx).

Just to make sure, I didn't mean any dbx command but command-line option
with this name, i.e. you should run "./minimal --sync".

0 new messages