kwo pushed a commit to branch master. http://git.enlightenment.org/legacy/imlib2.git/commit/?id=ffbd8bbca06f5ea608b8f78e73148515adfa8ecd
commit ffbd8bbca06f5ea608b8f78e73148515adfa8ecd Author: Kim Woelders <[email protected]> Date: Sat Jan 8 08:06:38 2022 +0100 SVG loader: Avoid problems when loading the module more than once It appears that the svg loader fails when dlopen'ed a second time, presumably due to some issue in librsvg2: thread '<unnamed>' panicked at 'Type RsvgHandle has already been registered', /builddir/build/BUILD/librsvg-2.52.4/vendor/glib/src/subclass/types.rs:751:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5 A second load of a loader will only happen if an application calls imlib_flush_loaders(), which I don't see why regular applications would need to do. However, calling imlib_flush_loaders() shouldn't cause applications to potentially fail (abort) anyway. The failure can be avoided by dlopen'ing with RTLD_NODELETE, but that would apply to all loaders, which doesn't seem right. With the solution here the svg.so module is marked to be un-unloadable which seems to solve the problem and doesn't affect other modules. --- src/modules/loaders/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/loaders/Makefile.am b/src/modules/loaders/Makefile.am index d7fea3a..04a388b 100644 --- a/src/modules/loaders/Makefile.am +++ b/src/modules/loaders/Makefile.am @@ -98,7 +98,7 @@ pnm_la_LIBTOOLFLAGS = --tag=disable-static svg_la_SOURCES = loader_svg.c svg_la_CPPFLAGS = $(SVG_CFLAGS) $(AM_CPPFLAGS) -svg_la_LDFLAGS = -module -avoid-version +svg_la_LDFLAGS = -module -avoid-version -Wl,-z,nodelete svg_la_LIBADD = $(SVG_LIBS) $(top_builddir)/src/lib/libImlib2.la svg_la_LIBTOOLFLAGS = --tag=disable-static --
