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

Try to fix dangling reference flagged by CI #857

Merged
merged 3 commits into from
Feb 11, 2025
Merged

Conversation

MatthewDaggitt
Copy link
Collaborator

The CI in various places is failing:
e.g. https://github.com/NeuralNetworkVerification/Marabou/actions/runs/12862710327/job/35858064473#step:12:122

because of a dangling reference. AttributeProto object may be deassigned as it is a local, so therefore better simply to return a copy of the TensorProto object.

@MatthewDaggitt
Copy link
Collaborator Author

Well even though the tests are still failing, they are failing at a later point so this seems like an improvement?

Copy link
Collaborator

@wu-haoze wu-haoze left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!!

Update: Whoops, just realized it didn't fix the entire CI..

@MatthewDaggitt
Copy link
Collaborator Author

No it doesn't fix it completely. I'm unsure why suddenly the compiler is being much more strict? If I get some spare time I'll look at it, but I think it's unlikely to happen in the next couple of weeks...

@@ -20,7 +20,7 @@
#include "File.h"
#include "InputParserError.h"

#include <regex>
#include <boost/regex.hpp>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Turns out I could reproduce the CI error on my end with the debug build.

It seems that std::regex is not very stable https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61582. I tried to bump our C++ -std flag but that creates more issues.

On the other hand using boost/regex seems to fix the issue on my end...

@@ -353,15 +353,15 @@ int getRequiredIntAttribute( onnx::NodeProto &node, String name )
return attr->i();
}

const onnx::TensorProto getTensorAttribute( onnx::NodeProto &node, String name )
const onnx::AttributeProto *getTensorAttribute( onnx::NodeProto &node, String name )
Copy link
Collaborator

@wu-haoze wu-haoze Feb 10, 2025

Choose a reason for hiding this comment

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

Turns out making copy of TensorProto can be inefficient and caused the CI to time out. I modified the code to be functionally the same as the master branch.

@MatthewDaggitt
Copy link
Collaborator Author

Nice finds. Seems to be passing so merge?

@wu-haoze
Copy link
Collaborator

Nice finds. Seems to be passing so merge?

Sounds good!

@wu-haoze wu-haoze merged commit 81d71a2 into master Feb 11, 2025
11 checks passed
@wu-haoze wu-haoze deleted the dangling-reference branch February 11, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants