Tcl Source Code

View Ticket
Login
Ticket UUID: 3514761
Title: Crash (wrong#args inst creation) class command in ensemble
Type: Bug Version: obsolete: 8.6b2
Submitter: andreas_kupries Created on: 2012-04-04 01:42:04
Subsystem: 35. TclOO Package Assigned To: dkf
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2012-04-05 04:08:28
Resolution: Fixed Closed By: dkf
    Closed on: 2012-04-04 21:08:28
Description:
TclOO crash during wrong#args instance creation for class command called through ensemble.

The attached script (crashtrial) creates an oo::class which is put into an ensemble. An instance is created, with the wrong number of arguments. This crashes deep in ProcNumArgs/Tcl_WrongNumArgs during instance construction, while the arguments to the constructor are checked.

The preliminary investigation of the resulting core file showed that something is going wrong with the ensemble rewriting machinery in TclOO, causing it to construct a bogus "desiredObjs" array for Tcl_WrongNumArgs().

This seems to be confirmed by "crashtrial2.tcl" (also attached). The only difference to "crashtrial.tcl" is that the class command is called
directly, without going through the ensemble ("k::s" vs. "k s"). This does not crash and properly throws a wrong#args error.
User Comments: dkf added on 2012-04-05 04:08:28:

allow_comments - 1

Backported as much as practical

dkf added on 2012-04-05 03:53:18:
Fixed. EEEvil interaction between ensembles and TclOO.

Kept open until backported to TclOO package.

andreas_kupries added on 2012-04-04 08:43:06:

File Added - 440237: crashtrial2.tcl

andreas_kupries added on 2012-04-04 08:42:06:

File Added - 440236: crashtrial.tcl

Attachments: