Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of "type" in pascal causes crash + permanent malfunction (MacOS) #2982

Closed
a-seipel opened this issue Nov 5, 2021 · 5 comments · Fixed by #3043
Closed

usage of "type" in pascal causes crash + permanent malfunction (MacOS) #2982

a-seipel opened this issue Nov 5, 2021 · 5 comments · Fixed by #3043
Labels
bug crash Geany crashes because of this issue

Comments

@a-seipel
Copy link

a-seipel commented Nov 5, 2021

Hi, I already read about this bug but not on GitHub and never with a solution, so I hope this is not a duplicate. I tried to write a program in pascal, using the command "type". After typing the word "type", pressing any button caused Geany to crash. After that, Geany can be opened as usual, just that since then I cannot even compile simple hello world programs. I get the error message "ld: library not found for -lc" and "/usr/local/bin/ppcx64 returned an error exitcode" as well as exitcode 127. In addition, shell files and files of type .res are created in the working directory. I tried deleting them, uninstalling fcp and Geany but nothing worked. X Code is installed and everything worked fine before the crash. Attached you can find a screenshot of the error message.
Screenshot 2021-11-05 at 11 25 50

@elextr
Copy link
Member

elextr commented Nov 5, 2021

Can't duplicate crash on Linux when adding "type" into a Pascal file produced by Menu->File->New with Template->program.pas. Can you be more specific how to reproduce it.

The failure to compile appears to be something to do with your Pascal compiler setup, which is outside Geany.

@a-seipel
Copy link
Author

a-seipel commented Nov 5, 2021

Thanks for the quick answer! I also tried to reproduce the error and this time it did not always crash. But if one presses enter in the following situation, the crash always happens:
Screenshot 2021-11-05 at 12 22 51
s:

@elextr
Copy link
Member

elextr commented Nov 5, 2021

Confirmed, bt:


Thread 1 "geany" received signal SIGSEGV, Segmentation fault.
0x00007ffff7efd184 in getLanguageKind (kindIndex=69, language=-154646337)
    at main/parse.c:333
333			kdef = getKind (LanguageTable [language].kindControlBlock, kindIndex);
(gdb) bt
#0  0x00007ffff7efd184 in getLanguageKind (kindIndex=69, language=-154646337)
    at main/parse.c:333
#1  getLanguageKind (language=-154646337, kindIndex=69) at main/parse.c:317
#2  0x00007ffff7efec4d in isLanguageKindEnabled
    (language=<optimised out>, kindIndex=<optimised out>) at main/parse.c:2225
#3  0x00007ffff7ec04ce in isTagWritable (tag=0x7fffffffda70) at main/entry.c:1472
#4  0x00007ffff7ec2285 in makeTagEntry (tag=tag@entry=0x7fffffffda70) at main/entry.c:1682
#5  0x00007ffff7ee0b21 in makePascalTag (tag=0x7fffffffda70) at parsers/geany_pascal.c:61
#6  findPascalTags () at parsers/geany_pascal.c:272
#7  0x00007ffff7f02647 in createTagsForFile (passCount=1, language=4) at main/parse.c:3722
#8  createTagsWithFallback1
    (language=language@entry=4, exclusive_subparser=exclusive_subparser@entry=0x7fffffffdca4) at main/parse.c:3844
#9  0x00007ffff7f02954 in createTagsWithFallback
    (failureInOpenning=<synthetic pointer>, mio=0x5555562c57a0, language=4, fileName=0x55555612dde0 "/tmp/untitled.pas") at main/parse.c:3934
#10 parseMio
    (fileName=fileName@entry=0x55555612dde0 "/tmp/untitled.pas", language=language@entry=4, mio=mio@entry=0x5555562c57a0, useSourceFileTagPath=useSourceFileTagPath@entry=false, clientData=clientData@entry=0x5555559cdd50) at main/parse.c:4096
#11 0x00007ffff7f02b81 in parseRawBuffer
    (fileName=0x55555612dde0 "/tmp/untitled.pas", buffer=<optimised out>, bufferSize=<optimised out>, language=4, clientData=0x5555559cdd50) at main/parse.c:4167
#12 0x00007ffff7ebc1fa in tm_source_file_parse
    (source_file=source_file@entry=0x5555559cdd50, text_buf=text_buf@entry=0x5555559e4800 "\n\nprogram untitled;\n type\n \n\nbegin\n writeln('hello');\nend.\n", buf_size=buf_size@entry=59, use_buffer=use_buffer@entry=1) at tm_source_file.c:719
#13 0x00007ffff7ebd4de in update_source_file
    (source_file=0x5555559cdd50, text_buf=0x5555559e4800 "\n\nprogram untitled;\n type\n \n\nbegin\n writeln('hello');\nend.\n", buf_size=59, use_buffer=1, update_workspace=<optimised out>) at tm_workspace.c:157
#14 0x00007ffff7ccb875 in document_update_tags (doc=0x5555560d9c70) at document.c:2694
#15 document_update_tags (doc=0x5555560d9c70) at document.c:2647
#16 0x00007ffff7ccb95d in on_document_update_tag_list_idle (data=0x5555560d9c70)
    at document.c:2763
#17 on_document_update_tag_list_idle (data=0x5555560d9c70) at document.c:2755
#18 0x00007ffff6ca5be8 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007ffff6ca504e in g_main_context_dispatch ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007ffff6ca5400 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007ffff6ca56f3 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff74f037d in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff7cf0f60 in main_lib (argc=<optimised out>, argv=<optimised out>)

Ctags expert needed.

@elextr elextr added bug crash Geany crashes because of this issue labels Nov 5, 2021
@elextr
Copy link
Member

elextr commented Nov 5, 2021

PS reproduced on current git HEAD.

eht16 added a commit to eht16/geany that referenced this issue Nov 6, 2021
This fixes crashes when using incomplete "type" declarations.

Fixes geany#2358, fixes geany#2982 and fixes geany#2428.
@eht16
Copy link
Member

eht16 commented Nov 6, 2021

This is a duplicate of #2428 and #2358.

eht16 added a commit to eht16/geany that referenced this issue Nov 7, 2021
This fixes crashes when using incomplete "type" declarations.

Fixes geany#2358, fixes geany#2982 and fixes geany#2428.
eht16 added a commit to eht16/geany that referenced this issue Dec 5, 2021
eht16 added a commit to eht16/geany that referenced this issue Dec 8, 2021
eht16 added a commit to eht16/geany that referenced this issue Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash Geany crashes because of this issue
Projects
None yet
3 participants