-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
terminate called after throwing an instance of 'std::system_error' - after switching to version 3.6.0 (from 3.5.1) #4958
Comments
I think you are missing threading support. Maybe -pthread as an option |
I checked your suggestion but -pthread is not missed! I'm using pkg-config to add the right things to the build command and there is a difference root@um-deb8-dev:/protobuf/protobuf-3.5.1# protoc --version root@um-deb8-dev:/protobuf/protobuf-3.6.0# protoc --version But still you were right! I tried to build the binary by static flags: g++ -g -std=c++11 -static -static-libstdc++ news.config.pb.cc proto_test_Config.cpp -o proto_test_Config $(pkg-config --libs --cflags protobuf) -lpthread Not worked! g++ -g -std=c++11 -static -static-libstdc++ news.config.pb.cc proto_test_Config.cpp -o proto_test_Config $(pkg-config --libs --cflags protobuf) -Wl,--whole-archive -lpthread -Wl,--no-whole-archive So I can close this issue for now! |
This issue shouldn't be closed. You haven't found a root cause. I had the same problem linking 3.6.1 on CentOS7. Your own examples failed to work. Falling back on 3.4.1.. |
Got the same error when building bitcoin-qt: Rebuilding protobuf-3.6.1 with old bfd linker fixed it. |
Getting the same error on ubuntu 14 with 3.6.1. rolling back to pre 3.6 fixes it. |
set(CMAKE_EXE_LINKER_FLAGS "-static -pthread") |
I faced the same issue when I compiled protobuf-3.6.1 to build a library and use it for one of my custom binary. It used to work fine with protobuf-3.2.0 fine, but the binary started failing with this error after protobuf-3.6.1 upgrade.
Suggestion by 'Vaphell' in this thread https://ubuntuforums.org/showthread.php?t=2183408 pointed to g++ bug which has the workaround here https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201. For me, after I added linker flags using |
This is a workaround as shown in the link to the error below. protocolbuffers/protobuf#4958 (comment) Error message: ``` ... /usr/x86_64-pc-linux-gnu/bin/protoc --plugin=protoc-gen-c=./protoc-c/protoc-gen-c -I. --c_out=. ./t/test.proto /usr/x86_64-pc-linux-gnu/bin/protoc --plugin=protoc-gen-c=./protoc-c/protoc-gen-c -I. --c_out=. ./t/test.proto /usr/x86_64-pc-linux-gnu/bin/protoc --plugin=protoc-gen-c=./protoc-c/protoc-gen-c -I. --c_out=. ./t/test-full.proto [libprotobuf WARNING google/protobuf/compiler/parser.cc:564] No syntax specified for the proto file: t/test.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) [libprotobuf WARNING google/protobuf/compiler/parser.cc:564] No syntax specified for the proto file: t/test.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) terminate called after throwing an instance of 'std::system_error' what(): Unknown error -1 terminate called after throwing an instance of 'std::system_error' what(): Unknown error -1 [libprotobuf WARNING google/protobuf/compiler/parser.cc:564] No syntax specified for the proto file: t/test-full.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) terminate called after throwing an instance of 'std::system_error' what(): Unknown error -1 --c_out: protoc-gen-c: Plugin killed by signal 6. make: *** [Makefile:2395: t/test.pb-c.c] Error 1 make: *** Waiting for unfinished jobs.... --c_out: protoc-gen-c: Plugin killed by signal 6. make: *** [Makefile:2395: t/test.pb-c.h] Error 1 --c_out: protoc-gen-c: Plugin killed by signal 6. make: *** [Makefile:2401: t/test-full.pb-c.c] Error 1 Error: * In program cave --colour yes perform install --hooks --managed-output --output-exclusivity with-others =dev-libs/protobuf-c-1.3.2-r1:0::worr --destination installed --replacing =dev-libs/protobuf-c-1.3.2:0::installed --x-of-y 1 of 1: * When installing 'dev-libs/protobuf-c-1.3.2-r1:0::worr' replacing { 'dev-libs/protobuf-c-1.3.2:0::installed' }: * When running an ebuild command on 'dev-libs/protobuf-c-1.3.2-r1:0::worr': * Install failed for 'dev-libs/protobuf-c-1.3.2-r1:0::worr' (paludis::ActionFailedError) !!! ERROR in dev-libs/protobuf-c-1.3.2-r1::worr: !!! In /usr/x86_64-pc-linux-gnu/libexec/paludis/utils/exheres-0/emake at line 30 !!! emake returned error 2 !!! Call stack: !!! * paludis_die_or_error_func (/usr/x86_64-pc-linux-gnu/libexec/paludis/die_functions.bash:82) !!! * main (/usr/x86_64-pc-linux-gnu/libexec/paludis/utils/exheres-0/emake:30) diefunc: making ebuild PID 381047 exit with error die trap: exiting with error. Failed install to / for dev-libs/protobuf-c-1.3.2-r1:0::worr replacing 1.3.2:0::installed ```
On Alpine, TypeDB Studio causes the following error: terminate called after throwing an instance of 'std::system_error' what(): No error information Issue likely due to a bug in gcc. See: protocolbuffers/protobuf#4958
I meet the same problem when cross compile tensorflow, the protobuf version is v3.21.9, I meet error like:
|
What version of protobuf and what language are you using?
Version: v3.6.0
Language: C++
What operating system (Linux, Windows, ...) and version?
Debian Linux 9.5
What runtime / compiler are you using (e.g., python version or gcc version)
g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Linux version 4.9.0-6-amd64 ([email protected]) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02)
What did you do?
Steps to reproduce the behavior:
Just recompiled my source after changed to version 3.6.0
What did you expect to see
No runtime error!
What did you see instead?
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
gdb ./proto_test_Config
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./proto_test_Config...done.
(gdb) run
Starting program: /mnt/application/sources/txt-autocontent-news/libtxt-autocontent/proto_test_Config
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
Program received signal SIGABRT, Aborted.
0x000000000060527e in raise ()
(gdb) where
#0 0x000000000060527e in raise ()
#1 0x000000000060544a in abort ()
#2 0x00000000005e4f1d in __gnu_cxx::__verbose_terminate_handler() ()
#3 0x000000000055b446 in __cxxabiv1::__terminate(void (*)()) ()
#4 0x000000000055b491 in std::terminate() ()
#5 0x000000000055c6d9 in __cxa_throw ()
#6 0x00000000005660be in std::__throw_system_error(int) ()
#7 0x000000000042757c in std::call_once<void (&)()> (__once=..., __f=@0x4028fc: {void (void)} 0x4028fc <protobuf_news_2econfig_2eproto::AddDescriptorsImpl()>) at /usr/include/c++/6/mutex:622
#8 0x0000000000421d7c in google::protobuf::internal::call_once<std::once_flag&, void (&)()> (args#0=..., args#1=@0x4028fc: {void (void)} 0x4028fc <protobuf_news_2econfig_2eproto::AddDescriptorsImpl()>)
at /usr/local/include/google/protobuf/stubs/once.h:91
#9 0x0000000000402943 in protobuf_news_2econfig_2eproto::AddDescriptors () at news.config.pb.cc:808
#10 0x0000000000420fb1 in protobuf_news_2econfig_2eproto::StaticDescriptorInitializer::StaticDescriptorInitializer (this=0x96aeb8 <protobuf_news_2econfig_2eproto::static_descriptor_initializer>) at news.config.pb.cc:813
#11 0x000000000041d15c in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at news.config.pb.cc:815
#12 0x000000000041d172 in _GLOBAL__sub_I__ZN4NEWS53_SourceXmlFiles_FilesEntry_DoNotUse_default_instance_E () at news.config.pb.cc:7783
#13 0x00000000005fd897 in __libc_csu_init ()
#14 0x00000000005fce2b in generic_start_main ()
#15 0x00000000005fd242 in __libc_start_main ()
#16 0x0000000000401c1a in _start ()
Anything else we should know about your project / environment
Just a protobuf object tester executable (nothing complicated)!
The text was updated successfully, but these errors were encountered: