Tcl Source Code

View Ticket
Login
Ticket UUID: dab7fd597345b05d663195460dc33e215b09f48b
Title: Memory leak in commit [0a74820b6d]
Type: Bug Created on: 2023-02-05 12:45:34
Submitter: jan.nijtmans Assigned to: apnadkarni
Subsystem: 24. Channel Commands Severity: Important
Priority: 5 Medium Last modified: 2023-02-26 21:51:43
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2023-02-26 21:51:43
Version: tip-656
Description:

Starting with [0a74820b6d|this] commit, there's a memory-leak in tclIOCmd.c. Tcl 8.6 and 9.0 are OK.

User Comments:
pooryorick added on 2023-02-05 19:08:24:

After I commented out those lines in that block, I should have added a new line to decrement the reference count. Thank you for catching it :)


pooryorick added on 2023-02-14 10:48:01:

See issue [b8f575aa2398b0e4], for fix.


jan.nijtmans added on 2023-02-23 21:22:28:

This memory leak is still present in the tip-656 branch.

Proposed fix: [ff7923a914012c65]


apnadkarni added on 2023-02-24 02:35:23:
Will take a look.

I'm a bit surprised though. Since I later merged core-8-branch again, should not the latest core-8-branch code (with the fix) have "undone" that previous merge that introduced the memory leak?

/Ashok

apnadkarni added on 2023-02-24 03:05:55:

I've picked your proposed fix which should bring it in sync with the core-8-branch. I'm still a bit puzzled why my previous merge from core-8-branch did not pick up the change. I suppose it's because the "bouncing" of core-8-branch commits made it lose track?

Thanks for picking up on this. I would not have noticed.

/Ashok


pooryorick added on 2023-02-24 14:07:21:

apn, your branch didn't receive the fix because after I merged it into core-8-branch, Jan backed it out again.


jan.nijtmans added on 2023-02-26 21:51:43:

> I'm still a bit puzzled why my previous merge from core-8-branch did not pick up the change

That's because fossil is not always smart enough to determine what the 'pivot' of the merge should be. This is one of the corner-cases, not worth to discuss here.