diff options
author | ssteinbach <ssteinbach@github.com> | 2015-06-21 21:45:30 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-09-30 17:54:24 +0200 |
commit | 6c496db4b75eff9cb5fc417222e83511e7e0ca15 (patch) | |
tree | 1e30a9b2b788edc8f30e290618b0d1c9ebf319a5 /test/functional/api/vim_spec.lua | |
parent | 84fcba9b01a15a8defbae9ef2fa798cf55176af4 (diff) | |
download | rneovim-6c496db4b75eff9cb5fc417222e83511e7e0ca15.tar.gz rneovim-6c496db4b75eff9cb5fc417222e83511e7e0ca15.tar.bz2 rneovim-6c496db4b75eff9cb5fc417222e83511e7e0ca15.zip |
undo: Fix infinite loop if undo_read_byte returns EOF #2880
Problem: Corrupt(?) persistent undofile leads to an infinite loop.
Solution: Break out of loop if undo_read_byte returns EOF (cf.
u_read_undo() which does this too).
backtrace from lldb (@ a743297be2b3):
Process 70700 stopped
* thread 1: tid = 0x147d2d1, 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame 0: 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209
libsystem_pthread.dylib`__mtx_droplock + 209:
-> 0x7fff8c8facd7: movq %rcx, -0x50(%rbp)
0x7fff8c8facdb: movq %r8, -0x58(%rbp)
0x7fff8c8facdf: movq %rdx, -0x68(%rbp)
0x7fff8c8face3: movq %r14, -0x60(%rbp)
(lldb) bt
* thread 1: tid = 0x147d2d1, 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame 0: 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209
frame 1: 0x00007fff8c8fab4e libsystem_pthread.dylib`pthread_mutex_unlock + 63
frame 2: 0x00007fff915da2a4 libsystem_c.dylib`getc + 63
frame 3: 0x000000010e6194b9 nvim`undo_read_byte(bi=0x00007fff5181a838) + 25 at undo.c:1553
frame 4: 0x000000010e619685 nvim`unserialize_uhp(bi=0x00007fff5181a838, file_name=0x000000000f2e8060) + 421 at undo.c:840
frame 5: 0x000000010e618abb nvim`u_read_undo(name=0x0000000000000000, hash=0x00007fff5181af80, orig_name=0x000000000f370dd0) + 1579 at undo.c:1363
frame 6: 0x000000010e4a8db9 nvim`readfile(fname=0x000000000f370dd0, sfname=0x000000000f370dd0, from=0, lines_to_skip=0, lines_to_read=2147483647, eap=0x00007fff5181b6a0, flags=1) + 21017 at fileio.c:
1961
frame 7: 0x000000010e3ecc8b nvim`open_buffer(read_stdin=0, eap=0x00007fff5181b6a0, flags=0) + 603 at buffer.c:153
...
closes #2879
closes #2880
Diffstat (limited to 'test/functional/api/vim_spec.lua')
0 files changed, 0 insertions, 0 deletions