Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

Throw errors when using 'common.dg' and 'svg.dg'. #19

Closed
ty5491003 opened this issue Nov 28, 2019 · 9 comments
Closed

Throw errors when using 'common.dg' and 'svg.dg'. #19

ty5491003 opened this issue Nov 28, 2019 · 9 comments

Comments

@ty5491003
Copy link

Hi,I just started using dharma and i met some problems:
When i run: dharma -grammars dharma/grammars/common.dg -storage common -count 5, i get error info:

[Dharma] 2019-11-28 21:40:30,732 INFO: Machine random seed: 5845788605360104063
[Dharma] 2019-11-28 21:40:30,732 DEBUG: Using configuration from: /export/nisl/.conda/envs/funfuzz/lib/python3.6/site-packages/dharma/settings.py
[Dharma] 2019-11-28 21:40:30,733 DEBUG: Processing grammar content of ../../.conda/envs/funfuzz/lib/python3.6/site-packages/dharma/grammars/common.dg
[Dharma] 2019-11-28 21:40:30,737 DEBUG: Processing grammar content of dharma/grammars/common.dg
[Dharma] 2019-11-28 21:40:30,737 ERROR: Line 8 [common](value): 'common:bool' gets redefined

And when i run: dharma -grammars dharma/grammars/svg.dg -storage svg -count 5, i get the error info:

[Dharma] 2019-11-28 21:32:47,487 INFO: Machine random seed: 8969750037613965213
[Dharma] 2019-11-28 21:32:47,487 DEBUG: Using configuration from: /export/nisl/.conda/envs/funfuzz/lib/python3.6/site-packages/dharma/settings.py
[Dharma] 2019-11-28 21:32:47,488 DEBUG: Processing grammar content of ../../.conda/envs/funfuzz/lib/python3.6/site-packages/dharma/grammars/common.dg
[Dharma] 2019-11-28 21:32:47,492 DEBUG: Processing grammar content of dharma/grammars/svg.dg
Segmentation fault (core dumped)

Except this two grammar files, others are worked as expected, So i want to know what is the reason. If i typed the command incorrectly, please let me know!
Thanks, looking forward your response.

@ty5491003
Copy link
Author

@posidron Hi bro, Can you help me solve this issue?

@posidron
Copy link
Contributor

posidron commented Dec 4, 2019

@ty5491003
Your first issue appears because common.dg is a helper grammar, it acts like a standard library and is imported for any grammar run but this grammar is not built for to run alone. If you run it alone, it would get also imported as the standard library grammar and hence the re-definition occurs.

The second issue seems because maximum recursion was reached for something inside the SVG grammar. I would need more time to further inspect this now but this could potentially be a bug in the grammar caused by the 4253e07 change and the lack of maintenance for that grammar.

@posidron
Copy link
Contributor

posidron commented Dec 4, 2019

@ty5491003
I think I found the issue, could you pull and test if this works for you now? 834203f

@ty5491003
Copy link
Author

I found the second issue is intermittent, I ran dharma -grammars dharma/grammars/svg.dg ten times and three times it worked and seven times it failed. (on the old code)

This bug persists when I use 834203f version, so i think it doesn't work! @posidron

@ty5491003
Copy link
Author

BTW, my testing system is Ubuntu16.04, and python version is 3.6.8

@posidron
Copy link
Contributor

posidron commented Dec 5, 2019

Hm, are you really sure?

posidron@syren~/D/dharma λ time python3 -m dharma -grammars dharma/grammars/svg.dg -count 10000 > /dev/null
[Dharma] 2019-12-05 03:11:37,819 INFO: Machine random seed: 8752282538948304095
[Dharma] 2019-12-05 03:11:37,819 DEBUG: Using configuration from: /Users/posidron/Downloads/dharma/dharma/settings.py
[Dharma] 2019-12-05 03:11:37,820 DEBUG: Processing grammar content of dharma/grammars/common.dg
[Dharma] 2019-12-05 03:11:37,824 DEBUG: Processing grammar content of dharma/grammars/svg.dg
       50.51 real        50.34 user         0.09 sys
posidron@syren~/D/dharma λ python3 --version
Python 3.7.5

I have not yet pushed the update as package to PyPi, may be you have run the installed PyPi version rather than the code from GitHub?

@ty5491003
Copy link
Author

ty5491003 commented Dec 5, 2019

I'm sry, you are right!!! I run the wrong installed PyPi version.

When I switch to the correct version, this bug disappeared. The update is worked!

Thanks for your work.

@posidron
Copy link
Contributor

posidron commented Dec 5, 2019

Cool! A buddy of mine will push it tomorrow or so to PyPi.

@posidron posidron closed this as completed Dec 5, 2019
@posidron
Copy link
Contributor

posidron commented Dec 5, 2019

FYI: v1.3.1 landed in PyPi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants