|
2019-11-14
| ||
| 19:36 | • Closed ticket [135804138e]: TclOO segmentation fault: direct call to a method c... artifact: 1a203f3ea1 user: pooryorick | |
| 19:30 | fixes bug [135804138e] check-in: 0107393da7 user: sebres tags: core-8-6-branch | |
| 17:22 | • Pending ticket [135804138e]: TclOO segmentation fault: direct call to a method ... artifact: 4965e7034f user: sebres | |
| 17:06 | fixed SF [135804138e] -- no call of next possible after object namespace is deleted check-in: c9e01c1cdc user: sebres tags: bug-135804138e | |
| 17:04 | bug [135804138e]: test case illustrating the segfault check-in: 1b14cba0a8 user: sebres tags: bug-135804138e | |
| 14:49 | • Ticket [135804138e] TclOO segmentation fault: direct call to a method called by... artifact: 45c0f4109c user: pooryorick | |
| 14:46 | • Ticket [135804138e]: 4 changes artifact: cb03b664de user: sebres | |
| 09:43 | • Ticket [135804138e]: 3 changes artifact: 6648696fde user: pooryorick | |
|
2019-11-13
| ||
| 21:35 | • Ticket [135804138e]: 3 changes artifact: 2b003b1e12 user: aku | |
| 21:32 | • Ticket [135804138e]: 3 changes artifact: 7a7347db21 user: aku | |
| 21:20 | • New ticket [135804138e]. artifact: 83c0da4d73 user: pooryorick | |
TclOO segmentation fault: direct call to a method called by the object destructor, and that deletes the object via [rename] before calling [next]
oo::class create c1 {
method m1 {} {}
}
oo::class create c2 {
superclass c1
destructor {
my m1
}
method m1 {} {
rename [self] {}
next
# nextto c1
}
}
c2 create obj1
obj1 m1
0107393da7fixes bug [135804138e] check-in2019-11-14 19:30:23c9e01c1cdcfixed SF [135804138e] -- no call of next possible after object namespace is deleted check-in2019-11-14 17:06:061b14cba0a8bug [135804138e]: test case illustrating the segfault check-in2019-11-14 17:04:39
I do not see where/how `m2` is invoked. And it seems to be an incomplete method definition as well.
I suspect that the script should be:
oo::class create c1 {
method m1 {} {}
}
oo::class create c2 {
superclass c1
destructor {
my m1
}
method m1 {} {
my m2
next
}
method m2 {} {
rename [self] {}
}
}
c2 create obj1
obj1 m1
The initial script is the wrong script. This is the correct script to reproduce the segmentation fault:
oo::class create c1 {
method m1 {} {}
}
oo::class create c2 {
superclass c1
destructor {
my m1
}
method m1 {} {
rename [self] {}
next
}
}
c2 create obj1
obj1 m1
Fixed now in branch bug-135804138e...
I had 2 variants to solve that.
In the 1st variant the result of test-case oo-7.10 would be something like:
So the "next" had successfully called "c1::m1" second time, so it had assumed that only context of object is deleted (not a class in the call chain) and all access to my/self etc would be prohibited anyway, but just because "c1::m1" behaves like a proc (without object context access) it were possible without any issue to call it second time.
- delete c2::destructor delete no-self c1::m1 unreachable /c2::destructor no-self 1 {no next method implementation}
+ delete c2::destructor delete no-self c1::m1 unreachable /c2::destructor no-self c1::m1 unreachable 0 {}
The interim decision was another variant (as it is currently implemented in branch bug-135804138e) is calling of "next" is impossible after object deletion - so it throws an error there.