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

aligning a selection of cell's cause crash (on NixOS) #884

Open
mipmip opened this issue Aug 13, 2024 · 10 comments
Open

aligning a selection of cell's cause crash (on NixOS) #884

mipmip opened this issue Aug 13, 2024 · 10 comments

Comments

@mipmip
Copy link
Contributor

mipmip commented Aug 13, 2024

Sc-im crashes with buffer overflow when trying ot align a visual selection.

*** buffer overflow detected ***: terminated
[1]    1081326 IOT instruction (core dumped)  sc-im
sc-im-align-selection-crash.mp4
@andmarti1424
Copy link
Owner

Hello. Will check it out. Thank you for reporting this.

@andmarti1424
Copy link
Owner

I am not able to reproduce this. Can someone test this and report back? @mipmip are you able to make it crash every time? Thanks.

@mipmip
Copy link
Contributor Author

mipmip commented Aug 14, 2024

@mipmip are you able to make it crash every time? Thanks.

Yes. Visual select + aligning = crash

@andmarti1424
Copy link
Owner

andmarti1424 commented Aug 14, 2024

That is what I did, but no crash in here I am afraid.
EDIT: I have also tested it with valgrind to see if there is an overflow or leak but I saw none

@mipmip
Copy link
Contributor Author

mipmip commented Aug 14, 2024

It seems to happen here: visual.c > line 510: swprintf(interp_line + wcslen(interp_line), BUFFERSIZE, L":%s", v_name(r->brrow, r->brcol));

I'll test it on other machines tomorrow.

@mipmip mipmip changed the title aligning a selection of cell's cause crash aligning a selection of cell's cause crash (on NixOS) Aug 16, 2024
mipmip added a commit to mipmip/sc-im that referenced this issue Aug 16, 2024
@mipmip
Copy link
Contributor Author

mipmip commented Aug 16, 2024

When the gcc option -D_FORTIFY_SOURCE=2 is set this make sc-im crash. Unfortunately I haven't found the real fix, but I guess sc-im isn't ready for -D_FORTIFY_SOURCE=2.

In Nix the build option hardeningDisable = [ "fortify" ]; fixes this problem. Other distro's might have this problem.

@andmarti1424
Copy link
Owner

@mipmip will try to build it like that and retry with valgrind.

@mipmip
Copy link
Contributor Author

mipmip commented Aug 16, 2024

This answer seems relevant https://stackoverflow.com/questions/68496582/swprintf-with-d-fortify-source-2-throws-a-buffer-overflow

@mipmip
Copy link
Contributor Author

mipmip commented Aug 16, 2024

mipmip added a commit to mipmip/nixpkgs that referenced this issue Aug 20, 2024
Fixes NixOS#335130

For complete description of problem with video see
andmarti1424/sc-im#884
@jtraeholt
Copy link

might be related. :cellcolor crashes too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants