-
Notifications
You must be signed in to change notification settings - Fork 47
Some plugins hold live pointers beyond liveness scope #45
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
Comments
There may be more examples of this. In general, passes can only ensure liveness of RTLIL objects within the scope of the pass, and no longer. Holding these pointers between invocations is not safe, and will result in memory corruption in some circumstances. |
@tmichalak This is the highest priority issue, and must be resolved. This is not optional. |
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
@litghost so for SDC the issue is that we are storing pointers to RTLIL::Wire* in the Clock objects, right? |
You cannot hold the pointers at all. It is not a safe behavior. My recommendation is to defer module inspection until when you are ready to do so (e.g. write_sdc). Having intermediate Pointer checks are useless here, because yosys deleting an address won't update the pointer copy held in the Clocks object. |
@litghost I created a draft PR targeting the issue. |
This is correct, but the SDC plugin doesn't get a signal from Yosys that the relevant objects no longer exists, hence the memory corruption angle. |
The current implementation of the SDC plugin holds RTLIL objects between TCL commands. Because of this, changes to those pointers (e.g. techmap passes, etc) cause those pointers to become invalid.
Test case for the SDC plugin attached: test.zip
The text was updated successfully, but these errors were encountered: