-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
I am doing the following steps in a single execution:
- Trying to load
Dynlink.loadfile toto.cmxs, which errors withInconsistent_import ... - Rebuilding
toto.cmxsfromtoto.ml, thus fixing the inconsistencies - Trying to load it again (the new generated
toto.cmxs), but the same error happens - Restarting the same program, no more errors with the latest
toto.cmxs
My understanding is that the program does not forget the first attempt, thus always returning the same error, even if the second dynlink should actually work. This happens both with loadfile and loadfile_private.
I think that loadfile should dlclose when the attempt fails (and maybe do some other cleanup for other errors), so that the retry can correctly work.
As a side note, it would be really nice to expose a more low-level interface on Dynlink, typically to expose the CRCs of the current state and the CRCs of successful and failed dynamic linkings. It would make debugging this kind of situations much easier.