[bug] Redefining a class and accessing an old selector/variable can abort the VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug] Redefining a class and accessing an old selector/variable can abort the VM

Holger Hans Peter Freyther-3
Issue status update for
http://smalltalk.gnu.org/node/648
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/648

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  zecke
 Updated by:   zecke
 Status:       active

The attached code redefines a class (by accident) and using the old
selectors will lead to an abort.

a Smalltalk string:2: assignment to undeclared variable adm_state
a Smalltalk string:2: assignment to undeclared variable op_state
RedefineCrash.st:31: Bytecode verification failed: receiver variable out
of range
RedefineCrash.st:31: Method verification failed for
OMLSubclass>>#admState:
RedefineCrash.st:31: Aborted
(ip 20)UndefinedObject>>#executeStatements
(ip 0)
Aborted



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] Redefining a class and accessing an old selector/variable can abort the VM

Paolo Bonzini-3
Issue status update for
http://smalltalk.gnu.org/project/issue/648
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/648

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  zecke
 Updated by:   bonzinip
 Status:       active

It's not nice, but I don't think it's a bug (only a QoI issue).  The
bytecode is indeed invalid.

One alternative is to rewrite the bytecodes to something that fails more
nicely (for example adding a primitive that does "self
invalidInstanceVariableAccess").



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] Redefining a class and accessing an old selector/variable can abort the VM

Holger Hans Peter Freyther-3
In reply to this post by Holger Hans Peter Freyther-3
Issue status update for
http://smalltalk.gnu.org/project/issue/648
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/648

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  zecke
 Updated by:   zecke
 Status:       active

Sounds reasonable. E.g if you use GST as scripting language of an app it
is not too nice that it can take down the entire application.

The alternative/on top of that is to pay the price on loading. It would
be nice to have an advanced >>#fileIn: that will diff the classes and
remove the missing selectors, find selectors that access removed
variables, etc.



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk