-
Notifications
You must be signed in to change notification settings - Fork 455
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
Tofino backend: compiler bug when extracting varbit header #5138
Comments
@alexandergall -- just to make sure: would you expect the compiler to mark the code in the state
as invalid and return an error (because only whole bytes can be extracted) or something else? |
The expected result is
This is what |
Is there a fix for this in SDE 9.13.4 source code that is not in the public p4lang/p4c repository that might address this, that someone at Intel could contribute? Or is this issue perhaps introduced by changes in the p4lang/p4c Tofino backend code since it was released to the public? |
I checked and both SDE-9.13.3 and even 9.13.1 produce the expected error message for the provided program. Therefore, this looks like an issue that was inadvertently introduced in the public backend. |
Getting the stacktrace of this particular exception could be helpful. I currently do not have the bf-p4c binary at hand. |
How do I enable stack traces for exceptions? |
@alexandergall maybe |
If Vladimir's suggestion does not work you could install |
I use GDB with However, by default the compiler is built without debug symbols, so you will need to rebuild it accordingly, e.g. with Here is the output I have for @alexandergall 's program:
|
Thanks for the hints. I can reproduce @vgurevich's result. |
This looks like a bug introduced by #5018. We are probably accessing an annotation in an unsafe way. |
It will be another exception then, thrown in |
Versions:
Compiling the attached P4 program (as GZIP since GitHub does not allow a
.p4
extension) with open-p4studio produces the following errorThe error only occurs when extracting a
varbit
header field.The build was prepared with
bug.p4.gz
The text was updated successfully, but these errors were encountered: