[all-commits] [llvm/llvm-project] 6a1857: Support custom attributes in pthread_create

goldsteinn via All-commits all-commits at lists.llvm.org
Mon May 22 13:54:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a185718d4a29d17a389d0c50419e7e36ac3c866
      https://github.com/llvm/llvm-project/commit/6a185718d4a29d17a389d0c50419e7e36ac3c866
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M libc/src/__support/threads/linux/thread.cpp
    M libc/src/__support/threads/thread.h
    M libc/src/pthread/CMakeLists.txt
    M libc/src/pthread/pthread_attr_getstack.cpp
    M libc/src/pthread/pthread_attr_init.cpp
    M libc/src/pthread/pthread_attr_setstack.cpp
    M libc/src/pthread/pthread_attr_setstacksize.cpp
    M libc/src/pthread/pthread_create.cpp
    M libc/src/threads/thrd_create.cpp
    M libc/test/integration/src/__support/threads/thread_detach_test.cpp
    M libc/test/integration/src/pthread/CMakeLists.txt
    A libc/test/integration/src/pthread/pthread_create_test.cpp

  Log Message:
  -----------
  Support custom attributes in pthread_create

Only functional for stack growsdown (same as before), but custom
`stack`, `stacksize`, `guardsize`, and `detachstate` all should be
working.

Differential Revision: https://reviews.llvm.org/D148290


  Commit: 916e9be4aa0aa4bfa3ab0f1b3f91e59b81dc10b2
      https://github.com/llvm/llvm-project/commit/916e9be4aa0aa4bfa3ab0f1b3f91e59b81dc10b2
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M libc/src/__support/threads/linux/thread.cpp
    M libc/src/__support/threads/thread.h

  Log Message:
  -----------
  Cleanup code in `thread_exit`

1) Avoid proper function calls and referencing local variables after
the stack has been deallocated. A proper function call/return or local
variable reference that may have spilled will cause invalid memory
reads after the stack has been deallocated.

2) Mark the function as [[noreturn]] and place
`__builtin_unreachable()` after the `SYS_exit` syscalls.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D151142


  Commit: e0b8f98b1f488f56ff383de37edb97e1909acbbd
      https://github.com/llvm/llvm-project/commit/e0b8f98b1f488f56ff383de37edb97e1909acbbd
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M libc/spec/posix.td
    M libc/src/pthread/pthread_exit.h
    M libc/src/stdlib/exit.h

  Log Message:
  -----------
  Add some missing [[noreturn]] attributes

Missing in header for `pthread_exit` and `exit`.

Missing in spec file for `pthread_exit`.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D151143


Compare: https://github.com/llvm/llvm-project/compare/ae5ff3ca0cd9...e0b8f98b1f48


More information about the All-commits mailing list