Wireshark-bugs: [Wireshark-bugs] [Bug 9296] Wireshark lua dissector unable to load for media_typ

Date: Tue, 22 Oct 2013 12:43:10 +0000

Comment # 7 on bug 9296 from
(In reply to comment #6)
> (In reply to comment #5)
> > The simplest fix, I think, is to have dissector_add_string do a g_strdup of
> > the key, and subsequently free it either in dissector_delete_string or when
> > the table is destroyed at the end of the program (possibly by specifying a
> > key destructor function to g_hash_table_new_full). The annoying part is that
> > this wastes a little memory for the 99.9% of strings that are static on the
> > stack, but I can't think of anything else off the top of my head.
> > 
> > Other ideas are welcome :)
> 
> I still think that using capture scope memory in the lua wrapper is
> "simpler".  While I have seen dissectors added/deleted during dissection
> (closest I can come to a real world example of your while loop), it's
> usually done in the "handoff".  And the memory footprint is small enough
> that I can live with it over punishing all other dissectors (and overall
> Wireshark memory) with the extra allocations.

I'm OK with that, though I'm rather curious now how much the difference would
actually be if we strduped all of them - I don't know how many strings we
actually register by default.

> I assume using se_ API would be prefered as it needs to be backported?

Oh, actually it would have to be epan-scope memory, since the same Lua plugin
can persist across multiple captures. Now I'm leaning towards towards strduping
all of them again...

> This also seems like a "messy" area for wmem.

Not sure what you mean?


You are receiving this mail because:
  • You are watching all bug changes.