Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddressSanitizer CHECK failed #9

Open
zenker opened this issue Feb 4, 2020 · 3 comments
Open

AddressSanitizer CHECK failed #9

zenker opened this issue Feb 4, 2020 · 3 comments

Comments

@zenker
Copy link
Contributor

zenker commented Feb 4, 2020

I'm trying to debug my application using googles AddressSanitizer, which can be enabled e.g. in ControlSystemAdapter-OPC-UA-Adapter. I can not start my application because of a problem found by AddressSanitizer. Surprisingly, the problems is caused inside the python script which is executed at startup of my application. Consequently, running the python script standalone fails with the same error.

The output of AddressSanitizer looks like this:

==201008==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/asan/asan_interceptors.cc:291 "((IndirectExternCall(__interception::real___cxa_throw))) != (0)" (0x0, 0x0)
    #0 0x7fe0e9489631  (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa0631)
    #1 0x7fe0e948e5e3 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa55e3)
    #2 0x7fe0e941f706 in __cxa_throw (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x36706)
    #3 0x7fe0e4d15af6  (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xenial2+0x7ccaf6)
    #4 0x7fe0e4e7d859 in ChimeraTK::FixedPointConverter::vectorToCooked_impl::impl(ChimeraTK::FixedPointConverter const&, int const* const&, int const* const&, signed char*) (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xenial2+0x934859)
    #5 0x7fe0e4e7905d in ChimeraTK::FixedPointConverter::reconfigure(unsigned int, int, bool) (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xenial2+0x93005d)
    #6 0x7fe0e4e7d65b in ChimeraTK::FixedPointConverter::FixedPointConverter(std::__cxx11::basic_string, std::allocator >, unsigned int, int, bool) (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xenial2+0x93465b)
    #7 0x7fe0e4e26de0 in ChimeraTK::NumericAddressedBackendRegisterAccessor::NumericAddressedBackendRegisterAccessor(boost::shared_ptr, ChimeraTK::RegisterPath const&, unsigned long, unsigned long, ChimeraTK::Acces
sModeFlags) (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xenial2+0x8ddde0)
    #8 0x7fe0e4dc2de0 in boost::shared_ptr > ChimeraTK::NumericAddressedBackend::getRegisterAccessor_impl(ChimeraTK::RegisterPath const&, unsigned long, unsigned long, ChimeraTK::AccessModeFlags) (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xen
ial2+0x879de0)
    #9 0x7fe0e4dba1eb  (/usr/lib/libChimeraTK-DeviceAccess.so.01.09xenial2+0x8711eb)
    #10 0x7fe0e56c0d3d in ChimeraTK::OneDRegisterAccessor ChimeraTK::Device::getOneDRegisterAccessor(ChimeraTK::RegisterPath const&, unsigned long, unsigned long, ChimeraTK::AccessModeFlags const&) const (/usr/lib/python3/dist-packages/mtca4udeviceaccess.so+0x33d3d)
    #11 0x7fe0e56c05c6 in mtca4upy::DeviceAccess::getRawOneDAccessor(ChimeraTK::Device const&, std::__cxx11::basic_string, std::allocator > const&, unsigned long, unsigned long) (/usr/lib/python3/dist-packages/mtca4udeviceaccess.so+0x335c6)
    #12 0x7fe0e56b6ee0 in boost::python::objects::caller_py_function_impl (*)(ChimeraTK::Device const&, std::__cxx11::basic_string, std::allocator > const&, unsigned long, unsigned 
