Skip to content

Signal improvements and fixes#201

Merged
mastertheknife merged 8 commits intomasterfrom
signalfixes
Oct 7, 2013
Merged

Signal improvements and fixes#201
mastertheknife merged 8 commits intomasterfrom
signalfixes

Conversation

@mastertheknife
Copy link
Contributor

There were few issues in zm_signal:

  1. The addr2line path was wrong, It showed this:
    addr2line -e /home/kfir/zmwork/ZoneMinder/src/zmc() 0x7ffff7172500 0x42d5c8 0x7ffff4627cdd 0x42cc79
    Instead of this:
    addr2line -e /home/kfir/zmwork/ZoneMinder/src/zmc 0x7ffff7172500 0x42d5c8 0x7ffff4627cdd 0x42cc79
  2. The checking and including of the ucontext header was not properly implemented.
  3. No support for 64bit instruction pointer. It was only checking for EIP, but not RIP.
  4. Displaying backtrace depended on the availability of the sigcontext or siginfo & ucontext structs.
  5. No check for the function backtrace_symbols.
  6. Not including execinfo.h only when available, as this is a GNU extension, just like backtrace and backtrace_symbols.
  7. No handling for Ctrl+C (SIGINT)
  8. sigcontext is undocumented and now deprecated, and shows an invalid instruction pointer when used in ZM

I have made the code more readable, and also used indent -linux to clear the mix of few lines using spaces, while others are using tabs. It converted the whole file to use tabs and did appearance changes to the file

1) Cleaner code
2) Fixed the path displayed in the addr2line line
3) Improved dependency checking for backtrace
4) Few more improvements
…d by siginfo and ucontext)

2) Removed the checks for sigcontext, strsignal and siginfo.h
3) Added debugging code to the die handler
4) Using SA_RESTART in the hup and reload handlers to prevent certain functions returning EINTR
5) Added SIGINT and SIGQUIT to the term handler
@mastertheknife
Copy link
Contributor Author

Anyone objects to merging this?
I want this in 1.26.4

@kylejohnson
Copy link
Member

not here.

mastertheknife added a commit that referenced this pull request Oct 7, 2013
Signal improvements and fixes
@mastertheknife mastertheknife merged commit 022ecf4 into master Oct 7, 2013
@mastertheknife mastertheknife deleted the signalfixes branch October 7, 2013 20:08
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