A full gdb output is available here: http://pastebin.com/3k6SENiX
The issue comes from the fact that fflush(stream) is #define'd as
fflush_unlocked(stream), so fflush(0) actually runs
fflush_unlocked(0), which segfaults with the current version of
musl (but not glibc).
fflush_unlocked() and friends are not part of the standard API
(only getc_unlocked and putc_unlocked are) and it is a mistake
to assume they 1. exist, 2. behave the same as their non-unlocked
The culprit is this commit:
Later commits modify the additions in libbb.h, but those
additions are incorrect in the first place. I will send a
patch that removes them.
busybox mailing list