If there is a text present (even a simple space) between the TYPE keyword and the first declared type.
I have also tried to type a very simple pascal program directly in Geany editor, by also putting a space in the line after the TYPE keyword and before the first type declaration. The moment i saved it as a PAS file, Geany crashed.
I tested this behaviour with Geany 1.25 from another PC and it works ok.
Geany v1.36 GTK+ v2.24.32 Win 7 x64 Enterprise SP1
WFM, please post a minimal[1] program to reproduce.
[1] one line would be good :grin:
Ahh yes, i forgot to type one. So here it is:
``` program test
type
{ comment } TType = class one: Integer; end; ```
Confirmed on ` Geany 1.37 (git >= 82590af4)`
In ctags, partial backtrace:
``` #0 0x00007ffff7b0bc6f in makeTagEntry (tag=tag@entry=0x7fffffffbf20) at main/entry.c:1255 #1 0x00007ffff7b27ac7 in makePascalTag (tag=0x7fffffffbf20) at parsers/pascal.c:61 #2 0x00007ffff7b27ac7 in findPascalTags () at parsers/pascal.c:272 #3 0x00007ffff7b23fb6 in createTagsForFile (language=<optimised out>, passCount=1) at main/parse.c:2158 #4 0x00007ffff7b2725e in createTagsWithFallback1 (userData=0x7fffe002b430, passCallback=0x7ffff7afe720 <ctags_pass_start>, language=4) at main/parse.c:2233 #5 0x00007ffff7b2725e in createTagsWithFallback (buffer=<optimised out>, bufferSize=<optimised out>, fileName=<optimised out>, language=4, tagCallback=<optimised out>, passCallback=0x7ffff7afe720 <ctags_pass_start>, userData=0x7fffe002b430) at main/parse.c:2320 #6 0x00007ffff7b09c22 in ctagsParse (buffer=buffer@entry=0x5555564b81b0 "program test\n\ntype\n\n { comment }\n TType = class\n one: Integer;\n end;", bufferSize=bufferSize@entry=74, fileName=fileName@entry=0x555555995600 "/tmp/untitled.pas", language=<optimised out>, tagCallback=tagCallback@entry=0x7ffff7afe8d0 <ctags_new_tag>, passCallback=passCallback@entry=0x7ffff7afe720 <ctags_pass_start>, userData=<optimised out>) at main/ctags-api.c:74 #7 0x00007ffff7aff872 in tm_source_file_parse (source_file=source_file@entry=0x7fffe002b430, text_buf=text_buf@entry=0x5555564b81b0 "program test\n\ntype\n\n { comment }\n TType = class\n one: Integer;\n end;", buf_size=buf_size@entry=74, use_buffer=use_buffer@entry=1) at tm_source_file.c:829 ---Type <return> to continue, or q <return> to quit--- #8 0x00007ffff7b00d26 in update_source_file (source_file=0x7fffe002b430, text_buf=0x5555564b81b0 "program test\n\ntype\n\n { comment }\n TType = class\n one: Integer;\n end;", buf_size=74, use_buffer=1, update_workspace=<optimised out>) at tm_workspace.c:159 #9 0x00007ffff7922273 in document_update_tags (doc=0x5555562adb70) at document.c:2695 #10 0x00007ffff792255c in document_set_filetype (doc=0x5555562adb70, type=0x555555de8180) at document.c:2843 #11 0x00007ffff7925343 in document_save_file_as (doc=doc@entry=0x5555562adb70, utf8_fname=utf8_fname@entry=0x555555a5dfe0 "/tmp/untitled.pas") at document.c:1835 ```
This looks like a duplicate of #2358.
Nobody except Travis seems to have tested the patches @ntrel made there, @papadouk can you test #2360 and see if it fixes the problem.
i have never tested a patch before so the only thing i manage to do in order to test it towards the lastest build it was to use the latest nightly build (i have attached a screenshot from the About window) ![2020-01-29 21_06_31-_simple pas - C__PrimeLogic - Geany](https://user-images.githubusercontent.com/1281752/73393068-57692100-42db-11e...)
Geany DIDN'T crash this time but instead it cleared its SYMBOLS tree (no symbols found message).
I do hope it helped
Been fighting this issue with documented obj-pas file for a while and stumbled across this. I can confirm that #2360 solves the issue for me, and symbols seem unaffected. Pulled from github.com/ntrel/geany.git, pas-type branch.
Built on Arch, screenshot of about is below. Let me know if theres anything else you'd need from me and I'll see what I can do to help.
This bug was introduced by a1cf475fcf2c81420bfa90307585ec645cfb4dc1
The SEGFAULT is (probably) caused by the uninitialized `tagEntryInfo` in `createPascalTag()`.
https://github.com/geany/geany/blob/8f0909685dad46096ecf92152e82d309b0852bfd...
After having a look at https://github.com/universal-ctags/ctags/blob/86bdb84ce1fc25239c02121343cec8... I altered the line to
```Pascal initTagEntry (tag, NULL, KIND_GHOST_INDEX); ```
and my Pascal files don't crash Geany anymore.
![NoPascalCrash](https://user-images.githubusercontent.com/35614937/94345511-ae6bf500-0026-11...)
BTW: That's a duplicate of #2358
Closed #2428 via #3043.
github-comments@lists.geany.org