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] Debugging an assertion failure

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 14 Apr 2017 12:45:46 -0700
On Apr 14, 2017, at 12:41 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

> On Apr 14, 2017, at 3:41 AM, Paul Offord <Paul.Offord@xxxxxxxxxxxx> wrote:
> 
>> I need some advice.  I’m debugging a problem with a dissector I’ve written.  Tshark fails with:
>> … \epan\prefs.c:414:prefs_register_module_or_subtree: assertion failed: (g_ascii_islower(c) || g_ascii_isdigit(c) || c == '_' || c == '-' || c == '.')
> 
> Your dissector probably has, in its "filter name", a character that is not any of 'a'-'z', '_', '-', or '.'.

No, that's "your *protocol* probably has...", but the code to register a protocol should already be catching that and failing.

So perhaps you're directly calling prefs_register_module() and passing it a module name containing a character that's not one of those.  Don't do that in a dissector - call prefs_register_protocol(), which uses the protocol's filter name as the preferences module name.