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

built by msys2 with gcc 10.2.0, usShell module crash and segment fault #670

Open
bbqz007 opened this issue May 12, 2022 · 3 comments
Open

Comments

@bbqz007
Copy link

bbqz007 commented May 12, 2022

MINGW64 ~
$ gcc --version
gcc.exe (Rev6, Built by MSYS2 project) 10.2.0

gdb usShell3

(gdb) set args -llibusShellService0d.dll
(gdb) r
Starting program: 
\tmp\github\CppOSGi\build10\bin\usShell3.exe -llibusShellService0d.dll
[New Thread 11684.0x15d8]
[New Thread 11684.0xb38]
[New Thread 11684.0x3a50]
Installing libusShellService0d.dll
[New Thread 11684.0xba4]

Thread 5 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 11684.0xba4]
0x00007ffd65dc5117 in alloc_cellseg (sc=0x2ad7e1a45a0, n=3)
    at \tmp\github\CppOSGi\third_party\tinyscheme\scheme.c:596
596                   typeflag(p) = 0;
(gdb) l
591                  sc->cell_seg[--i] = p;
592              }
593              sc->fcells += CELL_SEGSIZE;
594              last = newp + CELL_SEGSIZE - 1;
595              for (p = newp; p <= last; p++) {
596                   typeflag(p) = 0;
597                   cdr(p) = p + 1;
598                   car(p) = sc->NIL;
599              }
600              /* insert new cells in address order on free list */
(gdb) bt
#0  0x00007ffd65dc5117 in alloc_cellseg (sc=0x2ad7e1a45a0, n=3)
    at \tmp\github\CppOSGi\third_party\tinyscheme\scheme.c:596
#1  0x00007ffd65dd22bc in scheme_init_custom_alloc (sc=0x2ad7e1a45a0, malloc=0x7ffd65de4180 <malloc>,
    free=0x7ffd65de41c8 <free>) at \tmp\github\CppOSGi\third_party\tinyscheme\scheme.c:4670
#2  0x00007ffd65dd2115 in scheme_init (sc=0x2ad7e1a45a0)
    at \tmp\github\CppOSGi\third_party\tinyscheme\scheme.c:4636
#3  0x00007ffd65dd2079 in scheme_init_new ()
    at \tmp\github\CppOSGi\third_party\tinyscheme\scheme.c:4616
#4  0x00007ffd65de5301 in cppmicroservices::ShellService::Impl::Impl (this=0x2ad7e1a4530)
    at \tmp\github\CppOSGi\shellservice\src\ShellService.cpp:281
#5  0x00007ffd65dc3028 in cppmicroservices::ShellService::ShellService (this=0x2ad7e186ce0)
    at \tmp\github\CppOSGi\shellservice\src\ShellService.cpp:320
#6  0x00007ffd65de60b4 in __gnu_cxx::new_allocator<cppmicroservices::ShellService>::construct<cppmicroservices::ShellService> (this=0xeb247fee6f, __p=0x2ad7e186ce0) at /msys64/mingw64/include/c++/10.2.0/ext/new_allocator.h:150
#7  0x00007ffd65ded3b0 in std::allocator_traits<std::allocator<cppmicroservices::ShellService> >::construct<cppmicroservices::ShellService> (__a=..., __p=0x2ad7e186ce0)
    at /msys64/mingw64/include/c++/10.2.0/bits/alloc_traits.h:512
#8  0x00007ffd65dee2cb in std::_Sp_counted_ptr_inplace<cppmicroservices::ShellService, std::allocator<cppmicroservices::ShellService>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<cppmicroservices::ShellService>)
    (this=0x2ad7e186cd0, __a=...) at /msys64/mingw64/include/c++/10.2.0/bits/shared_ptr_base.h:551
#9  0x00007ffd65dec35f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<cppmicroservices::ShellService, std::allocator<cppmicroservices::ShellService>>(cppmicroservices::ShellService*&, std::_Sp_alloc_shared_tag<std::allocator<cppmicroservices::ShellService> >) (this=0xeb247fefb8, __p=@0xeb247fefb0: 0x0, __a=...)
    at /msys64/mingw64/include/c++/10.2.0/bits/shared_ptr_base.h:682
#10 0x00007ffd65deb926 in std::__shared_ptr<cppmicroservices::ShellService, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<cppmicroservices::ShellService>>(std::_Sp_alloc_shared_tag<std::allocator<cppmicroservices::ShellService> >) (this=0xeb247fefb0, __tag=...) at /msys64/mingw64/include/c++/10.2.0/bits/shared_ptr_base.h:1371
#11 0x00007ffd65de9da0 in std::shared_ptr<cppmicroservices::ShellService>::shared_ptr<std::allocator<cppmicroservices::ShellService>>(std::_Sp_alloc_shared_tag<std::allocator<cppmicroservices::ShellService> >) (this=0xeb247fefb0,
--Type <RET> for more, q to quit, c to continue without paging--
    __tag=...) at /msys64/mingw64/include/c++/10.2.0/bits/shared_ptr.h:408
#12 0x00007ffd65df2bc0 in std::allocate_shared<cppmicroservices::ShellService, std::allocator<cppmicroservices::ShellService>>(std::allocator<cppmicroservices::ShellService> const&) (__a=...)
    at /msys64/mingw64/include/c++/10.2.0/bits/shared_ptr.h:860
#13 0x00007ffd65df252e in std::make_shared<cppmicroservices::ShellService> ()
    at /msys64/mingw64/include/c++/10.2.0/bits/shared_ptr.h:876
#14 0x00007ffd65de5555 in cppmicroservices::ShellActivator::Start (this=0x2ad7e189f30, context=...)
    at \tmp\github\CppOSGi\shellservice\src\ShellActivator.cpp:37
#15 0x00007ffd4d868fa9 in cppmicroservices::BundlePrivate::Start0 (this=0x2ad7e188b60)
    at \tmp\github\CppOSGi\framework\src\bundle\BundlePrivate.cpp:532
#16 0x00007ffd4d8737f2 in cppmicroservices::BundleThread::Run (this=0x2ad7e186850, fwCtx=0x2ad7e1a2630)
    at \tmp\github\CppOSGi\framework\src\bundle\BundleThread.cpp:134
#17 0x00007ffd4d9556ef in std::__invoke_impl<void, void (cppmicroservices::BundleThread::*)(cppmicroservices::CoreBundleContext*), cppmicroservices::BundleThread*, cppmicroservices::CoreBundleContext*> (__f=
    @0x2ad7e186be8: (void (cppmicroservices::BundleThread::*)(cppmicroservices::BundleThread * const, cppmicroservices::CoreBundleContext *)) 0x7ffd4d8733a0 <cppmicroservices::BundleThread::Run(cppmicroservices::CoreBundleContext*)>,
    __t=@0x2ad7e186be0: 0x2ad7e186850) at /msys64/mingw64/include/c++/10.2.0/bits/invoke.h:73
#18 0x00007ffd4d963b73 in std::__invoke<void (cppmicroservices::BundleThread::*)(cppmicroservices::CoreBundleContext*), cppmicroservices::BundleThread*, cppmicroservices::CoreBundleContext*> (__fn=
    @0x2ad7e186be8: (void (cppmicroservices::BundleThread::*)(cppmicroservices::BundleThread * const, cppmicroservices::CoreBundleContext *)) 0x7ffd4d8733a0 <cppmicroservices::BundleThread::Run(cppmicroservices::CoreBundleContext*)>)
    at /msys64/mingw64/include/c++/10.2.0/bits/invoke.h:95
#19 0x00007ffd4d92e0fe in std::thread::_Invoker<std::tuple<void (cppmicroservices::BundleThread::*)(cppmicroservices::CoreBundleContext*), cppmicroservices::BundleThread*, cppmicroservices::CoreBundleContext*> >::_M_invoke<0ull, 1ull, 2ull> (this=0x2ad7e186bd8) at /msys64/mingw64/include/c++/10.2.0/thread:264
#20 0x00007ffd4d92e127 in std::thread::_Invoker<std::tuple<void (cppmicroservices::BundleThread::*)(cppmicroservices::CoreBundleContext*), cppmicroservices::BundleThread*, cppmicroservices::CoreBundleContext*> >::operator() (
    this=0x2ad7e186bd8) at /msys64/mingw64/include/c++/10.2.0/thread:271
