https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14490

            Bug ID: 14490
           Summary: Runtime Error! on PROTO_REGISTRAR_GET_NTH(hfid,
                    hfinfo);
           Product: Wireshark
           Version: Git
          Hardware: x86
                OS: Windows 10
            Status: UNCONFIRMED
          Severity: Normal
          Priority: Low
         Component: Dissection engine (libwireshark)
          Assignee: bugzilla-ad...@wireshark.org
          Reporter: paul.off...@advance7.com
  Target Milestone: ---

Build Information:
Version 2.5.1-TribeLab (v2.5.1rc0-315-gacd28932) 
Copyright 1998-2018 Gerald Combs <ger...@wireshark.org> and contributors.
License GPLv2+: GNU GPL version 2 or later
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> 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 (64-bit) with Qt 5.9.3, with WinPcap (4_1_3), with GLib 2.42.0, with
zlib 1.2.11, with SMI 0.4.8, with c-ares 1.13.0, with Lua 5.2.4, with GnuTLS
3.4.11, with Gcrypt 1.7.6, with MIT Kerberos, with GeoIP, with nghttp2 1.14.0,
with LZ4, with Snappy, with libxml2 2.9.4, with QtMultimedia, with AirPcap,
with SBC, with SpanDSP, with bcg729. 
Running on 64-bit Windows 10, build 10586, with Intel(R) Core(TM) i7-6700HQ CPU
@ 2.60GHz (with SSE4.2), with 2047 MB of physical memory, with locale
English_United Kingdom.1252, with WinPcap version 4.1.3 (packet.dll version
4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008), with
GnuTLS 3.4.11, with Gcrypt 1.7.6, with AirPcap 4.1.0 build 1622, binary plugins
supported (13 loaded). Built using Microsoft Visual C++ 14.0 build 24215 

--
While writing a dissector I messed up something in the hf array.  Wireshark
tried to issue an error but instead threw a runtime error.

The problem starts in proto_tree_prime_with_hfid(...).  The second line of code
in this function is:

    PROTO_REGISTRAR_GET_NTH(hfid, hfinfo);

As you unravel the #defines under this you get to:

    #define __DISSECTOR_ASSERT_HINT(expression, file, lineno, hint)  \
      (REPORT_DISSECTOR_BUG( \
        wmem_strdup_printf(wmem_packet_scope(), \
            "%s:%u: failed assertion \"%s\" (%s)", \
            file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression), hint)))

wmem_strdup_printf(...) calls wmem_strdup_vprintf(...) which calls
wmem_alloc(...).  wmem_alloc has:

    g_assert(allocator->in_scope);

Unfortunately, in_scope is set to FALSE.  The call stack looks like this:

    libwireshark.dll!wmem_alloc(_wmem_allocator_t * allocator, const unsigned
__int64 size) Line 41     C
    libwireshark.dll!wmem_strdup_vprintf(_wmem_allocator_t * allocator, const
char * fmt, char * ap) Line 130   C
    libwireshark.dll!wmem_strdup_printf(_wmem_allocator_t * allocator, const
char * fmt, ...) Line 68   C
    libwireshark.dll!proto_tree_prime_with_hfid(_proto_node * tree, const int
hfid) Line 6267   C
    libwireshark.dll!dfilter_prime_proto_tree(const epan_dfilter * df,
_proto_node * tree) Line 418     C
    libwireshark.dll!epan_dissect_prime_with_dfilter(epan_dissect * edt, const
epan_dfilter * dfcode) Line 618  C
    libwireshark.dll!col_custom_prime_edt(epan_dissect * edt, epan_column_info
* cinfo) Line 381        C
    Wireshark.exe!PacketListRecord::dissect(_capture_file * cap_file, bool
dissect_color) Line 175      C++
    Wireshark.exe!PacketListRecord::columnString(_capture_file * cap_file, int
column, bool colorized) Line 70  C++
    Wireshark.exe!PacketListModel::ensureRowColorized(int row) Line 705 C++

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to