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

workaround for https://github.com/libunwind/libunwind/issues/425 #432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hidva
Copy link

@hidva hidva commented Oct 31, 2022

No description provided.

@@ -430,7 +432,10 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size)
d->stash_frames = 0;
return -UNW_ENOMEM;
}
if (cache->frame_rc > 0)
Copy link
Member

Choose a reason for hiding this comment

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

So this just fails nested requests?

Copy link
Author

Choose a reason for hiding this comment

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

Yes


cache->frame_rc = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Won't this fail if there are multiple nested requests? It is a 'reference count', but apparently it doesn't actually count?

Copy link
Author

Choose a reason for hiding this comment

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

Won't this fail if there are multiple nested requests?

Yes

It is a 'reference count', but apparently it doesn't actually count?

At first, I thought of using frame_rc to represent the reference count of unw_trace_cache_t.frames, and munmap(frames) should be delayed until when frame_rc is 0. Then I realized that the current PR is just a workaround, let’s not make it so complicated. Currently, frame_rc is used to indicate whether frames is being used, if so, nested requests will not be allowed to use frames again.

Copy link
Author

Choose a reason for hiding this comment

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

I can rename frame_rc toin_use if needed.

@bregma
Copy link
Member

bregma commented May 18, 2023

Linking to issue #425 directly.

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.

None yet

3 participants