Wireshark-dev: [Wireshark-dev] What is the best way to locate [GLib CRITICAL] -- g_string_free:

Date: Fri, 23 Dec 2022 18:17:39 -0600

I run Wireshark 4.1.0 with my plugin dissector. It runs well, dissects packets, reports issues, and behaves as expected. I can load a capture file, that has packets of my protocol, exit Wireshark, and get no output to the command line. I can load another capture file, that has packets of my protocol, and get many many errors like:

** (wireshark:nnnnn) hh:mm:ss.fffffff [GLib CRITICAL] -- g_string_free: assertion 'string != NULL' failed

where:

  • nnnnn is always the same number within a single run of Wireshark, and changes from run to run.
  • The timestamps can be 0.01 to 0.03 seconds apart and give me more than 60 in a second.
  • The list is output whenever I run a display filter or clear the display filter.
  • The list seems to be the same size whether the filter returns all packets, or some, or even two.

 

Maybe it is getting this error in my dissector or in another one. Is the error saying that it is trying to free a non-null string that has already been freed?

 

In any event, are there any recommendations for trying to locate this error?

I am using the Visual Studio 2022 IDE.

 

Thank you,

Jay Turner