-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
'eval' has problems, parse is not GC safe #9
Comments
I tried to save and restore the overwritten P fields. parse should be re-entrant. But it turned out the problem is that PNSource in the parser is not GC safe. all the intermediate t and lhs objects |
All the intermediate t and lhs objects in the compiler need to be moved also while in a eval, and be checked for FWDs.
re-entrancy and testcase fixed with commit d83d869
|
All the intermediate t and lhs objects in the compiler need to be moved also while in a eval, and be checked for FWDs.
I had some luck with trying to make the parser GC safe. I can't guarantee that this is the right solution, but it seems to work for me.
I made the calls right after the GC calls to the strings (for both major and minor GC)
Sorry I don't have time to make a proper pull request, as my copy of potion has diverged from this repository, as well as a lack of time. I think this should help with making the parser a bit safer though. |
Great, I'll look at it |
move struct _GREG to greg.h, expose it in P as P->parser. Idea by Peter Arthur
move struct _GREG to greg.h, expose it in P as P->parser. Idea by Peter Arthur
move struct _GREG to greg.h, expose it in P as P->parser. Idea by Peter Arthur
move struct _GREG to greg.h, expose it in P as P->parser. Idea by Peter Arthur
move struct _GREG to greg.h, expose it in P as P->parser. Idea by Peter Arthur
In potion, eval has some problems that make it behave strangely sometimes, such as that
loop: 'x = Object()' eval.
segfaults while'loop: x = Object().' eval
doesn't.I think this is due to the fact that
potion_eval
callspotion_parse
which overwrites data in theP
variable. One way to overcome this problem would be to create a newPotion
object inpotion_eval
, but that would require usingpotion_create
/potion_init
, which overwrites global variables likePN_string
that are vital to the operation of the originalPotion
object. The only way I can think of overcoming this is to usefork
inpotion_eval
.The text was updated successfully, but these errors were encountered: