请教大侠们一个dlopen返回错误的问题
1个回答
展开全部
gdb调试时运行和栈信息:
[Thread debugging using libthread_db enabled]
[New Thread 47066043974304 (LWP 11033)]
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from FeaGenSoTest
[ RUN ] FeaGenSoTest.SO_ID_TEST
./feature_generator_so/group_gen_id.so <----第1次执行OK
after handle
after create and destory
after generator
after flatten
feature size: 1
feature 1 name: 1:0-2
feature 1 value: 1.000000
after destroy
./feature_generator_so/group_gen_id.so <----第2次执行就core了
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47066043974304 (LWP 11033)]
__static_initialization_and_destruction_0 (__initialize_p=<value optimized out>, __priority=<value optimized out>)
at /usr/include/c++/4.1.2/bits/basic_string.h:1926
1926 const size_type __size = this->size();
(gdb) bt
#0 __static_initialization_and_destruction_0 (__initialize_p=<value optimized out>, __priority=<value optimized out>)
at /usr/include/c++/4.1.2/bits/basic_string.h:1926
#1 0x00002ace6ad5de72 in __do_global_ctors_aux () from ./feature_generator_so/group_gen_id.so
#2 0x00002ace6ad5668b in _init () from ./feature_generator_so/group_gen_id.so
#3 0x00002ace6ad550da in ?? () from ./feature_generator_so/group_gen_id.so
#4 0x00002ace69e7352b in call_init () from /lib64/ld-linux-x86-64.so.2
#5 0x00002ace69e73635 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#6 0x00002ace69e771e8 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#7 0x00002ace69e731b6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8 0x00002ace69e76a8b in _dl_open () from /lib64/ld-linux-x86-64.so.2
#9 0x00002ace6a4961fa in dlopen_doit () from /lib64/libdl.so.2
#10 0x00002ace69e731b6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x00002ace6a49658d in _dlerror_run () from /lib64/libdl.so.2
#12 0x00002ace6a496171 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#13 0x00000000004076bf in FeaGenSoTest::TestSo (this=0x5922c0, so_name=@0x7fff40c3ed50, generator_name=@0x7fff40c3ed40)
at feature_generator_so_test.cpp:46
#14 0x0000000000407d95 in FeaGenSoTest_SO_ID_TEST_Test::TestBody (this=0x5922c0) at feature_generator_so_test.cpp:101
#15 0x0000000000448d0e in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> ()
#16 0x000000000045c310 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> ()
#17 0x0000000000440c2d in testing::Test::Run ()
#18 0x0000000000447318 in testing::TestInfo::Run ()
#19 0x0000000000447462 in testing::TestCase::Run ()
#20 0x0000000000447746 in testing::internal::UnitTestImpl::RunAllTests ()
#21 0x000000000044932c in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> ()
#22 0x000000000045bd8a in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> ()
#23 0x0000000000440402 in testing::UnitTest::Run ()
#24 0x00000000004073cf in main (argc=1, argv=<value optimized out>) at feature_generator_so_test.cpp:153
[Thread debugging using libthread_db enabled]
[New Thread 47066043974304 (LWP 11033)]
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from FeaGenSoTest
[ RUN ] FeaGenSoTest.SO_ID_TEST
./feature_generator_so/group_gen_id.so <----第1次执行OK
after handle
after create and destory
after generator
after flatten
feature size: 1
feature 1 name: 1:0-2
feature 1 value: 1.000000
after destroy
./feature_generator_so/group_gen_id.so <----第2次执行就core了
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47066043974304 (LWP 11033)]
__static_initialization_and_destruction_0 (__initialize_p=<value optimized out>, __priority=<value optimized out>)
at /usr/include/c++/4.1.2/bits/basic_string.h:1926
1926 const size_type __size = this->size();
(gdb) bt
#0 __static_initialization_and_destruction_0 (__initialize_p=<value optimized out>, __priority=<value optimized out>)
at /usr/include/c++/4.1.2/bits/basic_string.h:1926
#1 0x00002ace6ad5de72 in __do_global_ctors_aux () from ./feature_generator_so/group_gen_id.so
#2 0x00002ace6ad5668b in _init () from ./feature_generator_so/group_gen_id.so
#3 0x00002ace6ad550da in ?? () from ./feature_generator_so/group_gen_id.so
#4 0x00002ace69e7352b in call_init () from /lib64/ld-linux-x86-64.so.2
#5 0x00002ace69e73635 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#6 0x00002ace69e771e8 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#7 0x00002ace69e731b6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8 0x00002ace69e76a8b in _dl_open () from /lib64/ld-linux-x86-64.so.2
#9 0x00002ace6a4961fa in dlopen_doit () from /lib64/libdl.so.2
#10 0x00002ace69e731b6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x00002ace6a49658d in _dlerror_run () from /lib64/libdl.so.2
#12 0x00002ace6a496171 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#13 0x00000000004076bf in FeaGenSoTest::TestSo (this=0x5922c0, so_name=@0x7fff40c3ed50, generator_name=@0x7fff40c3ed40)
at feature_generator_so_test.cpp:46
#14 0x0000000000407d95 in FeaGenSoTest_SO_ID_TEST_Test::TestBody (this=0x5922c0) at feature_generator_so_test.cpp:101
#15 0x0000000000448d0e in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> ()
#16 0x000000000045c310 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> ()
#17 0x0000000000440c2d in testing::Test::Run ()
#18 0x0000000000447318 in testing::TestInfo::Run ()
#19 0x0000000000447462 in testing::TestCase::Run ()
#20 0x0000000000447746 in testing::internal::UnitTestImpl::RunAllTests ()
#21 0x000000000044932c in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> ()
#22 0x000000000045bd8a in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> ()
#23 0x0000000000440402 in testing::UnitTest::Run ()
#24 0x00000000004073cf in main (argc=1, argv=<value optimized out>) at feature_generator_so_test.cpp:153
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询