libuv: Abort trap (core dumped) on OpenBSD
background: I wanna use latest version of cmake on OpenBSD, I found that there is no offical release tarball of cmake for OpenBSD, so I decided to build it from source.
build machine HostOS: OpenBSD6.9 and OpenBSD7.1
source: https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2.tar.gz
build flags:
cmake \
-DCMAKE_USE_OPENSSL=ON \
-DCMake_BUILD_LTO=ON \
-DBUILD_QtDialog=OFF \
-DBUILD_CursesDialog=ON \
-DCMAKE_INSTALL_PREFIX=/opt/ppkg/installed/cmake \
-DCMAKE_TOOLCHAIN_FILE=/opt/ppkg/installing/cmake/toolchain.cmake \
-DCMAKE_PROJECT_INCLUDE=/opt/ppkg/installing/cmake/project-after.cmake \
-S /opt/ppkg/installing/cmake/src \
-B /opt/ppkg/installing/cmake/tmp
/opt/ppkg/installing/cmake/toolchain.cmake:
message(STATUS "CMake command: ${CMAKE_COMMAND}")
message(STATUS "CMake version: ${CMAKE_VERSION}")
if ("${BUILD_SHARED_LIBS}" STREQUAL "")
set(BUILD_SHARED_LIBS OFF)
endif()
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_C_COMPILER "/opt/ppkg/core/bin/proxy-cc")
set(CMAKE_C_FLAGS "-I/opt/ppkg/installing/cmake/inc -I/opt/ppkg/installed/ncurses/include -I/opt/ppkg/installed/openssl/include -fPIC -fno-common -Wno-error=unused-command-line-argument")
set(CMAKE_CXX_COMPILER "/opt/ppkg/core/bin/proxy-c++")
set(CMAKE_CXX_FLAGS "-I/opt/ppkg/installing/cmake/inc -I/opt/ppkg/installed/ncurses/include -I/opt/ppkg/installed/openssl/include -fPIC -fno-common -Wno-error=unused-command-line-argument")
set(CMAKE_ASM_COMPILER "/opt/ppkg/core/bin/proxy-cc")
set(CMAKE_SHARED_LINKER_FLAGS "-L/opt/ppkg/installing/cmake/lib -L/opt/ppkg/installed/ncurses/lib -Wl,-rpath-link,/opt/ppkg/installed/ncurses/lib -L/opt/ppkg/installed/openssl/lib -Wl,-rpath-link,/opt/ppkg/installed/openssl/lib -L/opt/ppkg/installed/perl/lib -Wl,-rpath-link,/opt/ppkg/installed/perl/lib -Wl,--as-needed -Wl,-z,muldefs -Wl,--allow-multiple-definition -pthread")
set(CMAKE_EXE_LINKER_FLAGS "-L/opt/ppkg/installing/cmake/lib -L/opt/ppkg/installed/ncurses/lib -Wl,-rpath-link,/opt/ppkg/installed/ncurses/lib -L/opt/ppkg/installed/openssl/lib -Wl,-rpath-link,/opt/ppkg/installed/openssl/lib -L/opt/ppkg/installed/perl/lib -Wl,-rpath-link,/opt/ppkg/installed/perl/lib -static --static -Wl,--as-needed -Wl,-z,muldefs -Wl,--allow-multiple-definition -pthread")
set(CMAKE_C_COMPILER_AR "/usr/bin/ar")
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/ranlib")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_NM "/usr/bin/nm")
set(CMAKE_READELF "/usr/bin/readelf")
set(CMAKE_OBJCOPY "/usr/bin/objcopy")
set(CMAKE_OBJDUMP "/usr/bin/objdump")
set(CMAKE_STRIP "/usr/bin/strip")
set(CMAKE_DLLTOOL "")
set(CMAKE_ADDR2LINE "/usr/bin/addr2line")
set(CMAKE_FIND_DEBUG_MODE OFF)
set(CMAKE_FIND_ROOT_PATH "/opt/ppkg/installed/perl;/opt/ppkg/installed/openssl;/opt/ppkg/installed/ncurses")
/opt/ppkg/installing/cmake/project-after.cmake:
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
run cmake command:
/opt/ppkg/installed/cmake/bin/cmake --help
reported: Abort trap (core dumped)
inspect core dump with gdb:
gdb /opt/ppkg/installed/cmake/bin/cmake cmake.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd6.9"...
Core was generated by `cmake'.
Program terminated with signal 6, Aborted.
#0 thrkill () at /tmp/-:3
3 /tmp/-: No such file or directory.
in /tmp/-
(gdb) bt
#0 thrkill () at /tmp/-:3
#1 0x00000948ee59906e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2 0x00000948ef305ff9 in uv_mutex_destroy (mutex=0x948ef44e060) at /opt/ppkg/installing/cmake/src/Utilities/cmlibuv/src/unix/thread.c:326
#3 0x00000948ef306d0e in uv__process_title_cleanup () at /opt/ppkg/installing/cmake/src/Utilities/cmlibuv/src/unix/bsd-proctitle.c:41
#4 0x00000948ef2f91b9 in uv_library_shutdown () at /opt/ppkg/installing/cmake/src/Utilities/cmlibuv/src/uv-common.c:904
#5 0x00000948ee2abf15 in __do_fini ()
#6 0x00000948ef310bb9 in __fini ()
#7 0x00000948ef310bb0 in ?? ()
#8 0x00000948ee599c23 in _libc___cxa_finalize (dso=Variable "dso" is not available.
) at /usr/src/lib/libc/stdlib/atexit.c:177
#9 0x00000948ee5998a1 in _libc_exit (status=0) at /usr/src/lib/libc/stdlib/exit.c:54
#10 0x00000948ee2abd8a in ___start ()
#11 0x0000000000000000 in ?? ()
Current language: auto; currently asm
Edited by Brad King