Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash when loading many small rules files #906
I found a crash bug in Falco that occurs when Falco loads lots of relatively small files with lots of macros. It doesn’t seem to be a bug in falco itself, a stack trace from a debug build shows the crash is in the lua garbage collector:
The full command line that reproduces the crash is
You'll need a recent dev build of falco, as that has support for the psp related fields in the rules files. I was using 0.1.2709dev.
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
After compiling luajit with assertions, I found that the problem was here:
I don't know why this pops 4 values from the stack when the function only returns 2 values, but it was introduced in 1711ed0.
It only shows up after a large number of files because there are ~10 tables on the stack from the various calls to luaL_openlib(), plus some time for the stack to be corrupted and the garbage collector to kick in and crash.
Changing the pop to 2 values fixes the problem.