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 when delete-buffer with ClientClose hook #2975

Closed
FlyingWombat opened this issue Jun 15, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@FlyingWombat
Copy link

commented Jun 15, 2019

I stumbled upon a segmentation fault, when using the ClientClose hook to delete a buffer.
Maybe the same as #2462, but that issue refers to hooks that start Kakoune, wheras this is with hooks that close it.

Steps

I found 2 ways to reproduce this (not sure if there's a difference).
It doesn't matter if the file "asdf.txt" exists or not.

First way:

  1. open a terminal and kak -n -e 'hook global ClientClose .* %{ delete-buffer }' asdf.txt
  2. quit using :q

Second way:

  1. Open a terminal and kak -n -d -s asdf
  2. kak -c asdf -e 'hook global ClientClose .* %{ delete-buffer }' asdf.txt
  3. In a new terminal kak -c asdf , you should now see the empty 'asdf.txt' buffer.
  4. quit using :q
  5. select the other kak window and :kill

Outcome

The following stack-trace was printed to the terminal, along with the same message in an xmessage window:

Received SIGSEGV, exiting.
Pid: 1404
Callstack:
kak(_ZN7Kakoune9BacktraceC1Ev+0x18) [0x557acd6f0008]
kak(_ZN7Kakoune14signal_handlerEi+0x64) [0x557acd7dd124]
/usr/lib/libc.so.6(+0x378b0) [0x7f34eb89a8b0]
kak(_ZN7Kakoune13OptionManagerixENS_10StringViewE+0x60) [0x557acd83d7a0]
kak(_ZN7Kakoune11HookManager8run_hookENS_4HookENS_10StringViewERNS_7ContextE+0xcd) [0x557acd79fd5d]
kak(_ZN7Kakoune12InputHandlerC2ENS_13SelectionListENS_7Context5FlagsENS_6StringE+0x15b) [0x557acd7a573b]
kak(_ZN7Kakoune6Window23run_hook_in_own_contextENS_4HookENS_10StringViewENS_6StringE+0xee) [0x557acd896d4e]
kak(_ZN7Kakoune13ClientManager5clearEb+0xfc) [0x557acd70b3bc]
kak(_ZN7Kakoune13BufferManagerD1Ev+0x67) [0x557acd6fe497]
kak(_ZN7Kakoune10run_serverENS_10StringViewES0_S0_NS_8OptionalINS_11BufferCoordEEENS_11ServerFlagsENS_6UITypeENS_10DebugFlagsENS_9ArrayViewIKS0_EE+0xd85) [0x557acd7e44f5]
kak(main+0x232a) [0x557acd6edbea]
/usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f34eb886ce3]
kak(_start+0x2e) [0x557acd6ee4be]
Warning: Missing charsets in String to FontSet conversion

System

Kakoune git 9d52822
/bin/sh : dash 0.5.10.2
shell : zsh 5.7.1
Arch Linux 5.1.9

@nonumeros

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

Open a terminal and kak -n -d -s asdf

uncaught exception (N7Kakoune13runtime_errorE):
unable to bind listen socket '/tmp/kakoune/c/asdf': Address already in use
@lenormf

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

Use kak -clear to remove the sessions created by crashed servers.

@nonumeros

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

Use kak -clear to remove the sessions created by crashed servers.

thanks!

But if that is a segmentation fault, my name is Ramanujan...

@mawww mawww closed this in 5888e23 Jun 16, 2019

eraserhd added a commit to eraserhd/kakoune that referenced this issue Jul 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.