hledger-ui can crash from keyboard input at startup
Steps to reproduce (I'm using version 1.9):
$ hledger ui -f file
<press any key before interface loads (you have to be fast or just very impatient)>
<get error which closes the program, usually segfault>
Wow.. thanks for the report. I can reproduce by hledger-ui <ENTER><ENTER><ENTER><ENTER>.
I'm not able to reproduce this in master. Is this still relevant or can it be closed?
I can still reproduce this with hledger-1.21, though it's not that easy. I load the 1000 transaction sample journal and hammer on the enter key as fast as I can. I see it die every N attempts, where N is somewhere between 10 and 100. On mac it looks like:
$ hledger-ui -f examples/1000x1000x10.journal<ENTER><ENTER><ENTER><ENTER><ENTER>...
...
123:124:125:126:127:128:129:12a -149.00 T, -772.31 Z
123:124:125:126:127:128:129:12a:12b 150.00 T, 650.00 Z
123:124:125:126:127:128:129:12a:12b:12c -650.00 A, -150.00 T
────────────────────────────────────────────────────────────────── ?:help t:list/tree -+:depth H:end-bals/changes F:forecast a:add q:quit ──────────────────────────────────────────────────────────────────hledger-ui(40710,0x2016ace00) malloc: *** error for object 0x7fd964e040d0: pointer being freed was not allocated
hledger-ui(40710,0x2016ace00) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
$
On gnu/linux it looks like:
$ hledger-ui -f examples/1000x1000x10.journal<ENTER><ENTER><ENTER><ENTER><ENTER>...
Segmentation fault (core dumped)
$
A much faster way to reproduce it:
$ while true; do hledger-ui -f examples/1000x1000x10.journal || break; sleep 0.1; done
and hammer on the q key until it breaks.
A good next step would be to try this with a minimal brick app.
Another way to reproduce it on GNU/Linux and X11; in my case it breaks 100% of the times I tried:
$ xdotool type "asdf"; hledger-ui
asdfSegmentation fault (core dumped)
I couldn't reproduce this today on mac. Would appreciate any confirmations that this is still reproducible with hledger-ui 1.43 (all platforms).