-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Segfault when using wrong number separator #482
Comments
@thexhr I don't get segfault on opening sc-im and doing |
Anyone had this issue as well? @thexhr could you please run it with gdb and send the stacktrace? thanks |
@andmarti1424 I already included a stacktrace in the first post. Do you need something else? |
Yep @thexhr Sorry. I saw this now. |
T.b.H. I cannot reproduce it now since the latest master doesn't compile on OpenBSD :/
While this is bad for progressing this bug I don't want to derail the issue with compile problems that could be related to OpenBSD's curses lib (?). |
Yep. That is because the version of ncurses you have dont have that function defined.. You might need version 6.2 or just replace the two init_extended_color calls on color.c with init_color.. |
Could you please tell me the version of ncurses you have? |
Anyways. I uploaded a change so it try to detect the version of ncurses and use plain init_color if version is prior to 6.1.. |
ncurses is part of OpenBSD base system so there is no installed package. Since I were not sure how to find out the version number I looked into
I tried compiling latest master c12c527 and it makes no difference. Build still fails with the same error as above. |
Yes. Kinda old.. init_extended_color was introduced on v6.1. In my second to last commit I have added a check for that macros NCURSES_VERSION_MAJOR and NCURSES_VERSION_MAJOR.. so that those Init_extended_color gets replaced with init_color.. But for some reason it is not working for you. |
If you can help me with this.. I would ask you to replace the init_extended_color with init_color. If that builds ok, then theres a problem in the macro evaluation I added. the one that evaluates NCURSES_VERSION_MAJOR and NCURSES_VERSION_MAJOR. please let me know. thanks. |
I think we always looked at the wrong place. The linker complains about a missing symbol (comment from above). The following changes made it compile successfully. OpenBSD's version of ncurses doesn't contain Since sc-im immediately segfaults when launching, my change is bogus and only here to proof that the code compiles.
I looked at 45326a5 which touched |
@thexhr |
Yes, using latest master I can now build successfully. Thanks for the changes!! It now segfaults right upon start due to a ncurses error:
The last 2 messages in the backtrace about the error in tui.c:249 and tui.c:1441 repeat in a loop. |
@thexhr Do you happen to be opening a file? If so, please attach it here. Thanks. |
No, I just launched sc-im. |
@thexhr Could you attach your scimrc ? Thanks |
I have none :) I traced the program's execution and saw that it tries to open files and config folders but they're all empty:
|
Yes. Thats normal. I still dont see whats causing the segfault. |
The error is triggered by the
So I guess you could add some more macro magic and then we should have resolved all curses related compiling errors. Not quite the intention of the original bug report, but IMO a good outcome. Thanks a lot for your help so far, much appreciated! Since sc-im now starts, I tested the original error trigger (=1,1) and still get a segfault:
|
I might know the cause of the ncurses issue.. The other 1,1 thing, I am completely lost. |
Thanks for the I upgraded my gdb version and now got one additional line in the backtrace regarding the yacc file and some more caller infos.
What I could offer is SSH access to one of my OpenBSD machines. Let me know if that's an option for you. |
do you happen to have bison or yacc? please attach your gram.c file please. |
I have yacc. It is the version from Robert Paul Corbett for the original 4BSD. I couldn't attach the gram.c file here so I uploaded it to https://xosc.org/misc/gram.c I have valgrind 3.10.1 installed but it's somehow broken :( |
It's related to OpenBSD's yacc. Compiling with Bison 3.3.2 fixes the segfault and I get the syntax error! |
Is there a chance you use bison rather than yacc? |
I also might send my gram.c for you to use rather than generating one with yacc |
That is then. I knew. Haha |
Thanks a lot for your help @andmarti1424 ! I'll prepare a package for OpenBSD port and add bison as build dependency. The good result of this issue is that latest master now builds fine one OpenBSD :) |
Thanks to you. I will comment this on a wiki just in a case |
One of the OpenBSD senior developers looked at the case and found a bug in the gram.y file. He proposed the following fix and wrote "the issue is a recursive call of yyparse() in the syntax error handling code. Original yacc does not allow that. "
He also noted a change of semantics due to his patch: "Slight change in behaviour: after an syntax error, the whole input is discarded instead of doing an attempt to parse it partly (this is what I think the current code tries)" |
I am not yacc/bison expert. I changed that and tested it, and didnt find any issues. So Ill commit it. |
Hi, I am the author of the patch. I did test this with both yacc and bison on OpenBSD and saw no differences. But note that originally, entering |
hello @omoerbeek. thanks for your patch. |
Hi,
I am running latest git version. Whenever I add a numerical value with "," as separator instead of "." sc-im crashes. If you need more, just let me know.
How to reproduce
Open sc-im and enter =1,1 and I get a segfault immediately.
Stacktrace
By compiling with -g3 i get the following:
Environment
The text was updated successfully, but these errors were encountered: