mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.91k stars 714 forks source link

[BUG][CRASH] Segfault when completing blocks in `kakrc` when built on MinGW #4762

Open Cynosphere opened 1 year ago

Cynosphere commented 1 year ago

Version of Kakoune

v2021.11.08-364-g021da117

Reproducer

Try to close a block {} in kakrc

Outcome

---------------------------
Kakoune: fatal error
---------------------------
Received SIGSEGV, exiting.
Pid: 3351
Callstack:
0xffff7c50 (ä–)
0xffff7c50 (ä–)
0x210064b90 (setcontext)
0x210132950 (sigfillset)
0x21005dae0 (secure_getenv)
0x7fffb7b72300 (_chkstk)
0x7fffb7b21070 (RtlRaiseException)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)
0x7fffb7b70f20 (KiUserExceptionDispatcher)

---------------------------
OK   Cancel   
---------------------------

Expectations

The editor should not crash

Additional information

Screwtapello commented 1 year ago

Congratulations on getting Kakoune to build on MinGW! I didn't realise it was possible. What steps did you take to get it to build?

What does "try to close a block" mean? Just typing {} in insert mode?

Can you reproduce the problem when starting Kakoune without loading any configuration (kak -n)?

Unfortunately, none of the functions mentioned in the callstack there are defined by Kakoune or (directly) called by Kakoune; it sounds like something went awry in whatever POSIX-compatibility layer MinGW uses and if Kakoune is to blame then any useful evidence appears to have been lost.

Cynosphere commented 1 year ago

What does "try to close a block" mean? Just typing {} in insert mode?

The specific case was with trying to install plug.kak or configuring a plugin.

Can you reproduce the problem when starting Kakoune without loading any configuration (kak -n)?

I cannot. It seems to be related to syntax highlighting since that got disabled.


What steps did you take to get it to build?

It's been a while since I first attempted to build it so I can't remember for sure if I had any issues relating to compilation then. I updated it yesterday and it built fine. The only issue is with the find call in the Makefile, but that's easily solved with alias find=/usr/bin/find

Passw commented 2 months ago

steps to reproduce

1. build Kakoune source code from latest github repo with latest msys2.exe on Windows 10
2. kak -n kakoune/src/context.cc
3. press key **m** twice
Received SIGSEGV, exiting.
Pid: 1495
Callstack:
0x7ffff93e0 ()
0x7ffff93e0 ()
0x180062640 (setcontext)
0x1800bf5f0 (sigfillset)
0x18005b2d0 (secure_getenv)
0x7ff8a2d52810 (_chkstk)
0x7ff8a2d020d0 (RtlRaiseException)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
0x7ff8a2d51410 (KiUserExceptionDispatcher)
Kakoune fatal error, q: exit, i: ignore or debug pid 1495Segmentation fault