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

Segmentation fault error when managing sessions #1041

Closed
johnwuelk opened this issue Jun 2, 2021 · 12 comments
Closed

Segmentation fault error when managing sessions #1041

johnwuelk opened this issue Jun 2, 2021 · 12 comments
Labels

Comments

@johnwuelk
Copy link

When saving or loading a session for example, nnn outputs "segmentation fault (core dumped)" and crashes/exits. This does not happen with older versions like f.i. nnn v3.7.

I tried to find the cause with strace, these are the last lines of strace before nnn exits:
48 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
349 +++ killed by SIGSEGV (core dumped) +++

I'm trying to use nnn as my main file manager due to its convenience with plugins and shortcuts.

@johnwuelk johnwuelk added the bug label Jun 2, 2021
@KlzXS
Copy link
Collaborator

KlzXS commented Jun 2, 2021

Which version is this on? What are the exact sequences of keypresses to reproduce this issue?

The trace you shared seems to be from the signal handler calls. Not much can be gathered from that.

@jarun
Copy link
Owner

jarun commented Jun 2, 2021

Can you please compilennn with debugging enbaled (https://github.com/jarun/nnn/wiki/Developer-guides#debugging-nnn) and share the backtrace after hitting the crash from gdb?

@jarun
Copy link
Owner

jarun commented Jun 2, 2021

@jarun
Copy link
Owner

jarun commented Jun 2, 2021

We did have changes in release 4.1 to support named persistent sessions.
Please share which program options you are using.
Also please check if the issue goes away if you remove the older saved sessions.

@jarun
Copy link
Owner

jarun commented Jun 2, 2021

@johnwuelk in case you haven't noticed, we have made a release today. So if you are seeing this on the latest release, please act a bit faster and help us fix the issue so we can make a quick release before downstream packagers pick this up for packaging.

@johnwuelk
Copy link
Author

Sorry for getting back late. The error still persists, here is what I did:

  1. Remove nnn completely
  2. git clone https://github.com/jarun/nnn.git
  3. cd nnn
  4. sudo make
  5. ./nnn
  6. hit 's' key key two times (sessions -> save session)
  7. type 'test' for session name
  8. nnn exits with "Segmentation fault (core dumped)"
    It failed on two different devices, Manjaro and Debian, same behavior.

@signed-log
Copy link
Collaborator

Sorry for getting back late. The error still persists, here is what I did:

1. Remove nnn completely

2. git clone https://github.com/jarun/nnn.git

3. cd nnn

4. sudo make

5. ./nnn

6. hit 's' key key two times (sessions -> save session)

7. type 'test' for session name

8. nnn exits with "Segmentation fault (core dumped)"
   It failed on two different devices, Manjaro and Debian, same behavior.

sudo make? This is not good, try without sudo

@johnwuelk
Copy link
Author

Same behavior also without sudo (only make).

@jarun Here is the output of the nnndbg file:

ln line: VERSION=4.1
ln line: g_tmpfpath=/tmp
ln line: tmpfplen=5
ln line: home=/home/dojo
ln line: cfgpath=/home/dojo/.config
ln line: cfgpath=/home/dojo/.config/nnn
ln line: selpath=/home/dojo/.config/nnn/.selection
ln line: opener=xdg-open
ln line: getenv(envs[ENV_VISUAL])=vim
ln line: getenv(envs[ENV_EDITOR])=vim
ln line: editor=vim
ln line: pager=less
ln line: shell=/bin/bash
ln line: getenv("PWD")=/tmp/test/nnn
ln line: COLORS=256
ln line: COLOR_PAIRS=65536
ln line: func=dentfill
ln line: ts2.tv_nsec - ts1.tv_nsec=57895
ln line: func=redraw
ln line: path=/tmp/test/nnn
ln line: event->wd=0
ln line: event->mask=0
ln line: "inotify read done"=inotify read done
ln line: event->wd=0
ln line: event->mask=0
ln line: "inotify read done"=inotify read done

@johnwuelk
Copy link
Author

We did have changes in release 4.1 to support named persistent sessions.
Please share which program options you are using.
Also please check if the issue goes away if you remove the older saved sessions.

I use no program options, just "nnn". I also removed all saved sessions, compiled and ran it again which led to the same error.

@jarun
Copy link
Owner

jarun commented Jun 2, 2021

I can repro it. Thanks!

@jarun jarun closed this as completed in f27e93f Jun 2, 2021
@jarun
Copy link
Owner

jarun commented Jun 2, 2021

Please confirm the patch works. Please explore the other session options also to confirm everything works.

We'll make another release soon with some other fixes.

@jarun jarun mentioned this issue Jun 2, 2021
10 tasks
@johnwuelk
Copy link
Author

It works now! Thanks for this quick patch. This even fixed a rendering issue I had with the fzcd plugin.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants