Comments (7)
I installed Ubuntu 16.04 on VirtualBox on my MacBook. I am now able to reproduce the problem.
I googled and found some helpful information:
http://stackoverflow.com/questions/15311469/throwing-an-exception-from-stdcall-once
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60662
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58929
According to the suggestion on the above, I tried the following and it worked!
g++ -I .. -std=c++11 calc.cc -pthread
Could you please try it again with -pthread
?
from cpp-peglib.
It works!
The resulting executable now links against libpthread.so.0
.
Astonishingly, no linker error was produced due to a missing function pointer in __gthread_once
, this seems to be deferred to runtime.
Thank you very much for finding this out!
from cpp-peglib.
@mattulbrich, thanks for the report.
I have tried 'g++ -I .. -std=c++11 calc.cc' and 'clang++ -I .. -std=c++11 calc.cc' on my MacBook. But both worked fine, gave me '14' as a result.
Which OS or environment are you working on?
Thank you!
from cpp-peglib.
Thanks for looking into it!
I was running (x)Ubuntu 14.04 at the time, but have now updated to Ubuntu 16.04. I still receive the same problem
$ ./a.out 2+3*4
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
Aborted (core dumped)
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Also on another (opensuse) machine with g++ (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
I get the same error message.
from cpp-peglib.
And I can provide a stacktrace for you. Perhaps it helps a little ...
(gdb) bt
#0 0x00007ffff72400a7 in raise () from /lib64/libc.so.6
#1 0x00007ffff7241458 in abort () from /lib64/libc.so.6
#2 0x00007ffff7b32975 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#3 0x00007ffff7b309f6 in ?? () from /usr/lib64/libstdc++.so.6
#4 0x00007ffff7b30a41 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5 0x00007ffff7b30c58 in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6 0x00007ffff7b86dbf in std::__throw_system_error(int) () from /usr/lib64/libstdc++.so.6
#7 0x000000000041590a in std::call_once<peg::DefinitionReference::get_rule() const::{lambda()#1}>(std::once_flag&, peg::DefinitionReference::get_rule() const::{lambda()#1}&&) (__once=..., __f=<unknown type in /amd.home/home/i57/mulbrich/tmp/cpp-peglib-master/example/a.out, CU 0x15b, DIE 0x5f779>)
at /usr/include/c++/4.8/mutex:794
#8 0x0000000000408684 in peg::DefinitionReference::get_rule (this=0x66fba8) at ../peglib.h:1485
#9 0x0000000000409df0 in peg::ParserGenerator::DetectLeftRecursion::visit (this=0x7fffffffd8d0, ope=...) at ../peglib.h:1744
#10 0x0000000000408a00 in peg::DefinitionReference::accept (this=0x66fba8, v=...) at ../peglib.h:1507
from cpp-peglib.
Thanks for the good report!
from cpp-peglib.
very helpful, I encounter a bug in protobuf::Message::DebugString(), this function will call std::call_once and throw std::system_error
from cpp-peglib.
Related Issues (20)
- About macro and actions HOT 2
- .enter/.leave get called twice, but shouldn't. HOT 3
- Unable to parse "special" characters like £¤¥¦§ HOT 5
- vs.choice() always returns 0 when %whitespace is defined. HOT 1
- peg.pdf document isn't a valid PDF HOT 3
- I create a python binding for this great lib
- Assertion failed: (cut_stack.empty()), function ~Context, file peglib.h, line 803 HOT 2
- Compilation error when trying to pass both `any& dt` and an output param to peg::parser::parse() HOT 2
- Providing a base class to AstBase throws exception. HOT 1
- [Question] Is there a way to receive typed errors (not just strings with error messages)?
- Throw from action gets confusing error HOT 2
- Build is broken with clang on macOS 10.7–10.12: Undefined symbols for architecture x86_64: "typeinfo for std::bad_any_cast" HOT 2
- Why "IdentCont" isn't grouped ? HOT 1
- When executing "test-main" I'm getting segfault HOT 8
- [Question] Multiline object with matched deliminators HOT 2
- Need help understanding what my parser is doing :) HOT 2
- QUESTION: How does one use "apd" (and predicate operator) HOT 1
- Tests fail to compile HOT 3
- Performance comparison with boost::spirit, PEGTL etc.? HOT 2
- Tag 1.8.5 needed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-peglib.