issue-#143 inconsistent module list when CLOSE loads itself

Post Reply
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#143 inconsistent module list when CLOSE loads itself

Post by Josef Templ »

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
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#143 inconsistent module list when CLOSE loads its

Post by Robert »

Josef Templ wrote:I think this fix should be considered.
Looks plausible to me.
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#143 inconsistent module list when CLOSE loads its

Post by Zinn »

Does this change makes the change issue-#84 "unloading DevDebug produces a sequence of Traps" obsolete?
It looks like that DevDebug can be unloaded without Trap, when issue-#84 is cancelled.
- Helmut
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#143 inconsistent module list when CLOSE loads its

Post by Josef Templ »

Zinn wrote:Does this change makes the change issue-#84 "unloading DevDebug produces a sequence of Traps" obsolete?
It looks like that DevDebug can be unloaded without Trap, when issue-#84 is cancelled.
- Helmut
DevDebug does not have a CLOSE section, so it should not be affected by
this issue. Did you test it?

- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#143 inconsistent module list when CLOSE loads its

Post by Zinn »

Josef,
you are right. I test it again and my result from yesterday is not repeatable.
- Helmut
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#143 inconsistent module list when CLOSE loads its

Post by Josef Templ »

For me this issue is ready for voting.

- Josef
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#143 inconsistent module list when CLOSE loads its

Post by DGDanforth »

Vote created.
Post Reply