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

Shell invocation results in a segfault on OpenBSD #49

Closed
vaygr opened this issue Oct 7, 2017 · 6 comments
Closed

Shell invocation results in a segfault on OpenBSD #49

vaygr opened this issue Oct 7, 2017 · 6 comments

Comments

@vaygr
Copy link
Contributor

vaygr commented Oct 7, 2017

When shell invocation (!) is performed, nnn crashes while spawning and gets back to its primary UI.

@vaygr
Copy link
Contributor Author

vaygr commented Oct 8, 2017

More debugging info:

Starting program: /home/user/nnn-1.5/nnn 
[New process 99364]

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 565247]
*_libc_strtol (nptr=0x0, endptr=0x0, base=10) at /usr/src/lib/libc/stdlib/strtol.c:68
68      /usr/src/lib/libc/stdlib/strtol.c: No such file or directory.
        in /usr/src/lib/libc/stdlib/strtol.c
(gdb) bt
#0  *_libc_strtol (nptr=0x0, endptr=0x0, base=10) at /usr/src/lib/libc/stdlib/strtol.c:68
#1  0x000002656d897530 in *_libc_atoi (str=Variable "str" is not available.
) at /usr/src/lib/libc/stdlib/atoi.c:36
#2  0x0000026307a013a0 in spawn (file=0x7f7ffffd0d0f "/bin/ksh", arg1=0x0, arg2=0x0, dir=0x26307c0fde0 "/home/user/nnn-1.5", flag=129 '\201') at nnn.c:571
#3  0x0000026307a072d9 in browse (ipath=0x26307c101e0 "/home/user/nnn-1.5", ifilter=0x26307b0a6fc "^[^.]") at nnn.c:2775
#4  0x0000026307a078c0 in main (argc=1, argv=0x7f7ffffd0a78) at nnn.c:2937

@vaygr
Copy link
Contributor Author

vaygr commented Oct 8, 2017

I guess the answer is $SHLVL is not supported by ksh. It is supported by bash, mksh and fish
however -- I checked those. But since it's only an info message, maybe it can be optional.

@jarun
Copy link
Owner

jarun commented Oct 8, 2017

First, thanks a lot for testing nnn out and for the issues and PRs! I will review and pull them in a few hours.

Regarding the issue:

It can be optional but it's quite helpful. So I'm thinking how about checking the shell and if it's bash, fish or mksh show this msg? is there any alternative on ksh?

@jarun
Copy link
Owner

jarun commented Oct 8, 2017

Resolved at d835f72.

@jarun jarun closed this as completed Oct 8, 2017
@vaygr
Copy link
Contributor Author

vaygr commented Oct 8, 2017

Well, let's pave a bright future for nnn :) there are many shells right now, and there will probably more in 2052, all w/ or w/o support with this special variable.

So I think it's cleaner to rely on this variable existence and use it if it's there rather than add/remove support shells based on their names every time 1) new shell with a new name is developed; 2) support for this variable is added/removed. So we'd actually need to track it or rely on users' reports.

On the other hand, there we just check the var and use it if it's available -- cheap and simple.

@jarun
Copy link
Owner

jarun commented Oct 8, 2017

Makes sense, the reason I already accepted the PR. ;)

@lock lock bot locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants