Menu

#89 Curious crash

v1.0_(example)
open
nobody
bitmap (1)
1
2025-04-28
2025-04-25
No

Hi,
here is a problem I have using more than one time an image object:

public cHex_white:="", cVal_white:="", oObj_white:=""

// --------- white.png ----------------
cHex_white := ;
"89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 " + ;
"00 00 00 18 00 00 00 18 08 06 00 00 00 E0 77 3D " + ;
"F8 00 00 00 01 73 52 47 42 00 AE CE 1C E9 00 00 " + ;
"00 06 62 4B 47 44 00 00 00 00 00 00 F9 43 BB 7F " + ;
"00 00 00 09 70 48 59 73 00 00 0B 13 00 00 0B 13 " + ;
"01 00 9A 9C 18 00 00 00 07 74 49 4D 45 07 E3 03 " + ;
"15 10 20 18 E6 AD 01 75 00 00 00 19 74 45 58 74 " + ;
"43 6F 6D 6D 65 6E 74 00 43 72 65 61 74 65 64 20 " + ;
"77 69 74 68 20 47 49 4D 50 57 81 0E 17 00 00 00 " + ;
"28 49 44 41 54 48 C7 63 BC 73 E7 CE 7F 06 1A 02 " + ;
"26 06 1A 83 51 0B 46 2D 18 B5 60 D4 82 51 0B 46 " + ;
"2D 18 B5 60 D4 02 EA 00 00 5C EB 03 C3 EE 39 63 " + ;
"E5 00 00 00 00 49 45 4E 44 AE 42 60 82 "

cVal_white := hwg_cHex2Bin(cHex_white)

oObj_white := HBitmap():AddString( "white" , cVal_white )

@ hbloc+27,vbloc+27 OWNERBUTTON oAa OF oGrille SIZE 24, 24 ;
BITMAP oobj_white FLAT ID 1101
hbloc+=27
@ hbloc+27,vbloc+27 OWNERBUTTON oAb OF oGrille SIZE 24, 24 ;
BITMAP oobj_white FLAT ID 1102
hbloc+=27
@ hbloc+27,vbloc+27 OWNERBUTTON oAc OF oGrille SIZE 24, 24;
BITMAP cImageDir+"white.png" FLAT ID 1103

If I use 'cImageDir+"white.png"' more than one time (about 200) in the same function => it works
If I replace it with 'oobj_white' only one time, it works
If I replace it more than one time, it crashes :

(ClipWord3:4908): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height:
                     assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(ClipWord3:4908): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width:
                     assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(ClipWord3:4908): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height:
                     assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(ClipWord3:4908): GdkPixbuf-CRITICAL **:                
                      gdk_pixbuf_get_pixels_with_length:
                      assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(ClipWord3:4908): GdkPixbuf-CRITICAL **:
                      gdk_pixbuf_get_rowstride:
                      assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(ClipWord3:4908): GdkPixbuf-CRITICAL **:
                     gdk_pixbuf_get_n_channels:
                     assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(ClipWord3:4908): GLib-ERROR **:
   /build/glib2.0-WyCRmE/glib2.0-2.48.2/./glib/gmem.c:328:
   overflow allocating 18446744073709551615*18446744073709551615 bytes
  ./script : ligne 3 :
   4908 Trappe pour point d'arrêt et de trace ./ClipWord3

Where do I fail ?

Thanks
A+

Discussion

  • Wilfried Brunken

    Hello Alain,
    based on your sample code in the post to ticket i
    created a complete sample program.
    It does not crash and the no GTK message appear.
    More comments in test program.

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2025-04-28

    Humm ...

    Where is the test program ? in a new revision ?
    A+

     
  • Wilfried Brunken

    Hello Alain,
    i created a new directory
    test/tickets
    for handling test programs for ticket support.
    Here you find the sample
    Sticket89.prg
    with hbp and image files in "image".

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.