ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Unable to run wireshark, tshark or dumpcap from the build di

From: Stephen Fisher <steve@xxxxxxxxxxxxxxxxxx>
Date: Sat, 2 Oct 2010 18:30:03 -0600
On Sat, Oct 02, 2010 at 07:39:36PM +0000, Chris Maynard wrote:

> 23145 occurrences

That's a lot!

> (process:19019): GLib-CRITICAL **: g_string_insert_c: assertion `pos 
> <= string-> len' failed

The GLib source usually helps me figure out these sort of problems.  
It's easiest if you have the source unpacked on the hard drive, but you 
can also stumble through Git's web interface and find it:

  http://git.gnome.org/browse/glib/tree/glib/gstring.c

In this case though, all I can tell from that function is that the 
position of the string to insert a character is greater than the length 
of the string.  What makes it harder is that Wireshark doesn't call that 
function directly, so it's either something another GLib function is 
calling or something else that uses GLib, such as GTK.  Along the lines 
of what Jaap was saying with using a debugger.  When it gets really 
complicated, I've had to build GLib myself with the debug symbols 
configure option and then install that so the symbols show up in gdb 
just like the ones from Wireshark.

> I've been seeing these errors for a long time now on this system 
> (which is why it was still running 1.0.5), but I hadn't dug deep 
> enough yet to try to figure out why and how to eliminate them.  Any 
> ideas on tracking this one down too would be greatly appreciated.  Is 
> it possibly a glib version problem?  This system is running with 
> glib2-2.12.3-2.fc6.

It could be and Wireshark only checks GLib versions when it's compiled, 
so if you upgrade GLib, Wireshark won't know.

> I can't seem to find where the minimum glib version requirement for 
> wireshark is mentioned.

GLib 2.4 is the minimum required as found in configure.in:

        AM_PATH_GLIB_2_0(2.4.0 ...

Although sometimes we make mistakes and don't realize that a function 
isn't available as early as 2.4 and since we're running a newer version, 
don't realize the problem.