Skip to content

don't let root objects go out of scope #1084

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

Closed
wants to merge 1 commit into from

Conversation

danslo
Copy link
Contributor

@danslo danslo commented Sep 22, 2013

Similar to m_domNode, we must store a reference to the root object.

We may need the root object to do xpath lookups on child objects, regardless of parent object going out of scope.

The attached test is self-explanatory.

Similar to m_domNode, we must store a reference to the root object.

We may need the root object to do xpath lookups on child
objects, regardless of parent object going out of scope.
@danslo
Copy link
Contributor Author

danslo commented Sep 22, 2013

Actually I'm not sure if you should keep merging these kind of small patches. We keep adding more and more edge-cases to an already pretty ugly/old extension.

[11:55] <+danslo_> ugh I so want to get rid of ext_simplexml.cpp and just adapt php-src simplexml ext... except it's 3000+ lines of code, probably less performant, and will be a bitch to convert...
[11:56] <+danslo_> either that or ext_simplexml needs a major refactor, especially for strings

Trying to decide what to do at this point.

@scannell
Copy link
Contributor

We are very light users of simplexml so adapting/converting the current simplexml is a reasonable approach here even if it's a bit slower -- we are unlikely to notice for our purposes and it's not an area we would (or likely ever have) spent any time tuning. I'll hold off on this until further comment.

@scannell
Copy link
Contributor

@danslo, do you want to close this PR if you're going the other route (which I think is probably the right call?)

@danslo
Copy link
Contributor Author

danslo commented Sep 25, 2013

Yes. :)

@danslo danslo closed this Sep 25, 2013
@danslo danslo deleted the xpath-scope branch December 3, 2013 05:20
facebook-github-bot pushed a commit that referenced this pull request Apr 12, 2025
… Drop Package: crossbeam-channel 0.5.14

Summary:
VULNERABILITY RUSTSEC-2025-0024 - 2025-04-08: crossbeam-channel: double free on Drop
Package: crossbeam-channel 0.5.14

The internal `Channel` type's `Drop` method has a race
which could, in some circumstances, lead to a double-free.
This could result in memory corruption.

Quoting from the
[upstream description in merge request \#1187](crossbeam-rs/crossbeam#1187 (comment)):

> The problem lies in the fact that `dicard_all_messages` contained two paths that could lead to `head.block` being read but only one of them would swap the value. This meant that `dicard_all_messages` could end up observing a non-null block pointer (and therefore attempting to free it) without setting `head.block` to null. This would then lead to `Channel::drop` making a second attempt at dropping the same pointer.

The bug was introduced while fixing a memory leak, in
upstream [MR \#1084](crossbeam-rs/crossbeam#1084),
first published in 0.5.12.

The fix is in
upstream [MR \#1187](crossbeam-rs/crossbeam#1187)
and has been published in 0.5.15

Reviewed By: dtolnay

Differential Revision: D72915462

fbshipit-source-id: c53113f91eedf478646588a84d0fa3aa85a6d2a0
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.

2 participants