#21 0x00007ffd4d92dd0c in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (cppmicroservices::BundleThrea--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) p p
$1 = (pointer) 0x7e1a5660
(gdb) x /4b p
0x7e1a5660:     Cannot access memory at address 0x7e1a5660
(gdb) p newp
$2 = (pointer) 0x7e1a5660
(gdb) p *sc
$3 = {malloc = 0x7ffd65de4180 <malloc>, free = 0x7ffd65de41c8 <free>, retcode = -1163005939, tracing = -1163005939,
  alloc_seg = {
    0x2ad7e1a5650 "\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r", <incomplete sequence \272>...,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
    0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>}, cell_seg = {0x7e1a5660,
    0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d,
    0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d, 0xbaadf00dbaadf00d}, last_cell_seg = 0,
  args = 0xbaadf00dbaadf00d, envir = 0xbaadf00dbaadf00d, code = 0xbaadf00dbaadf00d, dump = 0xbaadf00dbaadf00d,
  interactive_repl = 0, _sink = {_flag = 3131961357, _object = {_string = {
        _svalue = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
        _length = -1163005939}, _number = {is_fixnum = 13 '\r', value = {ivalue = -1163005939,
          rvalue = -4.8366978272229995e-26}}, _port = 0xbaadf00dbaadf00d, _ff = 0xbaadf00dbaadf00d, _cons = {
        _car = 0xbaadf00dbaadf00d, _cdr = 0xbaadf00dbaadf00d}}}, sink = 0x2ad7e1a4688, _NIL = {_flag = 3131961357,
    _object = {_string = {_svalue = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
        _length = -1163005939}, _number = {is_fixnum = 13 '\r', value = {ivalue = -1163005939,
          rvalue = -4.8366978272229995e-26}}, _port = 0xbaadf00dbaadf00d, _ff = 0xbaadf00dbaadf00d, _cons = {
        _car = 0xbaadf00dbaadf00d, _cdr = 0xbaadf00dbaadf00d}}}, NIL = 0x2ad7e1a46a8, _HASHT = {_flag = 3131961357,
    _object = {_string = {_svalue = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
        _length = -1163005939}, _number = {is_fixnum = 13 '\r', value = {ivalue = -1163005939,
--Type <RET> for more, q to quit, c to continue without paging--
          rvalue = -4.8366978272229995e-26}}, _port = 0xbaadf00dbaadf00d, _ff = 0xbaadf00dbaadf00d, _cons = {
        _car = 0xbaadf00dbaadf00d, _cdr = 0xbaadf00dbaadf00d}}}, T = 0x2ad7e1a46c8, _HASHF = {_flag = 3131961357,
    _object = {_string = {_svalue = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
        _length = -1163005939}, _number = {is_fixnum = 13 '\r', value = {ivalue = -1163005939,
          rvalue = -4.8366978272229995e-26}}, _port = 0xbaadf00dbaadf00d, _ff = 0xbaadf00dbaadf00d, _cons = {
        _car = 0xbaadf00dbaadf00d, _cdr = 0xbaadf00dbaadf00d}}}, F = 0x2ad7e1a46e8, _EOF_OBJ = {_flag = 3131961357,
    _object = {_string = {_svalue = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
        _length = -1163005939}, _number = {is_fixnum = 13 '\r', value = {ivalue = -1163005939,
          rvalue = -4.8366978272229995e-26}}, _port = 0xbaadf00dbaadf00d, _ff = 0xbaadf00dbaadf00d, _cons = {
        _car = 0xbaadf00dbaadf00d, _cdr = 0xbaadf00dbaadf00d}}}, EOF_OBJ = 0x2ad7e1a4708,
  oblist = 0xbaadf00dbaadf00d, global_env = 0xbaadf00dbaadf00d, c_nest = 0xbaadf00dbaadf00d,
  LAMBDA = 0xbaadf00dbaadf00d, QUOTE = 0xbaadf00dbaadf00d, QQUOTE = 0xbaadf00dbaadf00d, UNQUOTE = 0xbaadf00dbaadf00d,
  UNQUOTESP = 0xbaadf00dbaadf00d, FEED_TO = 0xbaadf00dbaadf00d, COLON_HOOK = 0xbaadf00dbaadf00d,
  ERROR_HOOK = 0xbaadf00dbaadf00d, SHARP_HOOK = 0xbaadf00dbaadf00d, COMPILE_HOOK = 0xbaadf00dbaadf00d,
  free_cell = 0x2ad7e1a46a8, fcells = 5000, inport = 0x2ad7e1a46a8, outport = 0x2ad7e1a46a8,
  save_inport = 0x2ad7e1a46a8, loadport = 0x2ad7e1a46a8, load_stack = {{kind = 13 '\r', rep = {stdio = {
          file = 0xbaadf00dbaadf00d, closeit = -1163005939, curr_line = -1163005939,
          filename = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>}, string = {
          start = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
          past_the_end = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>,
          curr = 0xbaadf00dbaadf00d <error: Cannot access memory at address 0xbaadf00dbaadf00d>}}} <repeats 64 times>}, nesting_stack = {-1163005939 <repeats 64 times>}, file_i = -1163005939, nesting = 0, gc_verbose = 13 '\r',
  no_memory = 0 '\000',
  linebuff = "\255\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r"...,
  strbuff = "\255\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r--Type <RET> for more, q to quit, c to continue without paging--
\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272", <incomplete sequence \360>, tmpfp = 0xbaadf00dbaadf00d,
  tok = -1163005939, print_flag = -1163005939, value = 0xbaadf00dbaadf00d, op = -1163005939,
  ext_data = 0xbaadf00dbaadf00d, gensym_cnt = 0, vptr = 0x7ffd65df68c0 <vtbl>, dump_base = 0xbaadf00dbaadf00d,
  dump_size = -1163005939}
@bbqz007
Copy link
Author

bbqz007 commented May 12, 2022

i try two releases, 3.4.0 and 3.6.0. they are in the same problem. the msys2 has gcc 10.2.0 as default.

and when i try them on centos8, using gcc 8.2.0 and gcc-toolset-10, they are fine.

the two cases above are building 64-bit.

@bbqz007
Copy link
Author

bbqz007 commented May 12, 2022

when i come to msys2 with gcc 10.2.0 32-bit, there is no problem.

i have no idea why msys2 with mingw64 build the modules would crash.

@achristoforides
Copy link
Member

Hi @bbqz007 , thank you for taking the time to report this issue! I will try to reproduce the issue you are experiencing and if I have any questions, I will reach out.

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