long), boost::python::default_call_policies, boost::mpl::vector5, ChimeraTK::Device const&, std::__cxx11::basic_string, std::allocator > const&, unsigned long, unsigned long> > >::operator()(_object*, _object*) 
(/usr/lib/python3/dist-packages/mtca4udeviceaccess.so+0x29ee0)
    #13 0x7fe0e3a9c00c in boost::python::objects::function::call(_object*, _object*) const (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x2900c)
    #14 0x7fe0e3a9c207  (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x29207)
    #15 0x7fe0e3aa4052 in boost::python::handle_exception_impl(boost::function0) (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x31052)
    #16 0x7fe0e3a99408  (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x26408)
    #17 0x5c3bd6 in PyObject_Call (/usr/bin/python3.5+0x5c3bd6)
    #18 0x5354ae in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5354ae)
    #19 0x539a12  (/usr/bin/python3.5+0x539a12)
    #20 0x5356a1 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5356a1)
    #21 0x539a12  (/usr/bin/python3.5+0x539a12)
    #22 0x53a6ce in PyEval_EvalCode (/usr/bin/python3.5+0x53a6ce)
    #23 0x6292c1  (/usr/bin/python3.5+0x6292c1)
    #24 0x62b769 in PyRun_FileExFlags (/usr/bin/python3.5+0x62b769)
    #25 0x62bf5b in PyRun_SimpleFileExFlags (/usr/bin/python3.5+0x62bf5b)
    #26 0x63d505 in Py_Main (/usr/bin/python3.5+0x63d505)
    #27 0x4cfd10 in main (/usr/bin/python3.5+0x4cfd10)
    #28 0x7fe0e8e2282f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #29 0x5d36e8 in _start (/usr/bin/python3.5+0x5d36e8)

The python does nothing fancy just reads a register via the pcie backend:

#!/usr/bin/python3
import mtca4u
import sys
deviceName = sys.argv[1]

mtca4u.set_dmap_location("devMapFile.dmap")
device = mtca4u.Device(deviceName)
status = device.read_raw("BOARD.0", "WORD_BOOT_STATUS")
@zenker
Copy link
Contributor Author

zenker commented Feb 4, 2020

To test this you can simply export the path to the asan library, e.g.:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.2

Than you open e.g. ipython3 and call:

import mtca4u
mtca4u.set_dmap_location("devMapFile.dmap")

This fails for me on another machine with DeviceAccess 01.09.02 and another mapping file:

