Scheduling while atomic when I mount USB memory second time - linux-kernel

I'm working on our embedded system and when I mount the USB memory second time, I get this 'schedulling while atomic' error. After about 20 seconds, the mount succeeds with messages shown below.
I'm not that an expert and I don't know where to look in. Where should I look in? (linux3.3)
First mount works fine. and I used umount /usb to detach the memory stick.
# mount -t vfat /dev/sda0 /usb
BUG: scheduling while atomic: scsi_eh_0/328/0x00000003
Modules linked in:
[c0384d9c : wait_for_common+0xcc/0x1a0 ] [c02b0474 : command_abort+0x94/0xe0 ] [c0273a8c : scsi_error_handler+0x3e4/0x524 ] [c00462e8 : kt
ckim: or mask
ckim: connected
RESUME int
usb 1-1: reset full-speed USB device number 2 using aldebaran-hcd
ckim: or mask
ckim: connected
RESUME int
BUG: scheduling while atomic: scsi_eh_0/328/0x00000003
Modules linked in:
[c0384d9c : wait_for_common+0xcc/0x1a0 ] [c02722a8 : scsi_send_eh_cmnd+0x64/0x280 ] [c0272574 : scsi_eh_tur+0x18/0x94 ] [c0272654 : scsi_e
BUG: scheduling while atomic: scsi_eh_0/328/0x00000003
Modules linked in:
[c00462e8 : kthread+0x78/0x8c ] [c0011540 : kernel_thread+0x34/0x50 ] [c0046530 : kthreadd+0xc8/0x148 ]
The problem was solved yesterday by fixing the interrupt service routine. The port status has not been properly reported as disconnected when I plugged the memory stick out. By fixing it, this problem disappeared. When I gave the mount command second time, the device was still recognized as connected when it is not there, and this caused a long no response situation I guess.
ADD :
After 4 months I though the problem was fixed, a few days ago, playing with the USB keyboard, I found the same problem appear when I disconnect the USB keyboard and re-connected it. The message is below just in case someone can give me a clue on what the problem is..
usb 1-1: USB disconnect, device number 2
BUG: scheduling while atomic: khubd/12/0x00000002
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fc2c : devtmpfs_delete_node+0xa0/0xc8 ] [c027920c : device_del+0x160/0x188 ]
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fc2c : devtmpfs_delete_node+0xa0/0xc8 ] [c027920c : device_del+0x160/0x188 ]
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fc2c : devtmpfs_delete_node+0xa0/0xc8 ] [c027920c : device_del+0x160/0x188 ]
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fc2c : devtmpfs_delete_node+0xa0/0xc8 ] [c027920c : device_del+0x160/0x188 ]
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_thread+0x34/0x50 ] [c0046dfc : kthreadd+0xc8/0x148 ]
INSRMV int
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b7f0c : hub_thread+0xc94/0x11d8 ] [c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_th
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b4758 : hub_port_reset+0x134/0x458 ] [c02b5468 : hub_port_init+0x50/0x7a0 ] [c02b76f0 :
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b49c4 : hub_port_reset+0x3a0/0x458 ] [c02b5468 : hub_port_init+0x50/0x7a0 ] [c02b76f0 :
usb 1-1: new low-speed USB device number 3 using aldebaran-hcd
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b4758 : hub_port_reset+0x134/0x458 ] [c02b581c : hub_port_init+0x404/0x7a0 ] [c02b76f0
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b49c4 : hub_port_reset+0x3a0/0x458 ] [c02b581c : hub_port_init+0x404/0x7a0 ] [c02b76f0
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0037b78 : msleep+0x18/0x34 ] [c02b560c : hub_port_init+0x1f4/0x7a0 ] [c02b76f0 : hub_thread+0x478/0x11d8 ] [c0046bb4 : k
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
usb 1-1: New USB device found, idVendor=045e, idProduct=0780
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: Comfort Curve Keyboard 3000
usb 1-1: Manufacturer: Microsoft
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fb40 : devtmpfs_create_node+0xd0/0x11c ] [c0279998 : device_add+0x230/0x620
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
input: Microsoft Comfort Curve Keyboard 3000 as /devices/platform/aldebaran-hcd/usb1/1-1/1-1:1.0/input/input2
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fb40 : devtmpfs_create_node+0xd0/0x11c ] [c0279998 : device_add+0x230/0x620
generic-usb 0003:045E:0780.0003: input: USB HID v1.11 Keyboard [Microsoft Comfort Curve Keyboard 3000] on usb-aldebaran-hc0
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c02bcc78 : usb_start_wait_urb+0x98/0xcc ] [c02bceb4 : usb_control_msg+0xd8/0xfc
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c02fcf20 : usbhid_wait_io+0xa8/0x118 ] [c02fcff8 : usbhid_init_reports+0x68/0x110 ] [c02fd5c8 : usbhid_start+0x528/0x648
input: Microsoft Comfort Curve Keyboard 3000 as /devices/platform/aldebaran-hcd/usb1/1-1/1-1:1.1/input/input3
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fb40 : devtmpfs_create_node+0xd0/0x11c ] [c0279998 : device_add+0x230/0x620
generic-usb 0003:045E:0780.0004: input: USB HID v1.11 Device [Microsoft Comfort Curve Keyboard 3000] on usb-aldebaran-hcd-1
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c03b5824 : wait_for_common+0xcc/0x1a0 ] [c027fb40 : devtmpfs_create_node+0xd0/0x11c ] [c0279998 : device_add+0x230/0x620
BUG: scheduling while atomic: khubd/12/0x00000003
Modules linked in:
[c0046bb4 : kthread+0x78/0x8c ] [c00115b8 : kernel_thread+0x34/0x50 ] [c0046dfc : kthreadd+0xc8/0x148 ]

Seems like there is problem in the kernel. It means that some part of kernel tried to do some non-atomic procedure while kernel was in atomic context. For example kernel tried to go to sleep.
Try to upgrade your kernel.

Related

Emscripten: compiled boost libraries, how to make cmake see them? [duplicate]

This question already has an answer here:
Possible causes for Boost not being found by CMake in certain situations?
(1 answer)
Closed 3 months ago.
Consider the following minimal example:
CMakeLists.txt contains:
cmake_minimum_required(VERSION 3.22)
project(Minexample)
find_package(ZLIB)
if(ZLIB_FOUND)
add_definitions(-DHAVE_LIBZ)
include_directories(${ZLIB_INCLUDE_DIR})
endif()
# tell cmake to search boost in the directory /home/hiisi/workspace/boost-1_75_0
set(Boost_NO_SYSTEM_PATHS ON)
set(BOOST_ROOT "/home/hiisi/workspace/boost-1_75_0")
set(Boost_INCLUDE_DIR "/home/hiisi/workspace/boost-1_75_0")
#set(BOOST_LIBRARYDIR "/home/hiisi/workspace/boost-1_75_0/lib")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_DEBUG ON)
#set(Boost_COMPILER -emscripten-3.1.24)
#set(Boost_toolset emscripten-3.1.24)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_DETAILED_FAILURE_MSG ON)
Set(Boost_LIB_PREFIX "lib")
find_package(Boost COMPONENTS program_options iostreams system)
#find_package(Boost)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
endif()
This is how I feed it to make:
emcmake cmake . -DZLIB_INCLUDE_DIR=/home/hiisi/workspace/zlib -DZLIB_LIBRARY=/home/hiisi/workspace/zlib/libz.a
Here's the output of the above command:
configure: cmake . -DZLIB_INCLUDE_DIR=/home/hiisi/workspace/zlib -DZLIB_LIBRARY=/home/hiisi/workspace/zlib/libz.a -DCMAKE_TOOLCHAIN_FILE=/home/hiisi/workspace/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/hiisi/workspace/emsdk/node/14.18.2_64bit/bin/node;--experimental-wasm-threads
-- Found ZLIB: /home/hiisi/workspace/zlib/libz.a (found version "1.2.13")
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1688 ] _boost_TEST_VERSIONS = "1.78.0;1.78;1.77.0;1.77;1.76.0;1.76;1.75.0;1.75;1.74.0;1.74;1.73.0;1.73;1.72.0;1.72;1.71.0;1.71;1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1689 ] Boost_USE_MULTITHREADED = "ON"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1690 ] Boost_USE_STATIC_LIBS = "ON"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1691 ] Boost_USE_STATIC_RUNTIME = "ON"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1692 ] Boost_ADDITIONAL_VERSIONS = <unset>
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1693 ] Boost_NO_SYSTEM_PATHS = "ON"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1725 ] BOOST_ROOT = "/home/hiisi/workspace/boost-1_75_0"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1726 ] ENV{BOOST_ROOT} = <unset>
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1727 ] BOOST_INCLUDEDIR = <unset>
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1728 ] ENV{BOOST_INCLUDEDIR} = <unset>
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1729 ] BOOST_LIBRARYDIR = <unset>
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1730 ] ENV{BOOST_LIBRARYDIR} = <unset>
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1818 ] location of version.hpp: /home/hiisi/workspace/boost-1_75_0/boost/version.hpp
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1858 ] Boost_VERSION = "1.75.0"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1859 ] Boost_VERSION_STRING = "1.75.0"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1860 ] Boost_VERSION_MACRO = "107500"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1861 ] Boost_VERSION_MAJOR = "1"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1862 ] Boost_VERSION_MINOR = "75"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1863 ] Boost_VERSION_PATCH = "0"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1864 ] Boost_VERSION_COUNT = "3"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1888 ] Boost_LIB_PREFIX = "lib"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1889 ] Boost_NAMESPACE = "boost"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:953 ] _boost_COMPILER = "-clang16" (guessed)
-- [ /usr/share/cmake/Modules/FindBoost.cmake:1925 ] _boost_MULTITHREADED = "-mt"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2003 ] _boost_ARCHITECTURE_TAG = "" (detected)
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2007 ] _boost_RELEASE_ABI_TAG = "-s"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2008 ] _boost_DEBUG_ABI_TAG = "-sd"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2068 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = "/home/hiisi/workspace/boost-1_75_0/lib;/home/hiisi/workspace/boost-1_75_0/stage/lib;/home/hiisi/workspace/boost-1_75_0/lib;/home/hiisi/workspace/boost-1_75_0/../lib;/home/hiisi/workspace/boost-1_75_0/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2069 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = "/home/hiisi/workspace/boost-1_75_0/lib;/home/hiisi/workspace/boost-1_75_0/stage/lib;/home/hiisi/workspace/boost-1_75_0/lib;/home/hiisi/workspace/boost-1_75_0/../lib;/home/hiisi/workspace/boost-1_75_0/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH"
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2254 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: libboost_program_options-clang16-mt-s-1_75;libboost_program_options-clang16-mt-s;libboost_program_options-clang16-mt-s;libboost_program_options-mt-s-1_75;libboost_program_options-mt-s;libboost_program_options-mt-s;libboost_program_options-mt;libboost_program_options
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2309 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: libboost_program_options-clang16-mt-sd-1_75;libboost_program_options-clang16-mt-sd;libboost_program_options-clang16-mt-sd;libboost_program_options-mt-sd-1_75;libboost_program_options-mt-sd;libboost_program_options-mt-sd;libboost_program_options-mt;libboost_program_options
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2254 ] Searching for IOSTREAMS_LIBRARY_RELEASE: libboost_iostreams-clang16-mt-s-1_75;libboost_iostreams-clang16-mt-s;libboost_iostreams-clang16-mt-s;libboost_iostreams-mt-s-1_75;libboost_iostreams-mt-s;libboost_iostreams-mt-s;libboost_iostreams-mt;libboost_iostreams
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2309 ] Searching for IOSTREAMS_LIBRARY_DEBUG: libboost_iostreams-clang16-mt-sd-1_75;libboost_iostreams-clang16-mt-sd;libboost_iostreams-clang16-mt-sd;libboost_iostreams-mt-sd-1_75;libboost_iostreams-mt-sd;libboost_iostreams-mt-sd;libboost_iostreams-mt;libboost_iostreams
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2254 ] Searching for SYSTEM_LIBRARY_RELEASE: libboost_system-clang16-mt-s-1_75;libboost_system-clang16-mt-s;libboost_system-clang16-mt-s;libboost_system-mt-s-1_75;libboost_system-mt-s;libboost_system-mt-s;libboost_system-mt;libboost_system
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2309 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-clang16-mt-sd-1_75;libboost_system-clang16-mt-sd;libboost_system-clang16-mt-sd;libboost_system-mt-sd-1_75;libboost_system-mt-sd;libboost_system-mt-sd;libboost_system-mt;libboost_system
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2254 ] Searching for REGEX_LIBRARY_RELEASE: libboost_regex-clang16-mt-s-1_75;libboost_regex-clang16-mt-s;libboost_regex-clang16-mt-s;libboost_regex-mt-s-1_75;libboost_regex-mt-s;libboost_regex-mt-s;libboost_regex-mt;libboost_regex
-- [ /usr/share/cmake/Modules/FindBoost.cmake:2309 ] Searching for REGEX_LIBRARY_DEBUG: libboost_regex-clang16-mt-sd-1_75;libboost_regex-clang16-mt-sd;libboost_regex-clang16-mt-sd;libboost_regex-mt-sd-1_75;libboost_regex-mt-sd;libboost_regex-mt-sd;libboost_regex-mt;libboost_regex
-- Could NOT find Boost (missing: program_options iostreams system) (found version "1.75.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hiisi/workspace/minexmpl
Here's the directory listing of /home/hiisi/workspace/boost-1_75_0/lib:
cmake libboost_filesystem.a libboost_filesystem.bc libboost_iostreams.a libboost_iostreams.bc libboost_program_options.a libboost_program_options.bc
Those .a files were created by running emar q lib.a lib.bc command. Why is it that my zlib is being recognized but not boost? This is how I compiled boost:
emconfigure ./b2 toolset=emscripten link=static runtime-link=static threading=multi --prefix=/home/hiisi/workspace/boost-1_75_0 --with-program_options --with-iostreams --with-filesystem
And:
/b2 install --prefix=/home/hiisi/workspace/boost-1_75_0
you can try this:
find_package(Boost 1.75 REQUIRED COMPONENTS
program_options
iostreams
system)
if (NOT Boost_FOUND)
message("Not found Boost!")
elseif (Boost_FOUND)
message("Found Boost!"" Version:" ${Boost_VERSION})
include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
endif()
And this is a link about CMake FindBoost.

Perf on MIPS debug kernel, unable to enable frame_pointer

I am trying to use perf tool for MIPS & facing some trouble in getting back-stacks.
How can I enable FRAME_POINTER for mips ? I have DEBUG_KERNEL enabled, but it looks like -fno-omit-frame-pointer is not applicable for MIPS arch in kernel.
Does it mean frame pointer based stack unwinding with perf can't be achieved for MIPS ?
I don't see mips toolchain complaining about -fno-omit-frame-pointer flag
EDIT1
I am able to record perf events. Sample output for perf report
Report wouldn't help much without the stack unwinding.
# ./perf --version
perf version 5.6.rc2.gd04712cd3bd7
# uname -a
Linux localhost 3.14.28-1.19 #1 SMP Mon Feb 17 16:48:44 IST 2020 mips GNU/Linux
EDIT2
Perf features detected
Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ on ]
... libbfd: [ OFF ]
... libcap: [ OFF ]
... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ OFF ]
... bpf: [ OFF ]
... libaio: [ on ]
... libzstd: [ OFF ]
... disassembler-four-args: [ OFF ]
EDIT3
I see feature test for libunwind had failed
cat linux-5.6-rc2/tools/build/feature/test-libunwind.make.output
/tmp/ccQnV5jZ.o: In function `main':
test-libunwind.c:(.text+0x1c): undefined reference to `_Umips_create_addr_space'
test-libunwind.c:(.text+0x4c): undefined reference to `_Umips_init_remote'
test-libunwind.c:(.text+0x70): undefined reference to `_Umips_dwarf_search_unwind_table'
collect2: error: ld returned 1 exit status
If I see the makefile for feature tests libunwind linking is not done for MIPS.
EDIT4
Usual workflow
perf record -F 99 -ag -e cycles:u -- sleep 5
perf report
Attempt to use dwarf
# perf record -F 99 -ag --call-graph=dwarf -- sleep 10
Error:
The sys_perf_event_open() syscall returned with 89 (Function not implemented) for event (cycles).
/bin/dmesg | grep -i perf may provide additional information.
dmesg is empty

