After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 552681 - Negative pixmap widths with vertical notebook tabs on win32
Negative pixmap widths with vertical notebook tabs on win32
Status: RESOLVED DUPLICATE of bug 650300
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.14.x
Other Windows
: Normal critical
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-09-17 18:31 UTC by Philip Withnall
Modified: 2011-10-21 07:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small program reproducing the crash. (2.66 KB, application/octet-stream)
2009-04-03 18:55 UTC, David Fifield
Details

Description Philip Withnall 2008-09-17 18:31:14 UTC
With GTK+ 2.14.1 installed from gtk-win.sourceforge.net, my program (compiled with mingw32 for win32) gives two warnings on Windows XP 32-bit:

Gdk-WARNING **: gdkpixmap-win32.c:302: CreateDIBSection failed: The operation completed successfully.

Gdk-WARNING **: gdkpixmap-win32.c:114: DeleteObject failed: The operation completed successfully.

The first warning has this stack trace:

(gdb) bt

  • #0 g_logv
  • #1 g_log
  • #2 _gdk_win32_api_failed
  • #3 gdk_pixmap_new
  • #4 draw_extension
  • #5 gtk_notebook_draw_tab
  • #6 gtk_notebook_expose
  • #7 _gtk_marshal_BOOLEAN__BOXED
  • #8 g_closure_invoke
  • #9 signal_emit_unlocked_R
  • #10 ??
  • #11 ??
  • #12 ??
  • #13 ??
  • #14 ??
  • #15 ??
  • #16 gtk_border_copy
  • #17 gtk_marshal_VOID__UINT_STRING

   from C:\Program Files\GTK2-Runtime\lib\libgtk-win32-2.0-0.dll

Cannot access memory at address 0x4000800a

It then crashes with the following assertion failure:

Gdk:ERROR:gdkgc-win32.c:768:get_impl_drawable: code should not be reached