==4013==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/asan/asan_interceptors.cc:291 "((IndirectExternCall(__interception::real___cxa_throw))) != (0)" (0x0, 0x0)
    #0 0x7f4544028631  (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa0631)
    #1 0x7f454402d5e3 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa55e3)
    #2 0x7f4543fbe706 in __cxa_throw (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x36706)
    #3 0x7f4539e6c201 in ChimeraTK::BackendFactory::loadPluginLibrary(std::__cxx11::basic_string, std::allocator >) /home/zenker/sw/chimeraTK/DeviceAccess/device_backends/src/BackendFactory.cc:271
    #4 0x7f4539e6c4f5 in ChimeraTK::BackendFactory::loadAllPluginsFromDMapFile() /home/zenker/sw/chimeraTK/DeviceAccess/device_backends/src/BackendFactory.cc:286
    #5 0x7f4539e67ff0 in ChimeraTK::BackendFactory::setDMapFilePath(std::__cxx11::basic_string, std::allocator >) /home/zenker/sw/chimeraTK/DeviceAccess/device_backends/src/BackendFactory.cc:131
    #6 0x7f4539e16089 in ChimeraTK::setDMapFilePath(std::__cxx11::basic_string, std::allocator >) /home/zenker/sw/chimeraTK/DeviceAccess/util/src/Utilities.cpp:327
    #7 0x7f453c2f866a in mtca4upy::setDmapFile(std::__cxx11::basic_string, std::allocator > const&) /home/zenker/sw/chimeraTK/DeviceAccess-PythonBindings/DeviceAccess.cc:37
    #8 0x7f453c2eb15f in _object* boost::python::detail::invoke, std::allocator > const&), boost::python::arg_from_python, std::allocator > const&> >(boost::python::detail::invoke_tag_, int const&, void (*&)(std::__cxx11::basic_string, std::allocator > const&), boost::python::arg_from_python, std::allocator > const&>&) (/home/zenker/sw/installed/lib/python3.5/site-packages/mtca4udeviceaccess.so+0xe615f)
    #9 0x7f453c2e3c84 in boost::python::detail::caller_arity<1u>::impl, std::allocator > const&), boost::python::default_call_policies, boost::mpl::vector2, std::allocator > const&> >::operator()(_object*, _object*) (/home/zenker/sw/installed/lib/python3.5/site-packages/mtca4udeviceaccess.so+0xdec84)
    #10 0x7f453c2e0f9c in boost::python::objects::caller_py_function_impl, std::allocator > const&), boost::python::default_call_policies, boost::mpl::vector2, std::allocator > const&> > >::operator()(_object*, _object*) (/home/zenker/sw/installed/lib/python3.5/site-packages/mtca4udeviceaccess.so+0xdbf9c)
    #11 0x7f4536e2a00c in boost::python::objects::function::call(_object*, _object*) const (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x2900c)
    #12 0x7f4536e2a207  (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x29207)
    #13 0x7f4536e32052 in boost::python::handle_exception_impl(boost::function0) (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x31052)
    #14 0x7f4536e27408  (/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0+0x26408)
    #15 0x5c3bd6 in PyObject_Call (/usr/bin/python3.5+0x5c3bd6)
    #16 0x5354ae in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5354ae)
    #17 0x5350e3 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5350e3)
    #18 0x539a12  (/usr/bin/python3.5+0x539a12)
    #19 0x53a6ce in PyEval_EvalCode (/usr/bin/python3.5+0x53a6ce)
    #20 0x573fa4  (/usr/bin/python3.5+0x573fa4)
    #21 0x4e12de in PyCFunction_Call (/usr/bin/python3.5+0x4e12de)
    #22 0x530b93 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x530b93)
    #23 0x5350e3 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5350e3)
    #24 0x539a12  (/usr/bin/python3.5+0x539a12)
    #25 0x5356a1 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5356a1)
    #26 0x539a12  (/usr/bin/python3.5+0x539a12)
    #27 0x5356a1 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5356a1)
    #28 0x539a12  (/usr/bin/python3.5+0x539a12)
    #29 0x5356a1 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5356a1)
    #30 0x539a12  (/usr/bin/python3.5+0x539a12)
    #31 0x5356a1 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5356a1)
    #32 0x5350e3 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5350e3)
    #33 0x53a81a in PyEval_EvalCodeEx (/usr/bin/python3.5+0x53a81a)
    #34 0x4e3536  (/usr/bin/python3.5+0x4e3536)
    #35 0x5c3bd6 in PyObject_Call (/usr/bin/python3.5+0x5c3bd6)
    #36 0x532a21 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x532a21)
    #37 0x539a12  (/usr/bin/python3.5+0x539a12)
    #38 0x5356a1 in PyEval_EvalFrameEx (/usr/bin/python3.5+0x5356a1)
    #39 0x539a12  (/usr/bin/python3.5+0x539a12)
    #40 0x53a6ce in PyEval_EvalCode (/usr/bin/python3.5+0x53a6ce)
    #41 0x6292c1  (/usr/bin/python3.5+0x6292c1)
    #42 0x62b769 in PyRun_FileExFlags (/usr/bin/python3.5+0x62b769)
    #43 0x62bf5b in PyRun_SimpleFileExFlags (/usr/bin/python3.5+0x62bf5b)
    #44 0x63d505 in Py_Main (/usr/bin/python3.5+0x63d505)
    #45 0x4cfd10 in main (/usr/bin/python3.5+0x4cfd10)
    #46 0x7f45439c182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #47 0x5d36e8 in _start (/usr/bin/python3.5+0x5d36e8)

@zenker
Copy link
Contributor Author

zenker commented Feb 4, 2020

Ok I found that most probably that problem is related to google/sanitizers#934.

@vaeng
Copy link
Collaborator

vaeng commented Jan 31, 2023

Ok I found that most probably that problem is related to google/sanitizers#934.

Does that still happen with the new bindings (or at all with the legacy bindings)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants