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

There is no nullptr check after call to erts_prtsd_get in erts_dist_command #9413

Open
pinskia opened this issue Feb 10, 2025 · 1 comment · May be fixed by #9417
Open

There is no nullptr check after call to erts_prtsd_get in erts_dist_command #9413

pinskia opened this issue Feb 10, 2025 · 1 comment · May be fixed by #9417
Assignees
Labels
enhancement team:VM Assigned to OTP team VM

Comments

@pinskia
Copy link

pinskia commented Feb 10, 2025

This comes via https://gcc.gnu.org/PR118821 .

Since erts_prtsd_get can return a nullptr (0), GCC will isolate the null ptr access path and that can cause extra warnings to show up. In the case of the reported issue is extra warning with respect of an atomic store that might be storing to a null ptr offset.

It is better if add an assert or some other thing of protection here to make sure erts_prtsd_get does not get a nullptr.

https://github.com/erlang/otp/blob/29138f5dd1618d197ff382e7748756bd904678f7/erts/emulator/beam/dist.c#L3874C16-L3874C20 is the location I am talking about.

@jhogberg jhogberg self-assigned this Feb 11, 2025
@jhogberg jhogberg added team:VM Assigned to OTP team VM enhancement labels Feb 11, 2025
@jhogberg
Copy link
Contributor

Thanks for your report! As much as I believe that warnings of that kind are counterproductive, I will add an assumption to placate the compiler.

@jhogberg jhogberg linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants