michaelforney / samurai

ninja-compatible build tool written in C
Other
832 stars 47 forks source link

Dry run (`-n`) can crash samurai #66

Closed bromptonian closed 3 years ago

bromptonian commented 3 years ago

Hi. With the following build.ninja:

build nothing: phony

running samu -n will cause the following:

Program received signal SIGSEGV, Segmentation fault.

Backtrace:

(gdb) backtrace
#0  0x000000000040ce22 in strlen ()
#1  0x000000000040a444 in fputs_unlocked ()
#2  0x000000000040ab75 in puts ()
#3  0x00000000004015db in printstatus ()
#4  0x0000000000401bcf in build ()
#5  0x0000000000405a09 in main ()

Tested with latest master 79956e2 on Linux, compiled with musl.

Thank you for your work on samurai.

anonyno commented 3 years ago

imo, this is worth the new release.