New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault in 4.0.0 - not-valid-enum - SerialTypes.cc:564 #1487
Comments
From asan:
|
The problem is that we try to look up that value but get back a null pointer (in frame 5 above), and then try to use that null pointer as an index into a table (in frame 4). This shouldn't result in a segfault obviously. It would be enough to just warn and return false from |
There's actually a second bug here aside from the crash. Looking at your scripts, this fails:
but this succeeds:
Note the space after the comma in the failing case is also reported in the trace I pasted in the comment above. The code should probably be stripping that space before trying to do the lookup. I'm not sure what the documentation says about comma-delimited lists like that. |
Why shouldn't it segfault? Assigning to null table index isn't an operation that makes sense to attempt in the first place, so having So the flaws actually may be in the couple recursive usages of Think this should have checked if an error occurred, and if so, break the loop and return zeek/src/threading/SerialTypes.cc Lines 561 to 565 in 7bcf6b4
Same for this loop dealing with vectors: zeek/src/threading/SerialTypes.cc Lines 589 to 593 in 7bcf6b4
|
Not entirely sure about space in comma delimited list is issue. I think the issue is a valid Notice::Type was Scan::KnockKnockScan ( with Upper case "K" - I ended up using lower case - thus config framework is unable to find) However, I am not sure why I wasn't quite able to replicate with Test::blah ( a.zeek script) |
For an enum name like that, it could probably try to be helpful like that since identifiers can't contain space characters, but generally I'm not sure there should be an expectation of stripping whitespace between elements. Like if one has a |
Yes, incorrect casing would be a problem, but it's also still sensitive to whitespace and you can test that. |
Right, after fixing the casing issue it still failed because of the space. It's low-priority though since it's probably been like that forever. |
* origin/topic/timw/1487-not-valid-enum: Move an assert() in input/Manager.cc to account for ValueToVal errors Add test for config framework Fix similar issues with ValueTo* methods in the input framework GH-1487: Handle error from ValueToVal instead of ignoring it
Seeing a segfault when I am trying to use config framework - I can reproduce it at will if I try with all the policies loaded. Trying to zero in to a reproducible script - but I couldn't reduce it further trying with a.zeek - so attaching the tar ball with all scripts.
To reproduce:
not-valid-enum-segfault.tar.gz
I suspect the crash has to do with :
The text was updated successfully, but these errors were encountered: