bugGNU nano - Bugs: bug #63732, segfault while processing terminfo...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #63732: segfault while processing terminfo data

Submitter:  JH <ifiht>
Submitted:  Mon 30 Jan 2023 05:08:35 PM UTC
   
 
Severity:  3 - Normal Status:  Invalid
Assigned to:  None Open/Closed:  Closed

Mon 06 Feb 2023 08:35:58 AM UTC, comment #5: 

Thanks for confirming that it is a linkage problem on your
particular system, and that there's nothing wrong with nano
(when it finds the libraries that it is supposed to find).

If you need LD_LIBRARY_PATH to be set for other things on
your system to work properly, you can try changing the order
of its colon-separated paths, shuffling them until everything
works.  If you can't get that to work, you could alias nano
to 'LD_LIBRARY_PATH="" nano', or something similar.

Since it's not a bug in nano, closing.

Benno Schulenberg <bens>
Group administrator
Sun 05 Feb 2023 06:08:03 PM UTC, comment #4: 

Quick update:

confirmed it's the linked libraries, when I unset LD_LIBRARY_PATH nano works fine:

└$ nano test
                                                                                                                                                         zsh | 13:04:54
└$ ldd /usr/bin/nano
        linux-vdso.so.1 (0x00007fff0992f000)
        libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x00007fc157355000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fc157325000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc157133000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc15712d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc1573fb000)


@Benno - any suggestions? Definitely not nano's problem, but I'm not experienced enough to know where to take this error, if it should even be explored any further...

JH <ifiht>
Sun 05 Feb 2023 05:34:54 PM UTC, comment #3: 

Hey thanks for the help & sorry for the delay, here's the details:

System: Linux localhost 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Nano: System default via apt package manager, downloaded binary,
 GNU nano, version 4.8
 (C) 1999-2011, 2013-2020 Free Software Foundation, Inc.
 (C) 2014-2020 the contributors to nano
 Email: nano@nano-editor.org    Web: https://nano-editor.org/
 Compiled options: --disable-libmagic --enable-utf8

With ignoring RC (still segfaults):
nano --ignorercfiles test
zsh: segmentation fault (core dumped)


Last note - good call on linker I was able to see it is calling libraries from my conda installation and not the system, maybe that is where the issue occurs?:

ldd /usr/bin/nano
        linux-vdso.so.1 (0x00007ffdb7db1000)
        libncursesw.so.6 => /home/ifiht/mambaforge/envs/lamda11/lib/libncursesw.so.6 (0x00007fb32598f000)
        libtinfo.so.6 => /home/ifiht/mambaforge/envs/lamda11/lib/libtinfo.so.6 (0x00007fb32594f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb325743000)
        libtinfow.so.6 => /home/ifiht/mambaforge/envs/lamda11/lib/./libtinfow.so.6 (0x00007fb325702000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb325a1d000)


JH <ifiht>
Sun 05 Feb 2023 09:07:58 AM UTC, comment #2: 

Ping?

Benno Schulenberg <bens>
Group administrator
Tue 31 Jan 2023 10:43:17 AM UTC, comment #1: 

First: what version of nano?  Self-compiled?  What platform (BSD, Linux)?  What basic distro?

Second: your nano probes for termcap, where mine doesn't. I suspect your nano links against something else than ncurses.  What does 'ldd' say about the nano you're running?

Third: it's not nano that reads the terminfo stuff, but the curses routines.  So it's there that the segfault happens.

Fourth: does the segfault occur also when your run nano with the option --ignorercfiles?

Benno Schulenberg <bens>
Group administrator
Mon 30 Jan 2023 05:08:35 PM UTC, original submission:  

Running a pretty unique AI/ML setup, but it looks like something in my conda environment is messing up nano - it segfaults even after I've disabled my custom settings, trying to edit a new test file. Here's the strace output:


access("/usr/share/nano/xml.nanorc", R_OK) = 0
stat("/usr/share/nano/xml.nanorc", {st_mode=S_IFREG|0644, st_size=527, ...}) = 0
openat(AT_FDCWD, "/usr/share/nano/xml.nanorc", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=527, ...}) = 0
read(4, "## Here is an example for XML fi"..., 4096) = 527
read(4, "", 4096)                       = 0
close(4)                                = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
geteuid()                               = 1005
access("/home/ifiht/.nanorc", R_OK) = -1 ENOENT (No such file or directory)
access("/home/ifiht/.config/nano/nanorc", R_OK) = -1 ENOENT (No such file or directory)
stat("/home/ifiht/.nano/", 0x7ffc3ac53e10) = -1 ENOENT (No such file or directory)
stat("/home/ifiht/.local/share/nano/", {st_mode=S_IFDIR|S_ISGID|0700, st_size=2, ...}) = 0
openat(AT_FDCWD, "/home/ifiht/.local/share/nano/search_history", O_RDONLY) = -1 ENOENT (No such file or directory)
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
stat("/home/ifiht/.terminfo", 0x556a4ab4ef70) = -1 ENOENT (No such file or directory)
stat("/home/ifiht/mambaforge/envs/lamda11/share/terminfo", {st_mode=S_IFDIR|0775, st_size=44, ...}) = 0
stat("/etc/termcap", 0x556a4ab4f000)    = -1 ENOENT (No such file or directory)
stat("/usr/share/misc/termcap", 0x556a4ab4f000) = -1 ENOENT (No such file or directory)
stat("/home/ifiht/mambaforge/envs/lamda11/share/terminfo", {st_mode=S_IFDIR|0775, st_size=44, ...}) = 0
access("/home/ifiht/mambaforge/envs/lamda11/share/terminfo/x/xterm-256color", R_OK) = 0
openat(AT_FDCWD, "/home/ifiht/mambaforge/envs/lamda11/share/terminfo/x/xterm-256color", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=3852, ...}) = 0
read(3, "\36\2%\0&\0\17\0\235\1Z\6xterm-256color|xterm"..., 4096) = 3852
read(3, "", 4096)                       = 0
close(3)                                = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=51, ws_col=97, ws_xpixel=640, ws_ypixel=480}) = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=51, ws_col=97, ws_xpixel=640, ws_ypixel=480}) = 0
brk(0x556a4ab8a000)                     = 0x556a4ab8a000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xc8} ---
+++ killed by SIGSEGV (core dumped) +++
zsh: segmentation fault (core dumped)  strace nano test


Any devs out there that can understand what's going on? I can test on my system if there's a fix besides deleting my entire AI environment.

JH <ifiht>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by ifiht (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-06 bens StatusNeed Info Invalid
        Open/ClosedOpen Closed
    2023-02-05 bens SummarySegfault with xterm ENV VARS? segfault while processing terminfo data
    2023-01-31 bens StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code