Skip to content
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

Close #46439 (segmentation error) #46498

Merged
merged 1 commit into from
Jan 3, 2021
Merged

Conversation

actual-nh
Copy link
Contributor

@actual-nh actual-nh commented Jan 2, 2021

Summary

SUMMARY: Infrastructure "Close #46539: Segmentation error in vehicle_level_test"

Purpose of change

Close #46439: Avoid a segmentation error (and hard-to-reconstruct failure) during the vehicle_level_test. (This still fails under the same circumstances, but without a segmentation error.)

Describe the solution

As suggested/found by @anothersimulacrum, do a check for whether dmon_p is null (in this case, due to the player being where the test wanted to create a debug monster).

Describe alternatives you've considered

Well, fixing the bug causing the failure would be nice, but is rather difficult with dealing with segmentation faults & stack corruption (?) problems...

Testing

See #46473.

Additional context

See #46476 for @anothersimulacrum's suggestion, and #46441 for some further analysis of the test failure.

Using a patch suggested by @anothersimulacrum, prevents a segmentation error (instead giving a much more useful failed test).
@BrettDong BrettDong added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 2, 2021
Copy link
Member

@BrettDong BrettDong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that following reproducing instructions in #46441 (comment), cata_test segfaults in master version, and fails without crashing in this PR:

../tests/vehicle_ramp_test.cpp:276: FAILED:
  REQUIRE( dmon_p )
with expansion:
  nullptr

===============================================================================
test cases:    8 |    5 passed | 3 failed
assertions: 2959 | 2956 passed | 3 failed

@ZhilkinSerg ZhilkinSerg merged commit d2b59f8 into CleverRaven:master Jan 3, 2021
@actual-nh actual-nh deleted the patch-5 branch September 7, 2021 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation violation on testing with attempted backtrace using debug symbols
3 participants