The print_failure_backtrace function will cause a segmentation fault
- Dominant language
- Zeek
- Stars
- 2
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/corelight/ztest/blob/7ae8365ccdaad05de77266712bbe22ad55262c1b/scripts/ztest.zeek#L139
```$ cat test.zeek
@load ztest.zeek
ZTest::test_suite("Suite 1");
ZTest::test("Example Test", function() {
ZTest::assert_equal(2, 1, "1 didn't equal 2");
});
ZTest::test("Another Example Test", function() {
ZTest::assert_equal("hi", "hi", "Strings didn't match");
ZTest::assert_instance_of("count", "Hi There", "Instance of didn't work");
ZTest::assert_matches(/foo|bar/, "hi there", "Didn't match when should have");
ZTest::assert_greater_than(+15, +11, "Greater than check failed");
});```
```$ zeek test.zeek
Running Test Suite: Suite 1
------------------------------------
Running Test: Example Test
Assert Failed: 1 didn't equal 2 (Suite 1/Example Test)
Expected: 2
Actual: 1
Backtrace:
Segmentation fault: 11```
Removing the call to this function at this line resolves the seg fault.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.