tegrahost_v2: Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed

I've built an image for Jetson TX2 module using yocto. Everything when fine for few days but now I get this error when I try to flash the device.
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0008 ] tegrasign_v2 --key None --getmode mode.txt
[ 0.0016 ] Assuming zero filled SBK key
[ 0.0016 ]
[ 0.0016 ] Generating RCM messages
[ 0.0023 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 --download rcm mb1_recovery_prod.bin 0 0
[ 0.0030 ] RCM 0 is saved as rcm_0.rcm
[ 0.0033 ] RCM 1 is saved as rcm_1.rcm
[ 0.0033 ] List of rcm files are saved in rcm_list.xml
[ 0.0033 ]
[ 0.0033 ] Signing RCM messages
[ 0.0040 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key
[ 0.0046 ] Assuming zero filled SBK key
[ 0.0076 ]
[ 0.0076 ] Copying signature to RCM mesages
[ 0.0083 ] tegrarcm_v2 --chip 0x18 --updatesig rcm_list_signed.xml
[ 0.0093 ]
[ 0.0093 ] Parsing partition layout
[ 0.0100 ] tegraparser_v2 --pt flash.xml.tmp
[ 0.0109 ]
[ 0.0109 ] Creating list of images to be signed
[ 0.0116 ] tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
[ 0.0124 ] Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed
[ 0.0161 ]
Error: Return value 4
Command tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
Does this error ring a bell to anyone?
I am able to flash the board with JetPack.
Thanks,
-Damien
Just in case you never figured this out, it looks like
[ 0.0124 ] Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed
is the real error. Fix that and you should be good.

how is cmake's _boost_LIBRARY_SEARCH_DIRS set/configured/influenced? (boost libraries not found)

I worked through
CMake no longer finds static Boost libraries
and
CMake not finding Boost
and some of the other related questions.
I've the same problem, but none of the solutions are suitable for me.
running cmake -DBoost_DEBUG=ON . leads to
Building external libraries
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:476 ] _boost_TEST_VERSIONS = 1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:478 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:480 ] Boost_USE_STATIC_LIBS = ON
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:482 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:484 ] Boost_ADDITIONAL_VERSIONS =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:486 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:538 ] Declared as CMake or Environmental Variables:
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:540 ] BOOST_ROOT =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:542 ] BOOST_INCLUDEDIR =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:544 ] BOOST_LIBRARYDIR =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:546 ] _boost_TEST_VERSIONS = 1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:639 ] location of version.hpp: /usr/local/include/boost-1_54/boost/version.hpp
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:663 ] version.hpp reveals boost 1.54.0
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:739 ] guessed _boost_COMPILER = -gcc43
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:749 ] _boost_MULTITHREADED = -mt
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:792 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:794 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:842 ] _boost_LIBRARY_SEARCH_DIRS = /usr/local/include/boost-1_54/lib;/usr/local/include/boost-1_54/../lib;/usr/local/include/boost-1_54/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
Boost version and boost headers are found, the static libraries aren't.
they are all located in /usr/local/lib64 but this path isn't included in _boost_LIBRARY_SEARCH_DIRS.
I'm using cmake version 2.8.12.2 on sles11 sp2 x86_64.
Question is: how is cmake's _boost_LIBRARY_SEARCH_DIRS set/configured/influenced?
UPDATE
In fact I had two problems, one solved by the answer below, the second was a wrong
guessed _boost_COMPILER = -gcc43
which I could solve via
SET( Boost_COMPILER -gcc48)
Make sure that the global property FIND_LIBRARY_USE_LIB64_PATHS is set to true before calling find_package(Boost), i.e.:
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
This should make the find_library call in CMake's boost module honor the /usr/local/lib64 directory.

