[Bro-Dev] #740: Bug resulting in too many internal type references

Bro Tracker bro at tracker.bro-ids.org
Thu Jan 5 07:27:57 PST 2012

#740: Bug resulting in too many internal type references
 Reporter:  seth     |      Owner:
     Type:  Problem  |     Status:  new
 Priority:  Normal   |  Milestone:  Bro2.0
Component:  Bro      |    Version:
 Keywords:           |
 There is a hard limit to how many references Bro will create for a type or
 value (INT_MAX) and we are using a function incorrectly leading to
 termination after long uptimes.

 There are a few places (for example strings.bif:132) where the
 internal_type function is called to get a reference to the type for a Bro
 script level defined type.  Unfortunately when internal_type is called, it
 in turn calls lookup_ID (Var.cc:486 leading to Scope.cc:115) which looks
 up the type, adds an additional reference to it and returns it.  The code
 that called internal_type never Unrefs the value.  Eventually Obj.h:207
 causes a shutdown when INT_MAX references are created to the type.

 I'm thinking we should just lookup the type a single time at startup along
 with all of the other Bro defined types in NetVar.cc and reuse the value
 after that so we one reference it a single time.  It's more consistent
 with how the internal_type function is called for other cases.

Ticket URL: <http://tracker.bro-ids.org/bro/ticket/740>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list