Building with jemalloc causes segmentation fault on startup
Steps to reproduce:
- debug build latest git version of inkscape with jemalloc enabled:
WITH_ASAN:BOOL=OFF
WITH_DBUS:BOOL=ON
WITH_FUZZ:BOOL=OFF
WITH_GRAPHICS_MAGICK:BOOL=ON
WITH_IMAGE_MAGICK:BOOL=ON
WITH_JEMALLOC:BOOL=ON
WITH_LIBCDR:BOOL=ON
WITH_LIBVISIO:BOOL=ON
WITH_LIBWPG:BOOL=ON
WITH_LPETOOL:BOOL=OFF
WITH_NLS:BOOL=ON
WITH_OPENMP:BOOL=ON
WITH_PROFILING:BOOL=OFF
WITH_SVG2:BOOL=ON
WITH_FUZZ-ADVANCED:INTERNAL=1
What happened?
Starting inkscape without parameters segfaults on startup without ever showing a gui. Running "inkscape somefile.gif" shows the small window for selecting mbed/link etc. and when I click "Ok" it crashes (IIRC with the same error).
Two backtraces:
Every time I try it creates the directory ~/.config/inkscape with subdirectories and preferences file, so I deleted that before each try.
I did a git bisect to find the commit introducing the bug:
git bisect start
# good: [0435dcd7c3fd5f4ee19e91fca2162b9d68687dc5] operators should return by value
git bisect good 0435dcd7c3fd5f4ee19e91fca2162b9d68687dc5
# bad: [633d3bce67822eae41b8e10e5b1cd829952390a7] Update extensions in master branch to latest version
git bisect bad 633d3bce67822eae41b8e10e5b1cd829952390a7
# good: [45e39264e590abc05b78d18d373ac83c47b3cfab] Update code documentation (minor)
git bisect good 45e39264e590abc05b78d18d373ac83c47b3cfab
# bad: [906b4597f076080a4792c040c9b4fc5406011544] Fix double quotes
git bisect bad 906b4597f076080a4792c040c9b4fc5406011544
# bad: [c77532d0acf37d0e1d9ebc46f1bc0a05ffca01e8] Don't hard-code relative RPATH
git bisect bad c77532d0acf37d0e1d9ebc46f1bc0a05ffca01e8
# bad: [a5388afb52e341f89bb6f0efdd803281ed940a09] Fix debugging code and minor code clean-up.
git bisect bad a5388afb52e341f89bb6f0efdd803281ed940a09
# bad: [41b54024714071fd97dbadd4a900017544620fae] fix #521 SPIString copy constructor
git bisect bad 41b54024714071fd97dbadd4a900017544620fae
# good: [850b10c27549ff2e8b993fcd312b554f359d87a7] Translated pl.po for Polish, 86% complete. Tested on Inkscape 1.0 beta1
git bisect good 850b10c27549ff2e8b993fcd312b554f359d87a7
# bad: [6acb5933067c98c1b3a6bce5b27596f4536762c6] fix PNG export dialog crash (heap-use-after-free)
git bisect bad 6acb5933067c98c1b3a6bce5b27596f4536762c6
# good: [fe46abed4a3f93c83efde830af7e60f28f54443a] Fix build
git bisect good fe46abed4a3f93c83efde830af7e60f28f54443a
# first bad commit: [6acb5933067c98c1b3a6bce5b27596f4536762c6] fix PNG export dialog crash (heap-use-after-free)
After doing the bisect I couldn't reproduce it with 6acb5933 so I manually selected commits for testing.
I could reproduce it with 41b54024 and 07da321d
After reproducing with 41b54024 and 07da321d I could reproduce it again with 6acb5933.
Perhaps it depends on some files being installed (or not installed) or the build is not working like it should.
Later I found out that I can only reproduce it when I compile with jemalloc on.
What should have happened?
No segmentation fault.