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

Wireshark crashes upon clicking on fields of expanded trees

0

In 1.8.5, for custom Wimax-btsbts interface, wireshark crashes upon clicking on any of the field. Help.

asked 27 Sep '13, 02:28

sunshine's gravatar image

sunshine
16559
accept rate: 0%

Can we have crash message ?

(27 Sep '13, 03:13) Afrim

Upon debugging through Visual C++,following error msg is dispalyed :

"Unhandled exception at 0x77c478ac in wireshark.exe: 0xC0000005: Access violation reading location 0x00000003."

Call stack location is somewhere in msvcrt.dll

(27 Sep '13, 03:55) sunshine

custom Wimax-btsbts interface is it crashing when clicking fields dissected by the custom disector or any field? If the former it's probably a bug in the custom dissector. Probably something with the ett variables.

(27 Sep '13, 04:03) Anders ♦

Crashing occurs only upon clicking on the fields dissected by custom-dissector. I did check the ett variables thing, couldnt find any issue.

(27 Sep '13, 04:27) sunshine

Can you show us the code where you create the sub tree?

(27 Sep '13, 04:30) Anders ♦

ti = proto_tree_add_protocol_format(ptree, proto_btsBts, tvb, offset, -1, "btsBts"); btsbts_tree = proto_item_add_subtree(ti, ett_btsbts_eap);

//initialize btsbts_tree

//20130514 changed 0 to offset msg_type = tvb_get_guint8(tvb, offset);

if (msg_type == M_LM_LVC_REQ || msg_type == M_LM_LVC_RSP || msg_type == M_LM_LCC_REQ || msg_type == M_LM_LCC_RSP ) { if(check_col(pinfo->cinfo,COL_INFO)) { col_clear(pinfo->cinfo,COL_INFO);

    col_add_fstr(pinfo->cinfo, COL_INFO, "0x%x, %s, ", msg_type,
        val_to_str(msg_type, msg_type_vals, "Unknown (0x%04x)"));

    col_set_fence(pinfo->cinfo, COL_INFO);
}

proto_tree_add_uint_format(btsbts_tree, hf_btsbts_msg_type, tvb, offset, 1, msg_type,
    "messagetype: 0x%02X - %s", msg_type, val_to_str(msg_type, msg_type_vals, "Unknown Message Type"));

offset++;

switch (msg_type) 
{
case M_LM_LVC_REQ:
    proto_tree_add_item(btsbts_tree, hf_btsbts_client_btsid, tvb, offset, 6, FALSE );
    offset += 6;
    proto_tree_add_item(btsbts_tree, hf_btsbts_new_link_vers, tvb, offset, 4, FALSE );
    offset += 4;
    proto_tree_add_item(btsbts_tree, hf_btsbts_old_link_vers, tvb, offset, 4, FALSE );
    offset += 4;
    proto_tree_add_item(btsbts_tree, hf_btsbts_expected_server_btsid, tvb, offset, 8, FALSE );
    offset += 8;
    break;</code></pre></div><div id="comment-25311-info" class="comment-info"><span class="comment-age">(27 Sep '13, 04:36)</span> <span class="comment-user userinfo">sunshine</span></div></div><span id="25313"></span><div id="comment-25313" class="comment not_top_scorer"><div id="post-25313-score" class="comment-score"></div><div class="comment-text"><p>Try with if (tree) { ti = proto_tree_add_protocol_format(ptree, proto_btsBts, tvb, offset, -1, "btsBts"); btsbts_tree = proto_item_add_subtree(ti, ett_btsbts_eap); }</p><p>EDIT: You can try to debug your code and see where exactly the crash occur. Can we have more information about variables ? (ett, hf)</p></div><div id="comment-25313-info" class="comment-info"><span class="comment-age">(27 Sep '13, 05:29)</span> <span class="comment-user userinfo">Afrim</span></div></div></div><div id="comment-tools-25304" class="comment-tools"><span class="comments-showing"> showing 5 of 7 </span> <a href="#" class="show-all-comments-link">show 2 more comments</a></div><div class="clear"></div><div id="comment-25304-form-container" class="comment-form-container"></div><div class="clear"></div></div></td></tr></tbody></table>