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

Test with hardening flags #152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mads256h
Copy link

This exposes a OOB access in a vector somewhere.

@mads256h
Copy link
Author

This makes the tests fail on linux because of OOB vector access asserting. Run the workflows on this pr to see this.

This exposes a OOB access in a vector somewhere.
@mads256h
Copy link
Author

mads256h commented Oct 26, 2023

The issue stems from the PetriNet::sort function
More specifically it seems like it is these lines that cause the issue:
The error is triggered in line 176

TransPtr& t2 = _transitions[i + 1];
std::sort(&_invariants[t.outputs], &_invariants[t2.inputs], [](const auto& a, const auto& b) { return a.place < b.place; });

I debugged this with gdb.
With my model I got t2.inputs = 20 and t2.outputs = 20 with _invariants.size() = 20
So we have a off by one error here.
I have attached the project
traffic_light.zip

@srba srba requested review from petergjoel and srba October 30, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant