issue-#143 inconsistent module list when CLOSE loads itself
Posted: Tue Dec 13, 2016 9:31 am
This has been reported by x512 on the community forum http://community.blackboxframework.org/ ... f=21&t=148.
Fir the issue see http://redmine.blackboxframework.org/issues/143.
In a pathological case, the CLOSE section of a module A may load
the module to be unloaded indirectly (via loading a module B that imports A).
The result is an inconsistent module list where a module B exists in the
module list but it's imported module A does not exist in the list.
Such a module A must not be unloaded but an error should be reported.
This situation is now checked after calling the terminator (CLOSE) of a module.
The resulting behavior is in line with the finalizer semantics and with the behavior
of a module terminator that generates a Trap:
the terminator of a module is called only once.
For the diff seehttp://redmine.blackboxframework.org/pr ... 47baadb6ad.
The case is pathological, of course, but possible and the fix is simple.
The reported follow-up traps of the inconsistent module list could not be
confirmed by my experiments and x512 did not reply to multiple requests for comments
(strange behavior, what happened to x512?).
Since an inconsistent module list even without follow-up traps is very strange,
I think this fix should be considered.
- Josef
Fir the issue see http://redmine.blackboxframework.org/issues/143.
In a pathological case, the CLOSE section of a module A may load
the module to be unloaded indirectly (via loading a module B that imports A).
The result is an inconsistent module list where a module B exists in the
module list but it's imported module A does not exist in the list.
Such a module A must not be unloaded but an error should be reported.
This situation is now checked after calling the terminator (CLOSE) of a module.
The resulting behavior is in line with the finalizer semantics and with the behavior
of a module terminator that generates a Trap:
the terminator of a module is called only once.
For the diff seehttp://redmine.blackboxframework.org/pr ... 47baadb6ad.
The case is pathological, of course, but possible and the fix is simple.
The reported follow-up traps of the inconsistent module list could not be
confirmed by my experiments and x512 did not reply to multiple requests for comments
(strange behavior, what happened to x512?).
Since an inconsistent module list even without follow-up traps is very strange,
I think this fix should be considered.
- Josef