Skip to content

Crash in the file_open_dialog #1248

@mcepl

Description

@mcepl

Problem

Opening *.rej file leads to running https://git.sr.ht/~mcepl/vis-open_rej/tree/master/item/init.lua script, which leads to this crash:

GNU gdb (GDB; openSUSE Tumbleweed) 16.3
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/vis...
Reading symbols from /usr/lib/debug/usr/bin/vis.debug...
(gdb) run
Starting program: /usr/bin/vis Objects/bytesobject.c
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
�[?1049h�[22;0;0t�[1;51r�[4l�[?7h�[?1h�=�[?1034h�[?25l[Detaching after vfork from child process 1402008]
[Detaching after vfork from child process 1402009]
[Detaching after vfork from child process 1402010]
[Detaching after vfork from child process 1402011]
[Detaching after vfork from child process 1402012]
[Detaching after vfork from child process 1402013]
�[?12l�[?25h�[?1l�>[Detaching after fork from child process 1402014]
�[?25l[Detaching after vfork from child process 1402015]
[Detaching after vfork from child process 1402016]
[Detaching after vfork from child process 1402017]

Program received signal SIGSEGV, Segmentation fault.
file_open_dialog (vis=0x5555555b9b70, 
    pattern=0x5555557ce980 "/home/matej/build/ihome/home:mcepl:branches:OBS_Maintained:python3/python3.SUSE_SLE-15_Update/python36%{psuffix}-3.6.15-build/Python-3.6.15/Objects/bytesobject.c.rej")
    at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-cmds.c:411
411		int status = vis_pipe(vis, vis->win->file, &empty,
(gdb) t a a bt

Thread 1 (Thread 0x7ffff7ad5c80 (LWP 1402005) "vis"):
#0  file_open_dialog (vis=0x5555555b9b70, pattern=0x5555557ce980 "/home/matej/build/ihome/home:mcepl:branches:OBS_Maintained:python3/python3.SUSE_SLE-15_Update/python36%{psuffix}-3.6.15-build/Python-3.6.15/Objects/bytesobject.c.rej") at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-cmds.c:411
#1  0x000055555557066f in openfiles (vis=0x5555555b9b70, files=0x5555557ce0d8) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-cmds.c:432
#2  0x000055555557078a in cmd_open (vis=0x5555555b9b70, win=0x0, cmd=0x5555557ce0d0, argv=0x5555557ce0d0, sel=0x0, range=0x7fffffffb370) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-cmds.c:448
#3  0x000055555556c0d4 in sam_execute (vis=0x5555555b9b70, win=0x0, cmd=0x5555557ce0d0, sel=0x0, range=0x7fffffffb370) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/sam.c:1154
#4  0x000055555556d724 in cmd_select (vis=0x5555555b9b70, win=0x0, cmd=0x5555557d9be0, argv=0x5555557d9be0, sel=0x0, range=0x7fffffffb470) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/sam.c:1498
#5  0x000055555556c0d4 in sam_execute (vis=0x5555555b9b70, win=0x0, cmd=0x5555557d9be0, sel=0x0, range=0x7fffffffb470) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/sam.c:1154
#6  0x000055555556c560 in sam_cmd (vis=0x5555555b9b70, s=0x5555557ebb40 "open /home/matej/build/ihome/home:mcepl:branches:OBS_Maintained:python3/python3.SUSE_SLE-15_Update/python36%{psuffix}-3.6.15-build/Python-3.6.15/Objects/bytesobject.c.rej") at /usr/src/debug/vis-0.9+git.1747486581.bef22619/sam.c:1234
#7  0x000055555559e1a8 in vis_cmd (vis=0x5555555b9b70, cmdline=0x5555557c3208 "open /home/matej/build/ihome/home:mcepl:branches:OBS_Maintained:python3/python3.SUSE_SLE-15_Update/python36%{psuffix}-3.6.15-build/Python-3.6.15/Objects/bytesobject.c.rej") at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis.c:1891
#8  0x0000555555586c43 in command (L=0x5555555c91d8) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-lua.c:648
#9  0x00007ffff7eb8713 in precallC (L=0x5555555c91d8, func=0x5555555faa50, nresults=0, f=0x555555586bdf <command>) at /usr/src/debug/lua-5.4.7/src/ldo.c:529
#10 luaD_precall (L=0x5555555c91d8, func=<optimized out>, nresults=0) at /usr/src/debug/lua-5.4.7/src/ldo.c:595
#11 0x00007ffff7ec59d8 in luaV_execute (L=<optimized out>, ci=<optimized out>) at /usr/src/debug/lua-5.4.7/src/lvm.c:1682
#12 0x00007ffff7eb91d9 in ccall (L=0x5555555c91d8, func=<optimized out>, nResults=0, inc=65537) at /usr/src/debug/lua-5.4.7/src/ldo.c:637
#13 luaD_callnoyield (L=0x5555555c91d8, func=<optimized out>, nResults=0) at /usr/src/debug/lua-5.4.7/src/ldo.c:655
#14 f_call (L=L@entry=0x5555555c91d8, ud=ud@entry=0x7fffffffb7f0) at /usr/src/debug/lua-5.4.7/src/lapi.c:1038
#15 0x00007ffff7eb3e5b in luaD_rawrunprotected (L=0x5555555c91d8, f=0x7ffff7eb9190 <f_call>, ud=0x7fffffffb7f0) at /usr/src/debug/lua-5.4.7/src/ldo.c:144
#16 0x00007ffff7ed734e in luaD_pcall.constprop.0 (L=L@entry=0x5555555c91d8, func=func@entry=0x7ffff7eb9190 <f_call>, u=u@entry=0x7fffffffb7f0, old_top=old_top@entry=288, ef=<optimized out>) at /usr/src/debug/lua-5.4.7/src/ldo.c:957
#17 0x00007ffff7eb92fa in lua_pcallk (L=0x5555555c91d8, nargs=<optimized out>, nresults=0, errfunc=<optimized out>, ctx=0, k=<optimized out>) at /usr/src/debug/lua-5.4.7/src/lapi.c:1064
#18 0x0000555555585656 in pcall (vis=0x5555555b9b70, L=0x5555555c91d8, nargs=1, nresults=0) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-lua.c:162
#19 0x000055555558e56a in vis_lua_file_open (vis=0x5555555b9b70, file=0x5555557eb250) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-lua.c:3462
#20 0x000055555558f074 in vis_event_emit (vis=0x5555555b9b70, id=VIS_EVENT_FILE_OPEN) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis-lua.c:3704
#21 0x00005555555970f5 in file_new (vis=0x5555555b9b70, name=0x7fffffffd3d0 "Objects/bytesobject.c", internal=false) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis.c:150
#22 0x0000555555598716 in vis_window_new (vis=0x5555555b9b70, filename=0x7fffffffd3d0 "Objects/bytesobject.c") at /usr/src/debug/vis-0.9+git.1747486581.bef22619/vis.c:487
#23 0x0000555555568969 in main (argc=2, argv=0x7fffffffcdd8) at /usr/src/debug/vis-0.9+git.1747486581.bef22619/main.c:2349
(gdb) quit
A debugging session is active.

	Inferior 1 [process 1402005] will be killed.

Quit anyway? (y or n) y

Steps to reproduce

No response

vis version (vis -v)

vis v0.9-git +curses +lua +acl +selinux (from master at bef2261)

Terminal name/version

foot-1.22.3-1.1.x86_64 (openSUSE/Tumbleweed package)

$TERM environment variable

xterm-256color

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions