Skip to content

Add missing includes to fix crash with libxml2 2.12

Jürg Billeter requested to merge juergbi/rhythmbox:libxml2-2.12 into master

The missing include resulted in an implicit function declaration, which may result in a segmentation fault on startup.

../shell/rb-playlist-manager.c: In function ‘rb_playlist_manager_load_playlists’:
../shell/rb-playlist-manager.c:374:23: warning: implicit declaration of function ‘xmlParseMemory’ [-Wimplicit-function-declaration]
  374 |                 doc = xmlParseMemory (g_bytes_get_data (data, NULL), g_bytes_get_size (data));
      |                       ^~~~~~~~~~~~~~
../shell/rb-playlist-manager.c:374:23: warning: nested extern declaration of ‘xmlParseMemory’ [-Wnested-externs]
../shell/rb-playlist-manager.c:374:21: warning: assignment to ‘xmlDocPtr’ {aka ‘struct _xmlDoc *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  374 |                 doc = xmlParseMemory (g_bytes_get_data (data, NULL), g_bytes_get_size (data));
      |                     ^
Thread 1 "rhythmbox" received signal SIGSEGV, Segmentation fault.
0x00007ffff65957c5 in xmlDocGetRootElement () from /usr/lib/libxml2.so.2
(gdb) bt
#0  0x00007ffff65957c5 in xmlDocGetRootElement () at /usr/lib/libxml2.so.2
#1  0x00007ffff7e4a172 in rb_playlist_manager_load_playlists (mgr=0x555555917380) at ../shell/rb-playlist-manager.c:380
#2  0x00007ffff7e58ce3 in idle_handle_load_complete (shell=0x5555558ddf20) at ../shell/rb-shell.c:2476
#3  0x00007ffff7cfaec9 in g_main_dispatch () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff7cfe550 in g_main_context_iterate_unlocked.isra () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7cfecfc in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#6  0x00007ffff6efb87d in g_application_run () at /usr/lib/libgio-2.0.so.0
#7  0x00007ffff7e3fab4 in rb_application_run (app=0x555555582570, argc=1, argv=0x7fffffffe668)
    at ../shell/rb-application.c:590
#8  0x0000555555555352 in main (argc=1, argv=0x7fffffffe668) at ../shell/main.c:79

Merge request reports