From: Amadeus WM <ama...@ve...> - 2019-07-28 16:58:08
|
I've been using tuxmath under (Fedora) Linux and tuxmath crashes now. This has been going on for some time now, so in the absence of an official fix, I looked into the problem myself. I've traced it to this: In t4k_loaders.c, load_svg_sprite() calls rsvg_handle_get_desc() on line 217 or so, which has been deprecated as of gnome 2.36. In my version of librsvg/rsvg-handle.c, it says that librsvg does not read the metadata/desc/title elements. See details and backtraces below. I've never used rsvg and I don't know its API, so I cannot fix tuxmath beyond this point. Any chance you guys can provide a fix? I hope the gnome changes do not require a complete rework. Thanks! (gdb) bt #0 0x00007f6260d71b17 in __rawmemchr_avx2 () at ../sysdeps/x86_64/multiarch/memchr-avx2.S:65 #1 0x00007f6260c95836 in _IO_str_init_static_internal (sf=sf@entry=0x7ffe36344890, ptr=ptr@entry=0x0, size=size@entry=0, pstart=pstart@entry=0x0) at strops.c:41 #2 0x00007f6260c88741 in _IO_vsscanf (string=0x0, format=0x7f6260e3cfc2 "%d", args=args@entry=0x7ffe363449c0) at iovsscanf.c:40 #3 0x00007f6260c82d08 in __sscanf (s=<optimized out>, format=format@entry=0x7f6260e3cfc2 "%d") at sscanf.c:32 #4 0x00007f6260e333ed in load_svg_sprite (file_name=<optimized out>, width=width@entry=-1, height=height@entry=-1) at t4k_loaders.c:217 #5 0x00007f6260e3455f in load_sprite (name=name@entry=0x430421 "comets/comet", mode=mode@entry=4, w=w@entry=-1, h=h@entry=-1, proportional=proportional@entry=false) at t4k_loaders.c:714 #6 0x00007f6260e349bc in T4K_LoadScaledSprite (name=name@entry=0x430421 "comets/comet", mode=mode@entry=4, width=width@entry=-1, height=height@entry=-1) at t4k_loaders.c:651 #7 0x00007f6260e349d0 in T4K_LoadSprite (name=name@entry=0x430421 "comets/comet", mode=mode@entry=4) at t4k_loaders.c:646 #8 0x000000000041741c in load_image_data () at fileops_media.c:213 #9 0x0000000000405790 in load_data_files () at setup.c:759 #10 0x00000000004064b3 in setup (argc=1, argv=0x7ffe363458b8) at setup.c:139 #11 0x0000000000404b89 in main (argc=<optimized out>, argv=<optimized out>) at tuxmath.c:40 Core due to sscanf being called with NULL string pointer. 94 sprite* load_svg_sprite(const char* file_name, int width, int height) 195 { 196 RsvgHandle* file_handle; 197 sprite* new_sprite; <snip> 214 new_sprite->default_img = render_svg_from_handle(file_handle, width, height, "#default"); 215 216 /* get number of frames from description */ 217 sscanf(rsvg_handle_get_desc(file_handle), "%d", &new_sprite->num_frames); /** * rsvg_handle_get_desc: * @handle: An #RsvgHandle * * Returns: (nullable): This function always returns NULL. * * Since: 2.4 * * Deprecated: 2.36. Librsvg does not read the metadata/desc/title elements; * this function always returns #NULL. */ const char * rsvg_handle_get_desc (RsvgHandle *handle) { g_return_val_if_fail (handle, NULL); return NULL; } |