[~] package require XOTcl 0.83 [~] Class Foo Foo [~] Foo instproc init {} {
Bar [self] }
[~] Foo instproc destroy {} {
puts rm }
[~] Class Bar Bar [~] Bar instproc init {blah} {}
[~] Foo ob rm no value given for parameter "blah" to "init" while evaluating {Foo ob} [~] Foo uh rm Segmentation fault
The "Bar [self]" line was actually a bug in my own code (oops, forgot "new"), but it's interesting to note that it resulted in a segmentation fault.
- ---------- = = ---------//--+ | / Kristoffer Lawson | www.fishpool.fi|.com +-> | setok@fishpool.com | - - --+------ |-- Fishpool Creations Ltd - / | +-------- = - - - = --------- /~setok/
"KL" == Kristoffer Lawson setok@fishpool.com writes:
KL> [~] package require XOTcl KL> 0.83 KL> [~] Class Foo KL> [~] Foo instproc init {} { Bar [self] } KL> [~] Foo instproc destroy {} { puts rm }
KL> [~] Class Bar KL> [~] Bar instproc init {blah} {}
KL> [~] Foo ob KL> rm KL> no value given for parameter "blah" to "init" KL> while evaluating {Foo ob} KL> [~] Foo uh KL> rm KL> Segmentation fault
KL> The "Bar [self]" line was actually a bug in my own code (oops, forgot KL> "new"), but it's interesting to note that it resulted in a segmentation KL> fault.
just to paraphrase the code: during the constructor of Foo, you created a new object of class Bar with the name of the instance of Foo. when you create a new command with the same name, the "old" object is deleted, and the constructor for the new command is called. but the constructor for the new object is called incorrectly, since the parameter "blah" was not provided.
During the output of the error message, XOTcl tries to provide the backtrace (callstack), but it this case it contains a command from an non-existing object.
on my system, i do not get an segfault, but an output containing freed memory. if you remove the "blah" argument from the constructor of Bar, i would expect a graceful behavior on your system as well.
If you are interested, i could send you a quick fix for the problem. However, I experimented with the problem, you are addressing, and found another related problem, for which i have no fix yet....
-gustaf
On Mon, 22 Jan 2001, Gustaf Neumann wrote:
During the output of the error message, XOTcl tries to provide the backtrace (callstack), but it this case it contains a command from an non-existing object.
on my system, i do not get an segfault, but an output containing freed memory. if you remove the "blah" argument from the constructor of Bar, i would expect a graceful behavior on your system as well.
Exactly. That's why I had the "blah" argument there. Actually on another system it segfaulted immediately while on this other system I had to create the object twice. I guess it's just a matter of when the freed memory gets used.
If you are interested, i could send you a quick fix for the problem. However, I experimented with the problem, you are addressing, and found another related problem, for which i have no fix yet....
No rush. As I mentioned, it was actually a bug in my own code that triggered this (and it would actually be an uncommon thing to do anyway). So better to spend the time fixing it properly than getting in a quick fix.
What about the instvar alias problem? Not exactly critical either as I can work around it, but is there a fix coming up/available?
- ---------- = = ---------//--+ | / Kristoffer Lawson | www.fishpool.fi|.com +-> | setok@fishpool.com | - - --+------ |-- Fishpool Creations Ltd - / | +-------- = - - - = --------- /~setok/