Skip to content

Fix a bug in PR9742: in naked pointers mode, the code could dereference a pointer before checking it is not a naked pointer.#9989

Merged
gasche merged 1 commit intoocaml:trunkfrom
jhjourdan:fixPR9742
Oct 29, 2020
Merged

Fix a bug in PR9742: in naked pointers mode, the code could dereference a pointer before checking it is not a naked pointer.#9989
gasche merged 1 commit intoocaml:trunkfrom
jhjourdan:fixPR9742

Conversation

@jhjourdan
Copy link
Copy Markdown
Contributor

@jhjourdan jhjourdan commented Oct 24, 2020

Algo fix a debug macro changed in #9742 which could potentially
modify its parameter. It turns out this is not a bug, but the macro
was still particularly dangerous.

@jhjourdan
Copy link
Copy Markdown
Contributor Author

I did not include a test for this bug, since it seems particularly difficult to reproduce in practice. Also, the bug only occured in naked pointers mode, which should hopefully disappear soon.

@jhjourdan
Copy link
Copy Markdown
Contributor Author

Cc @bobot.

@jhjourdan
Copy link
Copy Markdown
Contributor Author

Of course, this is a bugfix, so this is a candidate for cherry-picking in 4.12.

dereference a pointer before checking it is not a naked pointer.

Algo fix a debug macro changed in PR9742 which could potentially
modify its parameter. It turns out this is not a bug, but the macro
was still particularly dangerous.
@jhjourdan
Copy link
Copy Markdown
Contributor Author

Thanks for the review! Do you have other comments?

@xavierleroy, @damiendoligez : Could you give your approval before merging?

Copy link
Copy Markdown
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

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

I'm not familiar with this part of the runtime system, but this looks like a good fix.

@gasche gasche merged commit 3a094eb into ocaml:trunk Oct 29, 2020
@gasche
Copy link
Copy Markdown
Member

gasche commented Oct 29, 2020

@Octachron I think this is something we probably want to backport in 4.12. Would you, by chance, be available to do the backport?

@Octachron
Copy link
Copy Markdown
Member

Certainly, I will cherry-pick to 4.12 .

Octachron pushed a commit that referenced this pull request Oct 29, 2020
Fix a bug in PR9742: in naked pointers mode, the code could dereference a pointer before checking it is not a naked pointer.

(cherry picked from commit 3a094eb)
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.

5 participants