cmake can't find boost thread

I'm trying to compile some project to js using emscripten. The project uses cmake as a build tool.
This is how I'm calling cmake:
cmake -DEMSCRIPTEN=1
-DCMAKE_TOOLCHAIN_FILE=~/Documents/emscripten/cmake/Platform/Emscripten_unix.cmake
-DCMAKE_MODULE_PATH=~/Documents/emscripten/cmake
-DCMAKE_BUILD_TYPE=Release
-G "Unix Makefiles"
-DRDK_BUILD_PYTHON_WRAPPERS=
-DBOOST_INCLUDEDIR=~/Documents/boost_1_53_0/boost
-DBOOST_LIBRARYDIR=~/Documents/boost_1_53_0/stage/lib
-DBoost_REGEX_LIBRARY=~/Documents/boost_1_53_0/stage/lib/libboost_regex.a
-DBOOST_ROOT=~/Documents/boost_1_53_0
-DBoost_NO_SYSTEM_PATHS=TRUE
-DBoost_USE_MULTITHREADED=FALSE
-DBoost_USE_STATIC_LIBS=OFF
-DBoost_USE_STATIC_RUNTIME=OFF
-DBoost_ADDITIONAL_VERSIONS="1.53.0"
-DBoost_DETAILED_FAILURE_MSG=TRUE
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_DEBUG=TRUE
..
This is what I have in /home/mnowotka/Documents/boost_1_53_0/stage/lib directory:
ls -lh ~/Documents/boost_1_53_0/stage/lib
total 4.4M
-rw-rw-r-- 1 mnowotka mnowotka 2.6M Apr 11 10:49 libboost_regex.a
lrwxrwxrwx 1 mnowotka mnowotka 24 Apr 11 10:10 libboost_regex.so -> libboost_regex.so.1.53.0
-rw-rw-r-- 1 mnowotka mnowotka 1.9M Apr 11 10:10 libboost_regex.so.1.53.0
And this is what I'm getting from cmake:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:667 ] Include debugging info:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:669 ] _boost_INCLUDE_SEARCH_DIRS = /home/mnowotka/Documents/boost_1_53_0/boost;/home/mnowotka/Documents/boost_1_53_0/include;/home/mnowotka/Documents/boost_1_53_0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:671 ] _boost_PATH_SUFFIXES = boost-1_53_0;boost_1_53_0;boost-1_48_0;boost_1_48_0;boost-1_48;boost_1_48;boost-1_47_0;boost_1_47_0;boost-1_47;boost_1_47;boost-1_46_1;boost_1_46_1;boost-1_46_0;boost_1_46_0;boost-1_46;boost_1_46;boost-1_45_0;boost_1_45_0;boost-1_45;boost_1_45;boost-1_44_0;boost_1_44_0;boost-1_44;boost_1_44;boost-1_43_0;boost_1_43_0;boost-1_43;boost_1_43;boost-1_42_0;boost_1_42_0;boost-1_42;boost_1_42;boost-1_41_0;boost_1_41_0;boost-1_41;boost_1_41;boost-1_40_0;boost_1_40_0;boost-1_40;boost_1_40;boost-1_39_0;boost_1_39_0;boost-1_39;boost_1_39
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:696 ] location of version.hpp: /home/mnowotka/Documents/boost_1_53_0/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:715 ] version.hpp reveals boost 1.53.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] guessed _boost_COMPILER =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:818 ] _boost_MULTITHREADED =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:861 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:863 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:906 ] _boost_LIBRARY_SEARCH_DIRS = /home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/../lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1119 ] Boost_FOUND = TRUE
-- Boost version: 1.53.0
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found BISON: /usr/bin/bison
-- Found FLEX: /usr/bin/flex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:525 ] Boost not in cache
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:528 ] _boost_TEST_VERSIONS = 1.53.0;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:530 ] Boost_USE_MULTITHREADED = FALSE
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:532 ] Boost_USE_STATIC_LIBS = OFF
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:534 ] Boost_USE_STATIC_RUNTIME = OFF
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:536 ] Boost_ADDITIONAL_VERSIONS = 1.53.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:538 ] Boost_NO_SYSTEM_PATHS = TRUE
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:606 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:608 ] BOOST_ROOT = /home/mnowotka/Documents/boost_1_53_0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:610 ] BOOST_INCLUDEDIR = /home/mnowotka/Documents/boost_1_53_0/boost
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:612 ] BOOST_LIBRARYDIR = /home/mnowotka/Documents/boost_1_53_0/stage/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:614 ] _boost_TEST_VERSIONS = 1.53.0;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:696 ] location of version.hpp: /home/mnowotka/Documents/boost_1_53_0/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:715 ] version.hpp reveals boost 1.53.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] guessed _boost_COMPILER =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:818 ] _boost_MULTITHREADED =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:861 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:863 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:906 ] _boost_LIBRARY_SEARCH_DIRS = /home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/../lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for REGEX_LIBRARY_RELEASE: boost_regex-1_53;boost_regex;boost_regex-1_53;boost_regex;boost_regex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for REGEX_LIBRARY_DEBUG: boost_regex-d-1_53;boost_regex-d;boost_regex-d-1_53;boost_regex-d;boost_regex;boost_regex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1119 ] Boost_FOUND = FALSE
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1202 (message):
Unable to find the requested Boost libraries.
Boost version: 1.53.0
Boost include path: /home/mnowotka/Documents/boost_1_53_0
The following Boost libraries could not be found:
boost_regex
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
Code/GraphMol/SLNParse/CMakeLists.txt:4 (find_package)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_REGEX_LIBRARY (ADVANCED)
linked by target "testSLNParse" in directory /home/mnowotka/Documents/rdkit-code/Code/GraphMol/SLNParse
-- Configuring incomplete, errors occurred!
I have only one question: why?
What I'm doing wrong? This drives me crazy....
(BTW: it doesn't matter if I set Boost_USE_STATIC_LIBS and Boost_USE_STATIC_RUNTIME ON or OFF - it doesn't work either...)
You are aware, that Emscripten can currently only use modules (e.g. Boost, Boost-Regex) which source code it compiles? In other words, Emscripten can not use dynamic libraries or precompiled static ones!
So you have to add the sourcecode for Boost-Regex to your cmake file and build them together (I have not done cmake for quite a while so I cannot tell you how).
Or you could remove the check for Boost-Regex from cmake and hardcode the necessary references
Whatever you choose to do, you will have to build Boost-Regex with Emscripten, too!
As for Emscripten, you should really use Boost_USE_STATIC_LIBS=ON because dynamic libraries are currently not supported by Emscripten (see above).
Emscripten does also not support calls to pthread* or any concurrent handling. You should search for these things in your code.
Sorry to sound so negative, but currently using libraries with Emscripten is no piece of cake.

Resources