orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
624 stars 38 forks source link

Segfault on FreeBSD #478

Open hellium6 opened 9 months ago

hellium6 commented 9 months ago

While trying to build Textadept 12.1 release on FreeBSD 12.4-RELEASE i386 with:

## added ` iconv` in the `set(ta_link_libs...` line on root CMakeLists.txt as described in issue #477
$ cmake -S . -B build_dir -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=build_dir/install -D CMAKE_C_COMPILER=gcc13 -D CMAKE_CXX_COMPILER=g++13 -D CMAKE_EXE_LINKER_FLAGS="-rpath=/usr/local/lib/gcc13"  # rpath is from gcc13 install message
$ cmake --build build_dir -j
$ cmake --install build_dir

Running gives me a segfault:

$ build_dir/install/bin/textadept-gtk
Segmentation fault

strace shows:

$ strace build_dir/install/bin/textadept-gtk
strace: open("/proc/...", ...): No such file or directory
trouble opening proc file

gdb shows:

$ sudo gdb build_dir/install/bin/textadept-gtk
GNU gdb (GDB) 13.2 [GDB v13.2 for FreeBSD]
Copyright (C) 2023 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 "i386-portbld-freebsd12.4".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
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 build_dir/install/bin/textadept-gtk...
(gdb) run
Starting program: /usr/home/user/Downloads/textadept-textadept_12.1/build_dir/install/bin/textadept-gtk 
warning: File "/usr/local/lib/gcc13/libstdc++.so.6.0.31-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
    add-auto-load-safe-path /usr/local/lib/gcc13/libstdc++.so.6.0.31-gdb.py
line to your configuration file "/root/.config/gdb/gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/root/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
[New LWP 101097 of process 50902]
[New LWP 101288 of process 50902]

Thread 1 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
0x29745cc0 in strcmp () from /lib/libc.so.7
(gdb) backtrace
#0  0x29745cc0 in strcmp () at /lib/libc.so.7
#1  0x080b6c2e in luaS_new ()
#2  0x0809bfd1 in lua_setglobal ()
#3  0x0809380c in init_lua ()
#4  0x08096541 in init_textadept ()
#5  0x0808f0c6 in main ()
orbitalquark commented 9 months ago

Sorry, BSD is not supported. I don't have access to a BSD machine and haven't had any help in getting Textadept to work on it. Your crash is related to Textadept attempting to locate where it is. This might help: https://github.com/orbitalquark/textadept/commit/bb14dfe31c87ebf9b1489186c7a023ef6582d952#diff-e137203d90aa39a746e4bae862aff9bcd13a78d4f4fe2896b0046aba666f9ed5

quesada commented 4 months ago

FWIW, I use it on freeBSD too