Amar Takhar commented: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5641#note_154343 Here are my results. ```shell FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2) Target: x86_64-unknown-freebsd15.0 ``` ```shell # c++ -Wall -g -o lock -lpthread lock.cpp # ./lock locking test main: m1 at0x820d4a6b0 main: lock: m1 t1: unlock: m at 0x820d4a6b0 Illegal instruction (core dumped) ./lock ``` ```shell (gdb) thread apply all bt Thread 2 (LWP 810125): #0 _nanosleep () at _nanosleep.S:4 #1 0x000000082232923c in __thr_nanosleep (time_to_sleep=0x820d4a598, time_remaining=0x820d4a598) at /usr/src/lib/libthr/thread/thr_syscalls.c:283 #2 0x00000008233b264b in std::__1::__libcpp_thread_sleep_for[abi:se190107](std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) (__ns=...) at /usr/src/contrib/llvm-project/libcxx/include/__thread/support/pthread.h:198 #3 std::__1::this_thread::sleep_for (ns=...) at /usr/src/contrib/llvm-project/libcxx/src/thread.cpp:94 #4 0x0000000000204008 in std::__1::this_thread::sleep_for[abi:se190107]<long long, std::__1::ratio<1l, 1l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1l> > const&) (__d=...) at /usr/include/c++/v1/__thread/this_thread.h:48 #5 0x0000000000203b9c in main () at lock.cpp:25 Thread 1 (LWP 965367): #0 0x00000008233a440f in __clang_trap_msg$libc++$/usr/src/contrib/llvm-project/libcxx/src/mutex.cpp:40: assertion ec == 0 failed: call to mutex::unlock failed. A possible reason is that the mutex wasn't locked () at /usr/src/contrib/llvm-project/libcxx/src/mutex.cpp:41 #1 std::__1::mutex::unlock (this=<optimized out>) at /usr/src/contrib/llvm-project/libcxx/src/mutex.cpp:39 #2 0x0000000000203a7e in t1_body (m=...) at lock.cpp:9 #3 0x000000000020509d in std::__1::__invoke[abi:se190107]<void (*)(std::__1::mutex&), std::__1::reference_wrapper<std::__1::mutex> >(void (*&&)(std::__1::mutex&), std::__1::reference_wrapper<std::__1::mutex>&&) (__f=@0xf1cd140b028: 0x203a20 <t1_body(std::__1::mutex&)>, __args=...) at /usr/include/c++/v1/__type_traits/invoke.h:150 #4 0x000000000020501e in std::__1::__thread_execute[abi:se190107]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::mutex&), std::__1::reference_wrapper<std::__1::mutex>, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::mutex&), std::__1::reference_wrapper<std::__1::mutex> >&, std::__1::__tuple_indices<2ul>) (__t=...) at /usr/include/c++/v1/__thread/thread.h:192 #5 0x0000000000204b9c in std::__1::__thread_proxy[abi:se190107]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::mutex&), std::__1::reference_wrapper<std::__1::mutex> > >(void*) (__vp=0xf1cd140b020) at /usr/include/c++/v1/__thread/thread.h:201 #6 0x000000082231dd21 in thread_start (curthread=0xf1cd1044810) at /usr/src/lib/libthr/thread/thr_create.c:299 #7 0x0000000000000000 in ?? () Backtrace stopped: Cannot access memory at address 0x828a94000 ``` -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5641#note_154343 You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/4-a6zujcs7i3i4lcn49nvo9ri6d-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
