OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.5 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/convert-hangs-to-crashes.patch
  5. # Copyright (C) 2020 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff --git a/src/process/fork.c b/src/process/fork.c
  17. index 7e984ff8..c4fa7510 100644
  18. --- a/src/process/fork.c
  19. +++ b/src/process/fork.c
  20. @@ -30,7 +30,7 @@ pid_t fork(void)
  21. self->next = self->prev = self;
  22. __thread_list_lock = 0;
  23. libc.threads_minus_1 = 0;
  24. - if (libc.need_locks) libc.need_locks = -1;
  25. + if (libc.need_locks > 0) libc.need_locks = -2;
  26. }
  27. __restore_sigs(&set);
  28. __fork_handler(!ret);
  29. diff --git a/src/thread/__lock.c b/src/thread/__lock.c
  30. index 60eece49..75412cc8 100644
  31. --- a/src/thread/__lock.c
  32. +++ b/src/thread/__lock.c
  33. @@ -24,6 +24,7 @@ void __lock(volatile int *l)
  34. int current = a_cas(l, 0, INT_MIN + 1);
  35. if (need_locks < 0) libc.need_locks = 0;
  36. if (!current) return;
  37. + if (need_locks < -1) a_crash();
  38. /* A first spin loop, for medium congestion. */
  39. for (unsigned i = 0; i < 10; ++i) {
  40. if (current < 0) current -= INT_MIN + 1;