Forum: Ruby-Gnome 2 BUG segfault in Gdk::Pixbuf

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4913bcb685792f601ae9813b4713abb9?d=identicon&s=25 Detlef Reichl (Guest)
on 2009-04-22 22:38
(Received via mailing list)
Hi,

sometimes

    pixbuf = Gdk::Pixbuf.new path_to_my_svg, size

segfaults. The code in my special case is:

   icon_size = *Gtk::IconSize.lookup (Gtk::IconSize::SMALL_TOOLBAR)
   pixbuf = Gdk::Pixbuf.new PIXMAP_PATH + '/' + item +'.svg', icon_size

I know, that the code is wrong, but it should not lead to a segmentation
fault.

Here is the GDB backtrace:

(gdb) bt
#0  0x0e75f09c in initialize (argc=<value optimized out>, argv=<value
optimized out>, self=1211822976) at rbgdk-pixbuf.c:222
#1  0x0ff11134 in call_cfunc (func=0xe75eb00 <initialize>,
recv=1211822976, len=<value optimized out>, argc=<value optimized out>,
argv=<value optimized out>) at eval.c:5749
#2  0x0ff1d398 in rb_call0 (klass=1210540680, recv=1211822976, id=2961,
oid=2961, argc=2, argv=0xbfe19000, body=0x483d6440, flags=2) at
eval.c:5904
#3  0x0ff1d514 in rb_call (klass=1210540680, recv=1211822976, mid=2961,
argc=2, argv=0xbfe19000, scope=1, self=6) at eval.c:6151
#4  0x0ff1e1c8 in rb_obj_call_init (obj=1211822976, argc=2,
argv=0xbfe19000) at eval.c:7770
#5  0x0ff5468c in rb_class_new_instance (argc=2, argv=0xbfe19000,
klass=<value optimized out>) at object.c:1644
#6  0x0ff11134 in call_cfunc (func=0xff54640 <rb_class_new_instance>,
recv=1210540680, len=<value optimized out>, argc=<value optimized out>,
argv=<value optimized out>)
    at eval.c:5749
#7  0x0ff1d398 in rb_call0 (klass=1208400192, recv=1210540680, id=3361,
oid=3361, argc=2, argv=0xbfe19000, body=0x4806a308, flags=0) at
eval.c:5904
#8  0x0ff1d514 in rb_call (klass=1208400192, recv=1210540680, mid=3361,
argc=2, argv=0xbfe19000, scope=0, self=1211828352) at eval.c:6151
#9  0x0ff17d34 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3492
#10 0x0ff19318 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3687
#11 0x0ff19118 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:2961
#12 0x0ff1bb6c in rb_yield_0 (val=1211824008, self=1211828352,
klass=<value optimized out>, flags=0, avalue=0) at eval.c:5077
#13 0x0fef1184 in rb_ary_each (ary=1211824032) at array.c:1261
#14 0x0ff11110 in call_cfunc (func=0xfef1120 <rb_ary_each>,
recv=1211824032, len=<value optimized out>, argc=<value optimized out>,
argv=<value optimized out>) at eval.c:5752
#15 0x0ff1d398 in rb_call0 (klass=1208361144, recv=1211824032, id=4001,
oid=4001, argc=0, argv=0x0, body=0x48061bc0, flags=0) at eval.c:5904
#16 0x0ff1d514 in rb_call (klass=1208361144, recv=1211824032, mid=4001,
argc=0, argv=0x0, scope=0, self=1211828352) at eval.c:6151
#17 0x0ff17d34 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3492
#18 0x0ff1aef0 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3222
#19 0x0ff1d24c in rb_call0 (klass=1211945712, recv=1211828352, id=88897,
oid=88897, argc=4, argv=0xbfe25a20, body=0x483cf2a0, flags=<value
optimized out>) at eval.c:6055
#20 0x0ff1d514 in rb_call (klass=1211945712, recv=1211828352, mid=88897,
argc=4, argv=0xbfe25a20, scope=1, self=1211828352) at eval.c:6151
#21 0x0ff17e44 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3507
#22 0x0ff1d24c in rb_call0 (klass=1211945712, recv=1211828352, id=88761,
oid=88761, argc=0, argv=0x0, body=0x483d0638, flags=<value optimized
out>) at eval.c:6055
#23 0x0ff1d514 in rb_call (klass=1211945712, recv=1211828352, mid=88761,
argc=0, argv=0x0, scope=2, self=1211828352) at eval.c:6151
#24 0x0ff17e80 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3513
#25 0x0ff1d24c in rb_call0 (klass=1211945712, recv=1211828352, id=88729,
oid=88729, argc=0, argv=0x0, body=0x483d24f8, flags=<value optimized
out>) at eval.c:6055
#26 0x0ff1d514 in rb_call (klass=1211945712, recv=1211828352, mid=88729,
argc=0, argv=0x0, scope=2, self=1211828352) at eval.c:6151
#27 0x0ff17e80 in rb_eval (self=1211828352, n=<value optimized out>) at
eval.c:3513
#28 0x0ff1d24c in rb_call0 (klass=1211945712, recv=1211828352, id=2961,
oid=2961, argc=0, argv=0x0, body=0x483d2900, flags=<value optimized
out>) at eval.c:6055
#29 0x0ff1d514 in rb_call (klass=1211945712, recv=1211828352, mid=2961,
argc=0, argv=0x0, scope=1, self=6) at eval.c:6151
#30 0x0ff1e1c8 in rb_obj_call_init (obj=1211828352, argc=0, argv=0x0) at
eval.c:7770
#31 0x0ff5468c in rb_class_new_instance (argc=0, argv=0x0, klass=<value
optimized out>) at object.c:1644
#32 0x0ff11134 in call_cfunc (func=0xff54640 <rb_class_new_instance>,
recv=1211945712, len=<value optimized out>, argc=<value optimized out>,
argv=<value optimized out>)
    at eval.c:5749
#33 0x0ff1d398 in rb_call0 (klass=1208400192, recv=1211945712, id=3361,
oid=3361, argc=0, argv=0x0, body=0x4806a308, flags=0) at eval.c:5904
#34 0x0ff1d514 in rb_call (klass=1208400192, recv=1211945712, mid=3361,
argc=0, argv=0x0, scope=0, self=1208394144) at eval.c:6151
#35 0x0ff17d34 in rb_eval (self=1208394144, n=<value optimized out>) at
eval.c:3492
#36 0x0ff192b4 in rb_eval (self=1208394144, n=<value optimized out>) at
eval.c:3677
#37 0x0ff2ae04 in ruby_exec_internal () at eval.c:1641
#38 0x0ff2ae6c in ruby_exec () at eval.c:1661
#39 0x0ff2aebc in ruby_run () at eval.c:1671
#40 0x10001afc in main (argc=2, argv=0xbfe336e4, envp=<value optimized
out>) at main.c:48


Cheers, detlef
--
http://det.cable.nu
C838db9af1d90a87a828ecad8556b804?d=identicon&s=25 Guillaume Cottenceau (Guest)
on 2009-04-23 12:05
(Received via mailing list)
On Wed, Apr 22, 2009 at 10:41 PM, Detlef Reichl <detlef.reichl@gmx.org>
wrote:
>
> I know, that the code is wrong, but it should not lead to a segmentation fault.

You may try in C with the same SVGs? It might be a bug related to
specific/broken SVG content in the underlying libraries..

--
Guillaume Cottenceau - http://zarb.org/~gc/
This topic is locked and can not be replied to.