This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

wireshark giving Warn Dissector bug,in packet 1056: More than 1000000 items in the tree – possible infinite loop

0

Hi currently i've written code for own plugin for RRC Messages by taking existing code reference from existing wireshark e.g:packet-gsm_rlcmac.c and i'm using some API's also from epan/dissectors,after a lot of struggle,i compiled my code and i'm facing this error Warn Dissector bug, protocol MY_PROTO, in packet 1056: More than 1000000 items in the tree -- possible infinite loop,Here MY_PROTO is my protocol name,can any body help me to resolve this issue..

asked 24 Jun '14, 22:59

sagar's gravatar image

sagar
11445
accept rate: 0%

sample of code :

    csnStream_t  ar;
    //proto_item   *ti = NULL;
    //proto_tree   *rrc_tree = NULL;
    proto_item   *ti;
    proto_tree   *rrc_tree;
    guint8 bit_offset = 0;
    bit_length = tvb_length(tvb) * 8;
    data->u.MESSAGE_TYPE = tvb_get_bits8(tvb, bit_offset, 8);
bit_offset = initial_bit_offset;

ti = proto_tree_add_protocol_format(tree,proto_gmr3g_rrc,tvb,bit_offset >> 3,-1,"RRC: %s (%d) (Uplink)",
                val_to_str_ext(data->u.MESSAGE_TYPE, &dl_rrc_message_type_vals_ext, "Unknown Messsage Type"),data->u.MESSAGE_TYPE);

rrc_tree =  proto_item_add_subtree(ti,ett_rrc);

/* Initialize the contexts */
csnStreamInit(&amp;ar,bit_offset,bit_length-bit_offset);</code></pre><p>// ar.remaining_bits_len = bit_length-bit_offset; // ar.bit_offset = bit_offset;</p><pre><code>    switch (data-&gt;u.MESSAGE_TYPE)

{

        case MT_SIGNALLING_RB_INFORMATION_SETUP:
                {
                        csnStreamDissector(rrc_tree,&amp;ar,CSNDESCR(Packet_Signalling_Info_Setup_t),tvb,&amp;data-&gt;u.Packet_Signalling_Info_Setup,ett_rrc);
                        break;

                }

        default:
                break;</code></pre></div><div id="comment-34150-info" class="comment-info"><span class="comment-age">(24 Jun '14, 23:16)</span> <span class="comment-user userinfo">sagar</span></div></div></div><div id="comment-tools-34148" class="comment-tools"></div><div class="clear"></div><div id="comment-34148-form-container" class="comment-form-container"></div><div class="clear"></div></div></td></tr></tbody></table>

One Answer:

0

As it says you probably have an infinite or long loop in your program, try running it under a debugger. Otherwise we need to see the code.

answered 24 Jun '14, 23:02

Anders's gravatar image

Anders ♦
4.6k952
accept rate: 17%

Hi i've added sample of code any body can verify it and let me know where exactly problem is ....

(25 Jun '14, 02:48) sagar

The problem probably lies in your CSN.1 description for the message. There is no loop in the code sample you pasted (which seems partial as data->u.MESSAGE_TYPE is never initialized), so we cannot help you.

(25 Jun '14, 09:06) Pascal Quantin