Running the latest geany from Ubuntu 2404: geany 2.0-1build2 geany-common 2.0-1build2 geany-plugins 2.0-4ubuntu5
Selecting a C file function name and then Tools/Documentation Generator/Document Current Symbol
results in a crash.
Running from gdb gives:
`Starting program: /usr/bin/geany ` `[Thread debugging using libthread_db enabled]` `Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".` `[New Thread 0x7ffff2c006c0 (LWP 242811)]` `[New Thread 0x7ffff22006c0 (LWP 242812)]` `[New Thread 0x7ffff18006c0 (LWP 242813)]` `[New Thread 0x7ffff0e006c0 (LWP 242814)]` `[New Thread 0x7fffeb8006c0 (LWP 242815)]` `[New Thread 0x7fffeae006c0 (LWP 242816)]` `[New Thread 0x7fffea4006c0 (LWP 242817)]` `[Thread 0x7fffeae006c0 (LWP 242816) exited]` `[Thread 0x7fffeb8006c0 (LWP 242815) exited]` `[Detaching after fork from child process 242819]` `[New Thread 0x7fffeb8006c0 (LWP 242826)]`
`Thread 1 "geany" received signal SIGSEGV, Segmentation fault.` `Downloading source file /usr/src/glib2.0-2.80.0-6ubuntu3.1/debian/build/deb/../../../glib/ghash.c` `g_str_hash (v=0x0) at ../../../glib/ghash.c:2463 ` `warning: 2463 ../../../glib/ghash.c: No such file or directory`
Does anyone have a suggestion how to narrow this down?
Try running Geany under gdb and get a backtrace.
Maybe it is https://github.com/geany/geany-plugins/pull/1294?
Thanks for the quick responses, but I think it is a system configuration problem. I cloned geany and the geany-plugins, and executed the usual sudo make install. Geanygendoc was not included because the version of ctpl in Ubuntu 24.04 was not new enough. I cloned and installed the latest ctpl. The crash still occurs.
However if I run ./src/geany from the cloned geany directory geanygendoc works correctly.
I am not sure how to resolve this (although I have found a roundabout way of getting it to run).
Maybe this issue should be closed, as it is probably not a geany problem.
If you install Geany from source, we recommend you uninstall the distribution packages because it's a little too easy to run the wrong binary, or worse, have one version load bits from the other. In theory it should work, but we've seen both users getting slightly confused, and distros making things hard on us (I didn't say Ubuntu, did I? :grin:). Alternatively, make sure you're running the Geany version you expect (e.g. check the version numbers), just in case.
Geanygendoc was not included because the version of ctpl in Ubuntu 24.04 was not new enough.
Looking at [packages.ubuntu.com](https://packages.ubuntu.com/noble/libctpl-dev) it's definitely new enough, are you sure you had the libctpl-dev package installed?
Thanks for the advice.
I have cleaned the unneeded files, installed libctpl-dev, re-cloned and recompiled. If I select `Tools/Documentation Generator/Document All Symbols`, there is still a crash.
However if I select a single function there is no crash, but whether or not text is generated depends on the function parameters.
I now see that the problem occurs only if I select a function with an anonymous parameter e.g. `void collect_manager_notify_cb(FileData *fd, NotifyType type, gpointer)`
The Status pane of Geany shows something similar to `No setting applies to symbol "anon_parameter_5" of type "local" at line 1094.`
I could not find anything in the Geany documentation regarding anonymous or unnamed parameters. Have I missed something?
The type being "local" really suggests if you have a crash it ought to be the issue from the mentioned PR… I'll try and reproduce later tonight though.
I can't seem to reproduce, but:
* if the signature you report is a prototype, OK, I see the issue. It sounds like a bug in the C parser (why generate a local tag for a prototype??), but there is probably also an issue in the plugin as the rule `local.policy = FORWARD` should make it ignore it… at any rate, by default there's no generation for prototypes. * could you try and give a backtrace, to share the exact setup that causes the crash? (e.g. the source code + plugin config)
I created a file - `/tmp/test-geany/test.c` which contains the single line `#include "test-include.h"`
The executable is generated from the clones of geany and geany-plugins. `geany -V` gives `geany 2.1 (git >= 9bf5769f5) (built on 2024-07-02 with GTK 3.24.41, GLib 2.80.0)`
GeanyGenDoc is the only plugin enabled.
Opening the test file in Geany and selecting either `Document Current Symbol` or `Document All Symbols` results in a crash.
The backtrace is attached.
If you do not see the same result, I will create a more realistic setup.
[Changing the line to be `#xxxinclude "test-include.h` -> no crash, but with the Status message `No valid tag at line 0`.]
[test-geany-backtrace-1.txt](https://github.com/user-attachments/files/16081680/test-geany-backtrace-1.tx...)
Can someone who can reproduce please run Geany under gdb and get a backtrace.
@caclark OK I can reproduce with the file containing only a single include, I'll look into it.
@caclark you can give #1365 a try, it should fix it properly.
Closed #1362 as completed.
Thanks.
That solves the problems.
github-comments@lists.geany.org