Wireshark mailing list archives

Re: ep_ memory is not garbage collected


From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Fri, 17 Aug 2012 16:02:04 +0200

On Thu, Aug 16, 2012 at 08:54:54PM -0400, Evan Huus wrote:
On Wed, Aug 15, 2012 at 11:36 AM, Jakub Zawadzki <darkjames-ws () darkjames pl> wrote:
From r43188 sequence of selecting new packet (cf_select_packet() in file.c) is:
   cf_read_frame()
   old_edt = cf->edt;
   cf->edt = epan_dissect_new()                ; edt_refs++
   epan_dissect_run(cf->edt, ...)
   if (old_edt)
     epan_dissect_free(old_edt);               ; edt_refs--  (edt_refs != 0, no gc)

Old code was doing something like:
   cf_read_frame()
   epan_dissect_free(cf->edt);               ; edt_refs--    (likely edt_refs == 0, gc ep memory)
   cf->edt = epan_dissect_new()              ; edt_refs++

I have working fix for this, but check below.

Based on the log for r43188 I expect there's someway to force clear
the GtkTreeStore, so that old_edt can be unrefed (triggering a gc)
before cf->edt is re-allocated?

Is your fix checked in or attached to a bug somewhere?

Attached, but it's more workaround than fix.

Attachment: foo.patch
Description:

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: