[Bro-Dev] #485: Error when defining vectors of records with optional fields

Bro Tracker bro at tracker.bro-ids.org
Mon Aug 15 10:35:25 PDT 2011

#485: Error when defining vectors of records with optional fields
  Reporter:  vallenti       |      Owner:  robin
      Type:  Merge Request  |     Status:  assigned
  Priority:  Normal         |  Milestone:  Bro1.6
 Component:  Bro            |    Version:  git/master
Resolution:                 |   Keywords:
Changes (by jsiwek):

 * owner:  jsiwek => robin


 > I've removed the ref counting change as I believe it was correct in its
 original form. Eval(0) should always return a +1 ref count.

 Unless git is pulling a trick on me, that change I made looks like it's in
 master now and didn't get reverted?

 > What did you see that didn't work right?

 An eventual seg fault (e.g. in the unit test accompanying the changeset) I
 think because the Eval(0) is done on a record constructor expression,
 returning a record val with ref count of 1 which gets assigned as a vector
 element without adding a ref (VectorVal::Assign says it leaves that up to
 the caller), then it gets unref'd right after the assignment resulting in
 no more refs for that val.

Ticket URL: <http://tracker.bro-ids.org/bro/ticket/485#comment:5>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list