gmic_gimp_qt: fatal error: Segmentation fault

That’s interesting, thanks. Will check.

Update : I’ve currently compiled G’MIC with the address sanitizer and I get indeed a few issues.
I’ll try to fix those ASAP and make you know when it’s ready.
This will probably lead to a 2.9.4 release…

Thanks for your report!

1 Like

I’ve made two fixes related to possible wron memory access.
Would you like to test on your machine ?
Basically, you have to modify file gmic.cpp, with the following commits:

and

That’s minor modifications that you can apply on the sources, then you have to recompile everything, and test once again.
Thanks for your help !

I’d love to try it but I’m not finding gmic.cpp in my sources.

I went to the gmic-master source tree in the git links you sent and modified the code as suggested, but then the commands you gave to build it do not work.

Sorry but it seems I need some hand-holding, as I don’t understand how to build it.

I’ll prepare an up-to-date pre-release archive and post it in a few minutes (half an hour).
It will be easier to make the test. I’ll let you know when it’s ready!

Thank you!

Here is the link : https://gmic.eu/files/prerelease/gmic_2.9.4_pre201123.tar.gz

Just untar.gz it, go the gmic/gmic-qt then qmake and make, and it should compile the plug-in for GIMP.

EDIT: I’m 90% sure the problem will be fixed :slight_smile:

Thanks.

I built and installed as instructed, but gimp does not show the plugin is installed. Do I need to manually copy files to the gimp folder?

Yes, you have to copy gmic_gimp_qt in the GIMP plug-in folder, indeed.

Well I figured this must be the case and copied gmic_gimp_qt to my plugin folder and gave it a go.

gmic_gimp_qt:419520): Gtk-WARNING **: 15:35:09.070: Theme parsing error: gtk.css:4:1: '/*' in comment block
/home/akovia/.config/GIMP/2.10/plug-ins/gmic_gimp_qt: fatal error: Segmentation fault
Terminating plug-in: '/home/akovia/.config/GIMP/2.10/plug-ins/gmic_gimp_qt'
GIMP-Error: Plug-in crashed: "gmic_gimp_qt"
(/home/akovia/.config/GIMP/2.10/plug-ins/gmic_gimp_qt)

The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side.

Haa bad news.
So, could you do the same procedure as before, compiling it with the fsanitize=address enabled ?
Also, please check that GIMP actually takes the latest binary of the plug-in, sometimes there are duplicates and it’s not always easy to find which binary it loads.

I’ve another idea, anyway.
Will check.

I think I get it now.
Could you please replace the gmic.cpp file in the latest .tar.gz file you downloaded, by this version: https://raw.githubusercontent.com/dtschump/gmic/develop/src/gmic.cpp

I’m confident this time :slight_smile:

I think I was chasing my tail for a while. Should I have tried to make clean between builds?

Anyway, I just deleted the entire build directory and tried again with the new gmic.cpp. Here’s what happened.

(gmic_gimp_qt~:442422): Gtk-WARNING **: 16:32:19.546: Theme parsing error: gtk.css:4:1: '/*' in comment block
/home/akovia/.config/GIMP/2.10/plug-ins/gmic_gimp_qt~: fatal error: Segmentation fault
Terminating plug-in: '/home/akovia/.config/GIMP/2.10/plug-ins/gmic_gimp_qt~'
GIMP-Error: Plug-in crashed: "gmic_gimp_qt~"
(/home/akovia/.config/GIMP/2.10/plug-ins/gmic_gimp_qt~)

The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side.

I’m pretty sure I’ve fixed the first issue you got.
It was related to a null pointer, used for a string comparison.

Maybe there are another problem going on.
Again, if you succeed in compiling the stand-alone G’MIC-Qt application, with fsanitize=address enabled, and copy/paste the error log you get from the console, I’ll be able to better understand where the problem comes from, and hopefully fix it.
I’m still a bit surprised about the fact it doesn’t work, but of course, it’s hard to test on all different architectures and compiler versions, so these things may happen from time to time.

Not sure what happened but it’s working now.

Wanted to let you know ASAP so you weren’t going through more code. I’ll test and report

Thanks!

1 Like

Replied at the same time it seems. I’ll put it through it’s paces now.

Can’t thank you enough!

I’m going to sleep now, please let me know if everything looks fine after your tests.
If so, I’ll be able to release new version 2.9.4 with the fixes.

Thanks a lot for the efforts you’ve made and the time you spent on this. It definitely helped improving the G’MIC source code.

I ran it through a long session without any troubles at all. It seems thoroughly fixed.

Thanks again for all your hard work. I would really be lost without this plugin.

Donation OTW.

Good morning, and good to know ! :slight_smile:
I’ve started building the 2.9.4 package of G’MIC. Hopefully it should be ready in a few hours.
Thanks again for your help.