02-use-in-run_test.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. commit 8189e0be69cc063844214e4363f5acb28fa2aad0
  2. author: prettyboy
  3. date: 2020-05-28T16:23:43+03:00
  4. revision: 6880919
  5. Use faulthandler in the run_test to dump extra info in case of receiving term signal
  6. issue:DEVTOOLSSUPPORT-1110
  7. REVIEW: 1279410
  8. --- contrib/deprecated/python/faulthandler/faulthandler.c (97a2dfa5400dd696c5eff33a9faa46526011a0ac)
  9. +++ contrib/deprecated/python/faulthandler/faulthandler.c (8189e0be69cc063844214e4363f5acb28fa2aad0)
  10. @@ -117,6 +117,13 @@ static user_signal_t *user_signals;
  11. static void faulthandler_user(int signum);
  12. #endif /* FAULTHANDLER_USER */
  13. +#ifndef SI_KERNEL
  14. +#define SI_KERNEL 0x80
  15. +#endif
  16. +
  17. +#ifndef SI_TKILL
  18. +#define SI_TKILL -6
  19. +#endif
  20. static fault_handler_t faulthandler_handlers[] = {
  21. #ifdef SIGBUS
  22. @@ -409,6 +416,7 @@ read_proc_exe(pid_t pid, char* buff, size_t len) {
  23. }
  24. }
  25. +#ifdef HAVE_SIGACTION
  26. static void
  27. faulthandler_fatal_error_siginfo(int signum, siginfo_t* siginfo, void* ctx)
  28. {
  29. @@ -454,6 +462,7 @@ faulthandler_fatal_error_siginfo(int signum, siginfo_t* siginfo, void* ctx)
  30. errno = save_errno;
  31. }
  32. +#endif
  33. #ifdef MS_WINDOWS
  34. extern void _Py_dump_hexadecimal(int fd, unsigned long value, size_t bytes);