Wireshark-dev: Re: [Wireshark-dev] DISSECTOR_ASSERT_NOT_REACHED in WLCCP decode...
From: "Kevin A. Noll" <spamknoll@xxxxxxxxxxxxx>
Date: Mon, 28 May 2007 21:35:48 -0400

I think I've figured out that I am getting the DISSECTOR_ASSERT because of
something related to the dissector being near the end of the tvbuff.
However, I've tried several things to try to debug exactly what occuring,
but I can't get the error to go away.

This error occurs when I am reading a structure from tvb with
proto_tree_add_item:

guint16 mic_length=0;

mic_length = tvb_get_ntohs(tvb, tlv_offset);
tlv_offset += 2;

proto_tree_add_item(tlv_tree, hf_wlccp_mic_value, tvb, tlv_offset,
mic_length, FALSE);

Where hf_wlccp_mic_value is defined as:

{ &hf_wlccp_mic_value, 
  {"MIC Value", "wlccp.mic_value", 
    FT_UINT_BYTES, BASE_DEC, NULL, 0, 
   "MIC value", HFILL }
}


I get the error even if I set the value of mic_length to something I know
does not overrun the end of tvb.

I would greatly appreciate any suggestions on how to fix my error.

Thanks!

--kan--
--
Kevin A. Noll, KD4WOZ
CCIE, CCDP
Versatile, Inc.		


-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Kevin A. Noll
Sent: Sunday, May 27, 2007 11:39 PM
To: 'Developer support list for Wireshark'
Subject: [Wireshark-dev] DISSECTOR_ASSERT_NOT_REACHED in WLCCP decode...


I am progressing on my updated WLCCP dissector, but I've run into another
(amateur) issue. This protocol allows TLVs to be tacked on to the end of a
packet with no indication of how many or how long they are until you start
reading the TLVs and iterate through them until you get to the end of the
tvbuff.

I am successfully (sort of) doing this iteration and decoding all of the TLV
fields, but on every one, the last field (the one that runs to the end of
the tvbuff) is not added to the proto_tree (even though I have the
appropriate proto_tree_add). Instead I am getting an exception that says
"Dissector bug... failed assertion DISSECTOR_ASSERT_NOT_REACHED".

I've looked at the definitions for the DISSECTOR_ASSERTs in proto.h and
can't quite figure out what this means. I've set the
WIRESHARK_ABORT_ON_DISSECTOR_BUG environment variable, but no stack trace is
printed when it aborts.

What does this exception mean and what might I be doing incorrectly to cause
this?

--kan--
--
Kevin A. Noll, KD4WOZ
CCIE, CCDP
Versatile, Inc.		

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev