Repository navigation
Description
Describe the Bug
Hi, nice to see you back on the project. 🙂
I'm experiencing crashes with v1.5.0. This isn't happening in 1.3, 1.4.
With v1.5.0 across two different bash versions. I have captured two separate crash logs to show the bug is consistent.
Crash 1:
- bash 5.2.21(1)-release
- Happened during normal use
- See fl1.log
Crash 2:
- bash 5.3.0(1)-release
- Happened immediately when enabling flyline from the terminal with
enable -f libflyline.so.1.5.0 flyline - Before crashing, garbled escape codes appeared in the terminal:
^[[7;1Rand;1R— these look like cursor position query responses that flyline left on the terminal when it crashed mid-operation - The prompt also lost its newline formatting after the crash
- I was able to reproduce this crash consistently
- See fl2.log
Note on my prompt:
I have this in my PROMPT_COMMAND to add a newline after command output:
printf '\e[6n' >/dev/tty; IFS='[;' read -sdR _ row _ < /dev/tty; ((row==1)) || echoThis sends a cursor position query (\e[6n) to the terminal. It is possible this interacts badly with flyline's own cursor position queries when flyline is initializing, and might be related to the garbled escape codes seen in Crash 2.
Flyline's background cache warming thread appears to be colliding with the main thread on shared bash state. Both crashes point to the same internal function (get_cached_shell_functions) but hitting slightly different points each time. Race condition?
Environment & Version Information
flyline 1.5.0
git hash: d437a50
build mode: release
build datetime: 2026-08-03T22:28:40Z
build target: x86_64-unknown-linux-gnu
rustc version: rustc 1.97.1 (8bab26f4f 2026-07-14)
Running in: Bash 5.3.0(1)-release
shell: /bin/bash
Running in: xterm-256color
program: WezTerm
program version: 20240203-110809-5046fc22
locale: en_US.UTF-8 (LC_ALL: unknown, LC_CTYPE: unknown)
Running in: Linux Mint 22.3 (kernel 6.8.0-137-generic x86_64)
system linker: GNU ld (GNU Binutils for Ubuntu) 2.42
dynamic linker: ldd (Ubuntu GLIBC 2.39-0ubuntu8.8) 2.39
Running on: AMD Ryzen 5 5500 (12 cores)
Running in: a simulation
Debug Logs (Optional / If Necessary)
Click to expand logs
<paste logs here>
Steps to Reproduce
-
Enable flyline in bash 5.2.21:
enable -f libflyline.so.1.5.0 flyline -
Use the shell normally (tab completion, general commands)
-
Crash happens during normal use, not always immediately
-
Have this in PROMPT_COMMAND:
printf '\e[6n' >/dev/tty; IFS='[;' read -sdR _ row _ < /dev/tty; ((row==1)) || echo -
Start bash 5.3.0
-
Enable flyline:
enable -f libflyline.so.1.5.0 flyline -
Crash happens immediately with garbled escape codes
visible in the terminal:^[[7;1Rand;1R
Activity
HalFrgrd commentedon Aug 9, 2026
Thanks for the detailed issue! I wasnt able to reproduce it locally but using your crash logs I may have found the problem. I've made #895.
With the next release, could you please test if flyline still crashes for you? If it does, could you confirm if it still crashes when you remove your PROMPT_COMMAND? e.g. start bash with
bash --norcthen runenable -f libflyline.so flyline.I think the reason you see garbled escape codes is that another flyline thread is blocked on
get_cursor_position. inget_cursor_position, flyline sends \e6n , then crashes before it reads the response and the response is printed to the terminal because flyline isnt around to read it. I doubt your PROMPT_COMMAND will interact with flyline since they run one after another.RVC2020 commentedon Aug 9, 2026
Sure, if you'd like me to compile and test PR #895 so you don't have to make a new release, I can do that. I still have the Rust toolchain in Docker from the previous bug I reported. Just let me know.
HalFrgrd commentedon Aug 9, 2026
Thanks, I just saw this. I've just released v1.6.0. let me know if the bug persists!
RVC2020 commentedon Aug 11, 2026
Good news - The latest releases seem to have fixed
get_cached_shell_functionsbug. (I am on v1.6.2).Bad news - I got a similar crash because of
synthesize_from_helpandget_cwdhitting the same class of problem.fl-1.6.2-crash.log
At this point, I think we should officially list my CPU as a project contributor; it finds bugs faster than any test suite. 😀
For the record, I think you were right about
PROMPT_COMMAND, it does not seem to interfere with Flyline. I waswrong to suggest it earlier.
I propose renaming this thread and turning it into a tracking issue for this class of bugs. So I can keep posting new crash logs
here instead of opening a new issue each time.
HalFrgrd commentedon Aug 11, 2026
😄 there is something about your setup that catches every race condition! I have a very similar setup so it puzzles me why I dont see them.
Thanks for the crash log. I've figure out how to insert a shim that checks every thread that wants to access the bash allocator is the main thread. This helps me detect the problem your experiencing locally.
It's quite interesting. I try and make flyline use a separate allocator because bash's allocator isn't thread safe. But what your crash log shows is that during thread startup / exit, it calls some glibc function
__cxa_thread_atexit_implwhich then tries to callmallocwhich resolves to bash's non thread safe allocator. Flyline can't control what glibc calls!I will need to investigate a solution when I have more time. Possibly starting the threads all at once at startup and then reusing them.
RVC2020 commentedon Aug 11, 2026
I noticed on one of your bug reports that you were using a
Ryzen 7 5700Gon Ubuntu. So yeah, fun puzzle.My best guess is it has something to do with my Docker stack. I have several containers with active network I/O, plus a WireGuard VPN handling regular traffic. Wireguard might be particularly disruptive for the kernel scheduler since it runs in kernel space, generating constant interrupts.
Take your time. This problem seems anything but trivial, and Flyline has enough features to keep us users busy for a while.
Safe threads only (#918)
HalFrgrd commentedon Aug 14, 2026
Ive decided to stop using threads. I couldnt find a convenient way to use them without leading to concurrent bash allocator access. I made fork of bash that crashes when it detects concurrent bash allocator access so that I could recreate your bugs. So hopefully this fixes this entire class of bug! Ofc, please let me know if you do experience any more. I imagine other people tried flyline, it crashed and then they never tried it again. And thanks for your helpful stacktraces!
If you could test the latest flyline master build (you download the CI build from https://github.com/HalFrgrd/flyline/actions/runs/31841804067 , look for
built-flyline-library) I would be very grateful. I'll probably release a new version this weekend.RVC2020 commentedon Aug 15, 2026
Ok, I'll test it:
Don't be too hard on yourself. You're not a billion-dollars company with hundreds of beta testers. When I first saw you announcing Flyline on Reddit, I was expecting far more bugs and far fewer features.
todated commentedon Aug 19, 2026
since 1.7.0 i'm no longer having crashes like this;
(this had been a blocker for me across the previous few versions that i tried)
glad to be able to now use flyline as my default/daily driver;
thank you;