# BUG segfault in Gdk::Pixbuf

**URL:** <https://www.ruby-forum.com/t/bug-segfault-in-gdk-pixbuf/166220>\
**Category:** Ruby-Gnome 2\
**Created:** [April 22, 2009, 10:38pm UTC](https://www.ruby-forum.com/t/bug-segfault-in-gdk-pixbuf/166220 "2009-04-22T22:38:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 22, 2009, 10:38pm UTC](https://www.ruby-forum.com/t/bug-segfault-in-gdk-pixbuf/166220/1 "2009-04-22T22:38:54Z")

</div>

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=, argv=, self=1211822976) at rbgdk-pixbuf.c:222  
#1 0x0ff11134 in call\_cfunc (func=0xe75eb00 ,  
recv=1211822976, len=, argc=,  
argv=) 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=) at object.c:1644  
#6 0x0ff11134 in call\_cfunc (func=0xff54640 \<rb\_class\_new\_instance\>,  
recv=1210540680, len=, argc=,  
argv=)  
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=) at  
eval.c:3492  
#10 0x0ff19318 in rb\_eval (self=1211828352, n=) at  
eval.c:3687  
#11 0x0ff19118 in rb\_eval (self=1211828352, n=) at  
eval.c:2961  
#12 0x0ff1bb6c in rb\_yield\_0 (val=1211824008, self=1211828352,  
klass=, 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=, argc=,  
argv=) 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=) at  
eval.c:3492  
#18 0x0ff1aef0 in rb\_eval (self=1211828352, n=) at  
eval.c:3222  
#19 0x0ff1d24c in rb\_call0 (klass=1211945712, recv=1211828352, id=88897,  
oid=88897, argc=4, argv=0xbfe25a20, body=0x483cf2a0, flags=) 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=) at  
eval.c:3507  
#22 0x0ff1d24c in rb\_call0 (klass=1211945712, recv=1211828352, id=88761,  
oid=88761, argc=0, argv=0x0, body=0x483d0638, flags=) 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=) at  
eval.c:3513  
#25 0x0ff1d24c in rb\_call0 (klass=1211945712, recv=1211828352, id=88729,  
oid=88729, argc=0, argv=0x0, body=0x483d24f8, flags=) 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=) at  
eval.c:3513  
#28 0x0ff1d24c in rb\_call0 (klass=1211945712, recv=1211828352, id=2961,  
oid=2961, argc=0, argv=0x0, body=0x483d2900, flags=) 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=) at object.c:1644  
#32 0x0ff11134 in call\_cfunc (func=0xff54640 \<rb\_class\_new\_instance\>,  
recv=1211945712, len=, argc=,  
argv=)  
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=) at  
eval.c:3492  
#36 0x0ff192b4 in rb\_eval (self=1208394144, n=) 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=) at main.c:48

## Cheers, detlef

[http://det.cable.nu](http://det.cable.nu)

---

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 23, 2009, 12:05pm UTC](https://www.ruby-forum.com/t/bug-segfault-in-gdk-pixbuf/166220/2 "2009-04-23T12:05:58Z")

</div>

On Wed, Apr 22, 2009 at 10:41 PM, Detlef R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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 C. - [Guillaume Cottenceau](http://zarb.org/~gc/)
