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

peglint crashes #46

Closed
mqnc opened this issue Aug 31, 2018 · 5 comments
Closed

peglint crashes #46

mqnc opened this issue Aug 31, 2018 · 5 comments

Comments

@mqnc
Copy link
Contributor

mqnc commented Aug 31, 2018

Hi!

Somehow peglint does not work for me like described in the readme:

$ cat a.peg
Additive    <- Multitive '+' Additive / Multitive
Multitive   <- Primary '*' Multitive / Primary
Primary     <- '(' Additive ')' / Number
Number      <- < [0-9]+ >
%whitespace <- [ \t]*

$ ./peglint --ast --source "1 + 2 * 3" a.peg
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error -1
Aborted (core dumped)

When I run in server mode, it shows the page and then crashes:

$ ./peglint --ast --server 8001 --source "1 + 2 * 3" a.peg
Server running at http://localhost:8001/
(now I open the browser and it shows a promising page)
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error -1
Aborted (core dumped)

I compiled and ran under Ubuntu,
The C compiler identification is GNU 7.2.0
The CXX compiler identification is GNU 7.2.0

All the best!

PS: If you can't reproduce this, I can try to provide more debug information.

@yhirose
Copy link
Owner

yhirose commented Aug 31, 2018

@mqnc, thanks for the report. But I don't reproduce it. Here is my result:

$ ./peglint --ast --source "1 + 2 * 3" a.peg
+ Additive
  + Multitive
    + Primary
      - Number (1)
  + Additive
    + Multitive
      + Primary
        - Number (2)
      + Multitive
        + Primary
          - Number (3)

What happens with $ ./peglint a.peg in your environment? (It's supposed to show nothing which means there is no syntax error in a.peg.)
Thanks!

@fire
Copy link

fire commented Sep 1, 2018

It happens on travis consistently for me too. I don't have the exact g++ version, but travis is repeatable.

@yhirose
Copy link
Owner

yhirose commented Sep 1, 2018

I setup Ubuntu 18.04 Server. I am now able to reproduce it. I'll take a look at it when I have time.

@yhirose
Copy link
Owner

yhirose commented Sep 1, 2018

@fire, I found that this problem is caused by the same reason as as the #23. Also this stackoverflow post explains the problem very well.

I updated lint/CMakeLists.txt to link pthread at 469a61f, so could you build peglint and test it again? If it works in your environment, I'll close this issue. Thanks for your help!

@mqnc
Copy link
Contributor Author

mqnc commented Sep 3, 2018

Thank you, now it works properly!

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

3 participants