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: SEGV on unknown address 0x000000000000 #37

Open
navarrothiago opened this issue May 23, 2021 · 0 comments
Open

AddressSanitizer: SEGV on unknown address 0x000000000000 #37

navarrothiago opened this issue May 23, 2021 · 0 comments
Assignees
Labels
bug Something isn't working test Something releated to test

Comments

@navarrothiago
Copy link
Owner

Compiled in ubuntu 18.04 and run in ubuntu 20.04

[ebpf@india] ~/package/bin $ cd /home/ebpf/package; sudo ip link set dev enp3s0f1 xdp off; sudo ip link set dev enp3s0f0 xdp off; sudo ./bin/api 10.1.1.27 80                                 
[sudo] password for ebpf:                                                                                                                                                                     
Sorry, try again.                                                                                                                                                                             
[sudo] password for ebpf:                                                                                                                                                                     
[2021-05-23 14:21:02.602] [upf_logger] [info] [220681.901196864] (/workspaces/tests/api/Server.cpp:26) Running server on endpoint 10.1.1.27:80                                                
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [bgn] Controller::setup                                                                                                     
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [bgn] RulesUtilitiesImpl::RulesUtilitiesImpl                                                                                
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [end] RulesUtilitiesImpl::RulesUtilitiesImpl                                                                                
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] (/workspaces/tests/api/Controller.cpp:37) GTP interface: enp3s0f0                                                           
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] (/workspaces/tests/api/Controller.cpp:38) UDP interface: enp3s0f1                                                           
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [bgn] &UserPlaneComponent::getInstance                                                                                      
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [bgn] UserPlaneComponent::UserPlaneComponent                                                                                
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [end] UserPlaneComponent::UserPlaneComponent                                                                                
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [end] &UserPlaneComponent::getInstance                                                                                      
[2021-05-23 14:21:05.601] [upf_logger] [debug] [220681.849340160] [bgn] UserPlaneComponent::setup                                                                                             
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [bgn] UPFProgram::UPFProgram                                                                                                
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [bgn] ProgramLifeCycle<upf_xdp_bpf_c>::ProgramLifeCycle(std::function<BPFSkeletonType *()>, std::function<                  
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [end] ProgramLifeCycle<upf_xdp_bpf_c>::ProgramLifeCycle(std::function<BPFSkeletonType *()>, std::function<                  
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [end] UPFProgram::UPFProgram                                                                                                
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [bgn] &SignalHandler::getInstance                                                                                           
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [end] &SignalHandler::getInstance                                                                                           
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [bgn] SignalHandler::enable                                                                                                 
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [end] SignalHandler::enable                                                                                                 
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [bgn] UPFProgram::setup                                                                                                     
[2021-05-23 14:21:05.602] [upf_logger] [debug] [220681.849340160] [bgn] *ProgramLifeCycle<upf_xdp_bpf_c>::open                                                                                
libbpf: sec 'xdp_entry_point': failed to find program symbol at offset 0                                                                                                                      
libbpf: failed to initialize skeleton BPF object 'upf_xdp_bpf_c': -4001                                                                                                                       
[2021-05-23 14:21:05.603] [upf_logger] [debug] [220681.849340160] [end] *ProgramLifeCycle<upf_xdp_bpf_c>::open                                                                                
[2021-05-23 14:21:05.603] [upf_logger] [debug] [220681.849340160] [bgn] UPFProgram::initializeMaps                                                                                            
[2021-05-23 14:21:05.603] [upf_logger] [debug] [220681.849340160] [bgn] *ProgramLifeCycle<upf_xdp_bpf_c>::getBPFSkeleton                                                                      
[2021-05-23 14:21:05.603] [upf_logger] [debug] [220681.849340160] [end] *ProgramLifeCycle<upf_xdp_bpf_c>::getBPFSkeleton                                                                      
ASAN:DEADLYSIGNAL                                                                                                                                                                             
=================================================================                                                                                                                             
==220681==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x56545cca2b82 bp 0x7f40329fc3f0 sp 0x7f40329fc180 T2)    
==220681==The signal is caused by a READ memory access.
==220681==Hint: address points to the zero page.
    #0 0x56545cca2b81 in std::_MakeUniq<BPFMaps>::__single_object std::make_unique<BPFMaps, bpf_object_skeleton*&>(bpf_object_skeleton*&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../
../include/c++/7.5.0/bits/unique_ptr.h:821
    #1 0x56545cca2b81 in UPFProgram::initializeMaps() /workspaces/src/programs/UPFProgram.cpp:88
    #2 0x56545cca1d67 in UPFProgram::setup() /workspaces/src/programs/UPFProgram.cpp:28
    #3 0x56545cc82d46 in UserPlaneComponent::setup(std::shared_ptr<RulesUtilities>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basi
c_string<char, std::char_traits<char>, std::allocator<char> > const&) /workspaces/src/UserPlaneComponent.cpp:95
    #4 0x56545cc61213 in Controller::setup(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned l
ong, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<c
har, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >
&) /workspaces/tests/api/Controller.cpp:40
    #5 0x56545cbcec83 in operator() /workspaces/tests/api/Server.cpp:35
    #6 0x56545cbcf69f in _M_invoke /usr/include/c++/7/bits/std_function.h:316
    #7 0x56545cbea2a2 in std::function<void (httplib::Request const&, httplib::Response&)>::operator()(httplib::Request const&, httplib::Response&) const /usr/include/c++/7/bits/std_function
.h:706
    #8 0x56545cbdde8c in httplib::Server::dispatch_request(httplib::Request&, httplib::Response&, std::vector<std::pair<std::__cxx11::basic_regex<char, std::__cxx11::regex_traits<char> >, st
d::function<void (httplib::Request const&, httplib::Response&)> >, std::allocator<std::pair<std::__cxx11::basic_regex<char, std::__cxx11::regex_traits<char> >, std::function<void (httplib::R
equest const&, httplib::Response&)> > > > const&) /usr/local/include/httplib.h:4881
    #9 0x56545cbddbe8 in httplib::Server::routing(httplib::Request&, httplib::Response&, httplib::Stream&) /usr/local/include/httplib.h:4859
    #10 0x56545cbdf436 in httplib::Server::process_request(httplib::Stream&, bool, bool&, std::function<void (httplib::Request&)> const&) /usr/local/include/httplib.h:5099
    #11 0x56545cbdf774 in httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1}::operator()(httplib::Stream&, bool, bool&) const /usr/local/include/httpli
b.h:5131
    #12 0x56545cbec747 in bool httplib::detail::process_server_socket<httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1}>(int, unsigned long, long, lon
g, long, long, long, httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1})::{lambda(bool, bool&)#1}::operator()(bool, bool&) const /usr/local/include/htt
plib.h:2012
    #13 0x56545cbf6d95 in bool httplib::detail::process_server_socket_core<bool httplib::detail::process_server_socket<httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream
&, bool, bool&)#1}>(int, unsigned long, long, long, long, long, long, httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1})::{lambda(bool, bool&)#1}>(int
, unsigned long, long, httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1}) /usr/local/include/httplib.h:1994
    #14 0x56545cbec804 in bool httplib::detail::process_server_socket<httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1}>(int, unsigned long, long, lon
g, long, long, long, httplib::Server::process_and_close_socket(int)::{lambda(httplib::Stream&, bool, bool&)#1}) /usr/local/include/httplib.h:2013
    #15 0x56545cbdf82a in httplib::Server::process_and_close_socket(int) /usr/local/include/httplib.h:5131
    #16 0x56545cbdd0ae in httplib::Server::listen_internal()::{lambda()#1}::operator()() const (/home/ebpf/package/bin/api+0x19b0ae)
    #17 0x56545cbf6226 in std::_Function_handler<void (), httplib::Server::listen_internal()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (/home/ebpf/package/bin/api+0x1b4226)
    #18 0x56545cbe6c39 in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706
    #19 0x56545cbd2da7 in httplib::ThreadPool::worker::operator()() (/home/ebpf/package/bin/api+0x190da7)
    #20 0x56545cc1a700 in void std::__invoke_impl<void, httplib::ThreadPool::worker>(std::__invoke_other, httplib::ThreadPool::worker&&) (/home/ebpf/package/bin/api+0x1d8700)
    #21 0x56545cc110ff in std::__invoke_result<httplib::ThreadPool::worker>::type std::__invoke<httplib::ThreadPool::worker>(httplib::ThreadPool::worker&&) (/home/ebpf/package/bin/api+0x1cf0
ff)
    #22 0x56545cc5fc3b in decltype (__invoke((_S_declval<0ul>)())) std::thread::_Invoker<std::tuple<httplib::ThreadPool::worker> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (/home/ebpf/package
