Wireshark-bugs: [Wireshark-bugs] [Bug 5431] New: wireshark-1.4.2 crashes when testing the exampl

Date: Tue, 23 Nov 2010 10:52:21 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5431

           Summary: wireshark-1.4.2 crashes when testing the example
                    python dissector because of a dissector count
                    assertion
           Product: Wireshark
           Version: unspecified
          Platform: All
        OS/Version: Gentoo
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: mike.auty@xxxxxxxxx


Build Information:
Version 1.4.2

Copyright 1998-2010 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (32-bit) with GTK+ 2.22.1, with GLib 2.26.0, with libpcap 1.1.1,
without libz, with POSIX capabilities (Linux), with libpcre (version unknown),
without SMI, without c-ares, without ADNS, without Lua, with Python, with
GnuTLS
2.10.2, without Gcrypt, without Kerberos, without GeoIP, without PortAudio,
without AirPcap.

Running on Linux 2.6.36, with libpcap version 1.1.1, GnuTLS 2.10.2.

Built using gcc 4.4.5.

Wireshark is Open Source Software released under the GNU General Public
License.

Check the man page and http://www.wireshark.org for more information.
--
Hiya,

So I recently attempted to start working on python dissectors, and after
compiling wireshark-1.4.2.  Firstly the instructions don't seem up-to-date,
they mention py_dissector rather than wspy_dissector, and also the example
can't be copied verbatim because the homeplug dissector already exists. 
However, after writing my own example, I found that it would always crash as
soon as register_protocol returned a dissector.

Given the following code:

from wspy_dissector import Dissector

class testproto(Dissector):
    def protocol_ids(self):
        return [ ("ethertype", 0x887B, None) ]

    def dissect(self):
        print 'yahoo!'

def register_protocol():
    return testproto("Description", "ShortDesc", "name")

wireshark dies with a bug-buddy dialog, and a backtrace that identifies the
appropriate error message:

ERROR:about_dlg.c:251:splash_update: assertion failed: (ul_sofar <= ul_count)

This appears to be because the number of existing dissectors are hardcoded into
the compiled binary, by the pre-processed register.c file.  These don't take
account of dynamically generated dissectors (such as the python ones).

A quick work around is to comment out the assertion, which will cause wireshark
to start properly, but emit two (non-fatal) gtk warnings about the percentage
bar going over 100%, however that's not a permanent solution by any means.

If there's any further information I can provide to help fix this, please just
let me know...

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.