tup icon indicating copy to clipboard operation
tup copied to clipboard

Unexpected output of the generate command

Open b00bl1k opened this issue 1 year ago • 0 comments

I use tup for building the kolibrios project, which has quite a large build configuration. Recently, I encountered an issue with the generate command: it outputs a sequence of random bytes instead of the expected build command.

I investigated the problem and managed to identify the source of the issue. In the function tuplua_function_definerule, the variable r.command initially contains the correct command. However, the contents of this variable become corrupted after a call to the parse_dependent_tupfiles function. Using gdb, I set a data breakpoint on the r.command content and discovered that the corruption occurs during memory deallocation in the l_alloc function. My assumption is that the garbage collector might be destroying the command table, but I am unsure if this behavior is correct.

I tried tup 0.8 and git versions. Here is the full backtrace: tup-backtrace.txt

b00bl1k avatar Jan 11 '25 19:01 b00bl1k