/bin/api+0x21dc3b)
    #23 0x56545cc5fb01 in std::thread::_Invoker<std::tuple<httplib::ThreadPool::worker> >::operator()() (/home/ebpf/package/bin/api+0x21db01)
    #24 0x56545cc5f961 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<httplib::ThreadPool::worker> > >::_M_run() (/home/ebpf/package/bin/api+0x21d961)
    #25 0x7f4035fb9d83  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd6d83)
    #26 0x7f4036470608 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x9608)
    #27 0x7f4035df8292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unique_ptr.h:821 in std::_MakeUniq<BPFMaps>::__single_object std::make_unique<BPFMaps, bpf_object_skeleton*&>(bpf_object_skeleton*&)
Thread T2 created by T0 here:
    #0 0x7f40364c2b3f in pthread_create (/lib/x86_64-linux-gnu/libasan.so.4+0x38b3f)
    #1 0x7f4035fba048 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd7048)
    #2 0x56545cc015b9 in void __gnu_cxx::new_allocator<std::thread>::construct<std::thread, httplib::ThreadPool::worker>(std::thread*, httplib::ThreadPool::worker&&) (/home/ebpf/package/bin/api+0x1bf5b9)
    #3 0x56545cbf11db in void std::allocator_traits<std::allocator<std::thread> >::construct<std::thread, httplib::ThreadPool::worker>(std::allocator<std::thread>&, std::thread*, httplib::ThreadPool::worker&&) (/home/ebpf/package/bin/api+0x1af1db)
    #4 0x56545cbf129c in void std::vector<std::thread, std::allocator<std::thread> >::_M_realloc_insert<httplib::ThreadPool::worker>(__gnu_cxx::__normal_iterator<std::thread*, std::vector<std::thread, std::allocator<std::thread> > >, httplib::ThreadPool::worker&&) (/home/ebpf/package/bin/api+0x1af29c)
    #5 0x56545cbe6d9d in void std::vector<std::thread, std::allocator<std::thread> >::emplace_back<httplib::ThreadPool::worker>(httplib::ThreadPool::worker&&) (/home/ebpf/package/bin/api+0x1a4d9d)
    #6 0x56545cbd2a14 in httplib::ThreadPool::ThreadPool(unsigned long) (/home/ebpf/package/bin/api+0x190a14)
    #7 0x56545cbda45f in httplib::Server::Server()::{lambda()#1}::operator()() const (/home/ebpf/package/bin/api+0x19845f)
    #8 0x56545cbf3b49 in std::_Function_handler<httplib::TaskQueue* (), httplib::Server::Server()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (/home/ebpf/package/bin/api+0x1b1b49)
    #9 0x56545cbebc69 in std::function<httplib::TaskQueue* ()>::operator()() const (/home/ebpf/package/bin/api+0x1a9c69)
    #10 0x56545cbdd107 in httplib::Server::listen_internal() (/home/ebpf/package/bin/api+0x19b107)
    #11 0x56545cbdb05f in httplib::Server::listen(char const*, int, int) (/home/ebpf/package/bin/api+0x19905f)
    #12 0x56545cbcf1ab in main /workspaces/tests/api/Server.cpp:46
    #13 0x7f4035cfd0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

==220681==ABORTING
@navarrothiago navarrothiago added bug Something isn't working test Something releated to test labels May 23, 2021
@navarrothiago navarrothiago self-assigned this May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test Something releated to test
Projects
None yet
Development

No branches or pull requests

1 participant