Ethereal-dev: Re: [Ethereal-dev] Help please - CVS ethereal blows up everytime

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 4 Apr 2002 02:15:49 -0800
On Thu, Apr 04, 2002 at 10:46:12AM +0100, Mark Burton wrote:
> For me, the current CVS ethereal croaks when trying to display after a
> capture:
> 
> ** ERROR **: file proto_draw.c: line 910 (proto_tree_draw_node): assertion failed: (fi->tree_type >= 0 && fi->tree_type < num_tree_types)
> aborting...
> 
> I have tried "make clean; configure; make" but it makes no
> difference.
> 
> Any suggestions?

Go into a debugger, go to the frame with "proto_tree_draw_node()", and
print "*fi->hfinfo" and "*label_ptr".

That should indicate which dissector put that node into the tree.

If it does, fix that dissector not to use the return value of an
"proto_tree_add_" routine as a "proto_tree *"; yes, "proto_tree" and
"proto_item" happen to be typedeffed to the same value, but that doesn't
mean they're the same sort of item - dissectors should assign an ett_
value to all subtrees, and use "proto_item_add_subtree()" to convert a
"proto_item *" to a "proto_tree *".

That way, when another packet with that same subtree is dissected, that
subtree will be shown as open or closed based on whether such a subtree
was most recently opened or closed, as happens with other subtrees (and
as happens with at least some other protocol analyzers).

(See, for example, line 866 of "packet-iscsi.c"; there should be an
"ett_iscsi" variable used in a "proto_item_add_subtree()" call there,
and a pointer to that variable should be in the "ett[]" array in
"proto_register_iscsi()".)