GtkNotebooks in (for example) gtk-demo run fine, and my application will display notebooks properly if the UI file is cut down a bit, but not this notebook (even if all its tabs' content is just replaced with one tab with a label in it).
Comment 1 Philip Withnall 2008-10-20 17:01:45 UTC
Running the program with "--gdk-debug pixmaps", the following log appears:

gdk_pixmap_new: 1x1x24 drawable=00C19010

... =5E050C49 bits=00D50000 pixmap=00C12BC0

gdk_pixmap_new: 61x17x24 drawable=00CCC1A0

... =06050D51 bits=00E70000 pixmap=00C12710

gdk_pixmap_impl_win32_finalize: 06050D51

gdk_pixmap_new: 12x21x24 drawable=00CCC200

... =07050D51 bits=00E70000 pixmap=00C12E90

gdk_pixmap_impl_win32_finalize: 07050D51

gdk_pixmap_new: 57x17x24 drawable=00CCC320

... =08050D51 bits=00E70000 pixmap=00C12D58

gdk_pixmap_impl_win32_finalize: 08050D51

gdk_pixmap_new: 12x21x24 drawable=00CCC380

... =09050D51 bits=00E70000 pixmap=00C88108

gdk_pixmap_impl_win32_finalize: 09050D51

gdk_pixmap_new: 120x17x24 drawable=00CCC440

... =0A050D51 bits=00E70000 pixmap=00C88180

gdk_pixmap_impl_win32_finalize: 0A050D51

gdk_pixmap_new: 762x19x24 drawable=00C19850

... =0B050D51 bits=00E70000 pixmap=00C881E0

gdk_pixmap_impl_win32_finalize: 0B050D51

gdk_pixmap_new: 65x21x24 drawable=00CCC140

... =0C050D51 bits=00E70000 pixmap=00C882B8

gdk_pixmap_impl_win32_finalize: 0C050D51

gdk_pixmap_new: 61x21x24 drawable=00CCC2C0

... =0D050D51 bits=00E70000 pixmap=00C882B8

gdk_pixmap_impl_win32_finalize: 0D050D51

gdk_pixmap_new: 124x21x24 drawable=00CCC3E0

... =0E050D51 bits=00E70000 pixmap=00C881E0

gdk_pixmap_impl_win32_finalize: 0E050D51

gdk_pixmap_new: 762x626x24 drawable=00C198B0

... =0F050D51 bits=00E70000 pixmap=00C88180

gdk_pixmap_new: 1536x64x24 drawable=00C19010

... =0A050D54 bits=01050000 pixmap=00C88450

gdk_pixmap_new: -337x45x24 drawable=00C198B0

... =00000000 bits=00000000 pixmap=00C120E0



(mcus.exe:3992): Gdk-WARNING **: gdkpixmap-win32.c:302: CreateDIBSection

 The operation completed successfully.

gdk_pixmap_impl_win32_finalize: 00000000



(mcus.exe:3992): Gdk-WARNING **: gdkpixmap-win32.c:114: DeleteObject fail

 operation completed successfully.

**

Gdk:ERROR:gdkgc-win32.c:748:get_impl_drawable: code should not be reached

Looks like the operation's failing due to a negative width for the pixmap. Perhaps a g_return_val_if_fail should be added to catch this case?

In any case, I believe the GDI error code thrown by CreateDIBSection is getting overwritten by either the call to SelectPalette or ReleaseDC, which should be fixed.
Comment 2 Philip Withnall 2008-10-20 19:12:26 UTC
After some prodding, it appears this is caused by me having a GtkNotebook with tab-pos = GTK_POS_LEFT, which messes up the pixbuf dimensions somehow. Leaving the property as the default prevents the crash.
Comment 3 Philip Withnall 2008-10-20 19:18:16 UTC
s/pixbuf/pixmap/, sorry
Comment 4 David Fifield 2009-04-03 18:55:25 UTC
Created attachment 132023 [details]
Small program reproducing the crash.

This program creates a GtkNotebook with tabs on the left and packs it in a way that causes a crash: inside a GtkExpander, inside a VBox with one other widget. The crash only happens on Windows with the MS-Windows theme, not the default theme. Variations that also crash are noted in the comments. This was tested with MinGW GCC 3.4.5 and GTK+ 2.16.0 from the all-in-one bundle on Windows XP SP3.
Comment 5 David Fifield 2009-04-03 19:03:28 UTC
Here is some background on attachment id 132023. I'm a developer on the Nmap Security Scanner. One of our users reported a crash of our GUI, which uses PyGTK, under Windows. It seems to have the same underlying cause as this bug, as it crashes with the same "get_impl_drawable: code should not be reached" message.

http://seclists.org/nmap-dev/2009/q2/0010.html

The crash only happens on Windows with the MS-Windows theme. Conditions sufficient to cause it are: tab position set to GTK_POS_LEFT or GTK_POS_RIGHT,
packed in a GtkFrame or GtkExpander, which is packed in a VBox with at least
one other widget. The complete error output I get is

(gtk-crash.exe:2184): Gdk-WARNING **: gdkpixmap-win32.c:302: CreateDIBSection failed: Not enough storage is available to process this command.

(gtk-crash.exe:2184): Gdk-WARNING **: gdkpixmap-win32.c:114: DeleteObject failed: The system could not find the environment option that was entered.
**
Gdk:ERROR:gdkgc-win32.c:748:get_impl_drawable: code should not be reached

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Comment 6 Geert Janssens 2011-06-11 10:31:47 UTC
(In reply to comment #5)
> The crash only happens on Windows with the MS-Windows theme. Conditions
> sufficient to cause it are: tab position set to GTK_POS_LEFT or GTK_POS_RIGHT,
> packed in a GtkFrame or GtkExpander, which is packed in a VBox with at least
> one other widget.

This is very interesting. GnuCash also has an open bug (bug 614636) for the exact same problem. I wasn't aware that this only happened with the Ms-Windows theme. I verified and indeed, using another theme fixes the crash.

This bug still exists in 2.24 by the way.
Comment 7 Dieter Verfaillie 2011-10-21 07:15:49 UTC

*** This bug has been marked as a duplicate of bug 650300 ***