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

Add a `crash-handler.wait-pipe-close` parameter #1092

Merged
merged 3 commits into from Jan 18, 2017

Conversation

Projects
None yet
2 participants
@deweerdt
Member

deweerdt commented Sep 29, 2016

If this parameter is set to true, the crash handler will wait until the
pipe opened to the crash handler is closed by it. This is useful if the
crash handler is ptracing the main process in order to get more
information.

Add a `crash-handler.wait-pipe-close` parameter
If this parameter is set to true, the crash handler will wait until the
pipe opened to the crash handler is closed by it. This is useful if the
crash handler is ptracing the main process in order to get more
information.
@kazuho

This comment has been minimized.

Show comment
Hide comment
@kazuho

kazuho Sep 30, 2016

Member

Thank you for the PR. Before going into the details, please let me understand the background.

I would like to know the reason you are using ptrace from the crash handler. Do you start ptrace-ing when the server process crashes?

Member

kazuho commented Sep 30, 2016

Thank you for the PR. Before going into the details, please let me understand the background.

I would like to know the reason you are using ptrace from the crash handler. Do you start ptrace-ing when the server process crashes?

@deweerdt

This comment has been minimized.

Show comment
Hide comment
@deweerdt

deweerdt Sep 30, 2016

Member

I would like to know the reason you are using ptrace from the crash handler. Do you start ptrace-ing when the server process crashes?

Yes, that's correct, on SIGSEGV we ptrace the crashing process and extract debugging information.

Member

deweerdt commented Sep 30, 2016

I would like to know the reason you are using ptrace from the crash handler. Do you start ptrace-ing when the server process crashes?

Yes, that's correct, on SIGSEGV we ptrace the crashing process and extract debugging information.

@deweerdt

This comment has been minimized.

Show comment
Hide comment
@deweerdt

deweerdt Oct 4, 2016

Member

Updated to use poll(2) instead of write(2) to detect the pipe closing.

Member

deweerdt commented Oct 4, 2016

Updated to use poll(2) instead of write(2) to detect the pipe closing.

Show outdated Hide outdated src/main.c
struct pollfd pfd[1];
pfd[0].fd = crash_handler_fd;
pfd[0].events = POLLERR | POLLHUP;
poll(pfd, 1, -1);

This comment has been minimized.

@kazuho

kazuho Oct 28, 2016

Member

It might be wiser to check for EINTR (and call poll again in such case), considering the fact that signals other than the one that is being handled by this signal handler may preempt the execution of poll.

@kazuho

kazuho Oct 28, 2016

Member

It might be wiser to check for EINTR (and call poll again in such case), considering the fact that signals other than the one that is being handled by this signal handler may preempt the execution of poll.

@kazuho

Thank you for the update, sorry for the delay.

Looks fine to me aside from the nitpicking comment.

@deweerdt

This comment has been minimized.

Show comment
Hide comment
@deweerdt

deweerdt Oct 28, 2016

Member

Done in c30db4e, thanks!

Member

deweerdt commented Oct 28, 2016

Done in c30db4e, thanks!

@kazuho kazuho added this to the v2.2 milestone Nov 7, 2016

@kazuho kazuho merged commit c30db4e into h2o:master Jan 18, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

kazuho added a commit that referenced this pull request Jan 18, 2017

Merge pull request #1092
Add a `crash-handler.wait-pipe-close` parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment