Artifacts Associated With Ticket cf74deb33c
Ticket change [97515b46b4] (rid 144822) by msofer on 2016-01-31 05:55:10:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Valgrind found two leaks triggered by oo.test and ooNext.test. Stack traces are: mig@X13:~/DEVEL/tcl-core/trunk/unix$ cat ERR.leaks Leak #1 0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) 1: TclpAlloc (tclAlloc.c:699) 2: Tcl_Alloc (tclCkalloc.c:1059) 3: AllocClass (tclOO.c:1539) 4: TclNRNewObjectInstance (tclOO.c:1790) 5: TclOO_Class_Create (tclOOBasic.c:198) 6: TclOOInvokeContext (tclOOCall.c:309) 7: TclOOObjectCmdCore (tclOO.c:2635) 8: PublicNRObjectCmd (tclOO.c:2451) 9: Dispatch (tclBasic.c:4353) -- oo.test: ==26247== 832 (528 direct, 304 indirect) bytes in 2 blocks are definitely lost in loss record 3 of 4 Leak #2 0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) 1: TclpAlloc (tclAlloc.c:699) 2: Tcl_Alloc (tclCkalloc.c:1059) 3: AllocObject (tclOO.c:568) 4: TclNRNewObjectInstance (tclOO.c:1773) 5: TclOO_Class_Create (tclOOBasic.c:198) 6: TclOOInvokeContext (tclOOCall.c:309) 7: TclOOObjectCmdCore (tclOO.c:2635) 8: PublicNRObjectCmd (tclOO.c:2451) 9: Dispatch (tclBasic.c:4353) -- ooNext2.test: ==26246== 832 (304 direct, 528 indirect) bytes in 2 blocks are definitely lost in loss record 2 of 2 -- oo.test: ==26247== 1,248 (456 direct, 792 indirect) bytes in 3 blocks are definitely lost in loss record 4 of 4
- foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "msofer"
- priority initialized to: "5 Medium"
- private_contact initialized to: "214bb5765a5d2d4513fe393de9e8c8431e3e869a"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "OO leaks"
- type initialized to: "Bug"
Ticket change [958a2c935c] (rid 144823) by msofer on 2016-01-31 05:55:25:
- assignee changed to: "dkf"
- login: "msofer"
- mimetype: "text/plain"
Ticket change [b4eded59d6] (rid 144832) by dgp on 2016-01-31 23:55:51:
- icomment:
Likely suspects are http://core.tcl.tk/tcl/tktview?name=593baa032c and http://core.tcl.tk/tcl/tktview?name=3d96b7076e
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [b5cb7ba48a] (rid 144841) by dkf on 2016-02-01 23:06:22:
- icomment:
Those are very unspecific traces; they just tell me that the objects were allocated using <code>oo::class create</code>. Any chance of narrowing down which tests trigger the leaks?
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"
- icomment:
Ticket change [ceaf69bf31] (rid 144842) by dkf on 2016-02-01 23:07:35:
- icomment:
(i.e., we are leaking classes, not normal instances.)
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"
- icomment:
Ticket change [a1e0f1146c] (rid 144843) by msofer on 2016-02-01 23:43:40:
- icomment:
There is AFAIK no simple way to determine which test triggers the leak, as valgrind will (can?) only analyze the leaks on process shutdown. I guess one would have to run each test separately under valgrind.
- login: "msofer"
- mimetype: "text/plain"
- icomment:
Ticket change [7b226f4a6e] (rid 144846) by dgp on 2016-02-02 12:50:54:
- icomment:
Use the TCLTEST_OPTIONS env variable to govern the valgrind with tcltest package options. Useful ones for narrowing causes are -file -match -verbose -skip I also advise check pre- and post- each of the bugfixes I mentioned before. Knowing the patch that's bad can be as useful as knowing the test that triggers.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [46b2ebd092] (rid 144847) by dgp on 2016-02-02 18:54:12:
- icomment:
dgp oo.test leaks in oo-14.[678] dgp ooNext2.test leaks in oo-call-1.2[01]
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [ace6dcba24] (rid 144848) by dgp on 2016-02-02 18:55:33:
- icomment:
Likely suspect: inheritance and mixins.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [a78e3dfefb] (rid 144849) by dgp on 2016-02-02 20:08:38:
- icomment:
Bisecting shows that at least the oo-14.7 leak arrives with checkin http://core.tcl.tk/tcl/info/9a6b1363308cade8
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [7f29373e84] (rid 144850) by dgp on 2016-02-03 13:00:46:
- icomment:
Clear that the trouble lies in the refcount dance found in ReleaseClassContents(). These things are always tricky. Refcounts for several objects found on lists are bumped near the start. Seems that these objects get taken odd the lists before another pass through the lists decrementing the refcounts is supposed to free them.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [1b41fb1196] (rid 144865) by dkf on 2016-02-04 10:03:10:
- icomment:
The deletion code is by far the trickiest place in TclOO. It's particularly compounded by the way that <code>oo::object</code> and <code>oo::class</code> cross-reference themselves and each other. I strongly recommend only doing testing with <code>--enable-symbols=mem</code> enabled, as that catches a much higher proportion of bad behaviour (because it scribbles over memory when it releases).
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"
- icomment:
Ticket change [e2f6bd54a8] (rid 144869) by dgp on 2016-02-04 21:05:08:
- icomment:
committing patch to trunk that stops the identified leaks in the test suite.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [8a64dd8da6] (rid 144872) by dgp on 2016-02-05 19:07:49:
- assignee changed to: "dgp"
- closedate changed to: "2457424.29709524"
- closer changed to: "dgp"
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"