-
Notifications
You must be signed in to change notification settings - Fork 37
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
Elpi fail on OCaml-multicore #126
Comments
I'm aware of the failure. There is one use of Obj which I'm getting (slowly) rid of in this branch: #118. I guess you have the right compiler set up, could you please run it on this branch? |
There's
|
ok, thanks for testing. |
It's about using
A program without |
Sorry I was not clear. I know what Obj is. I was asking what chenged in the runtime of ocaml that made previously "legit" uses of magic illegal. I will investigate this. I don't recall having many uses of Obj anyway. |
I think I found the culprit, but I don't know how to fix it or to replace this code: Lines 614 to 712 in 332dbea
In particular this is the offending part: Lines 644 to 655 in 332dbea
This data structure is a faster I lack knowledge of the new Gc, would you mind putting in CC knowledgeable people? |
What I meant by that, using @kayceesrk, @Engil : have you something to share here ? |
FTR, I'm happy to replace this data structure with something else. Even better if the table keys were weak (but I did read somewhere that ephemerons are not available in 5.0...) |
@gares Ephemerons are available in 5.0. Some of the unsupportable functions in multicore have been removed. Please find the supported API here: https://github.com/ocaml-multicore/ocaml-multicore/blob/5.00/stdlib/ephemeron.mli. The removed functions have also been marked |
Thanks ill give ephemerons a try then (they were not there I believe when I coded this). But what about the int cast trick I was doing here? I found that 5.0 uses more tag bits to represent domains, but I could not find why this code is now broken. I'm curious. |
I tried to port the code to ephemerons, but I forgot I can't, this is why I had this custom map. The problem I have is that the boxed value I have cannot be hashed. In particular It is something like So I can't possibly provide a decent hash function, since all ref cells I need to use as keys contain 0. The old code was using the address of the ref cell as a hash value, and the rest of the code was coping with the fact that the GC could move the cell (something that happens for sure, but not very frequently, so after all the lookup was quick on the average). So I'm afraid I need to repair the old code. @kayceesrk could you shed some light on why the old code is broken? (the address_of thing seems the culprit). |
After some thinking I found a way, see PR #127. The performances are a bit weird, so I need to investigate more on this PR, but are OKish (there is some effect on code paths which are not really touched by the patch). One very weird thing is that the elpi parser (written in camlp5) now needs a lot more of stack space. |
The increased stack space requirement doesn't ring a bell. It may be useful to open an issue on OCaml github repo when you get the chance. Thanks! |
Hi
I found the package doesn't work on
OCaml multicore
(ocaml-variants.4.12.0+domains) because of SegfaultI did a test on
OCaml nnpchecker
(ocaml-variants.4.12.0+nnpchecker or ocaml-option-nnpchecker.1) andfound Out of heap pointer
It seems to come from using
Obj
module, it's the same for some code. Could you review yourObj
's usage please ?This is important to consider for OCaml 5.00 (next coming): ocaml-health-check
The text was updated successfully, but these errors were encountered: