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

Fix fork() handling #3

Open
rburchell opened this issue Mar 31, 2017 · 0 comments
Open

Fix fork() handling #3

rburchell opened this issue Mar 31, 2017 · 0 comments

Comments

@rburchell
Copy link
Member

Picture:

  • PID 55 starts, allocates a chunk, logs a duration begin event.
  • PID 55 then forks a child of PID 66
  • They both log a duration end event

Currently, this means that sort of bad things will happen. The SHM chunk will probably be shared between processes (I'm not entirely sure), and on top of that, screwy things happen to the events.

I'm not sure what the right fix for this is, as we can't easily know which "side" of the fork is actually supposed to win. I think we may need a way to flag a chunk as being "ghost events", which are copied from the parent's, and used in the child if necessary (e.g. if an end is seen with no matching begin, try find a ghost event that matches it, otherwise the ghosts are just ignored).

An alternative might be to just say "sorry, don't expect events to work across fork boundaries", and drop them, but that seems a bit harsh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant