• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiona7d538fddb21427681704e027e2fdea2bed686c7 (tree)
Zeit2018-08-10 23:02:45
AutorChristophe Lyon <christophe.lyon@st.c...>
CommiterWaldemar Brodkorb

Log Message

nptl threads: Fix bug in using a weak variable.

In case nptl_nthreads is not defined in the final binary then avoid
dereferencing the address since it's null. Anyway this means there is
no other thread and so we must exit.

* libc/misc/internals/uClibc_main.c (uClibc_main): Handle case
where &nptl_nthreads is null.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

Ändern Zusammenfassung

Diff

--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -544,7 +544,7 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
544544 result = 0;
545545 unsigned int *const ptr = &__nptl_nthreads;
546546
547- if (! atomic_decrement_and_test (ptr))
547+ if (ptr && ! atomic_decrement_and_test (ptr))
548548 /* Not much left to do but to exit the thread, not the process. */
549549 __exit_thread_inline (0);
550550 }