[Bro-Dev] #460: Problem with extended records and empty container types
Bro Tracker
bro at tracker.bro-ids.org
Tue May 24 07:57:12 PDT 2011
#460: Problem with extended records and empty container types
---------------------+------------------------
Reporter: seth | Owner:
Type: Problem | Status: new
Priority: Normal | Milestone: Bro1.6
Component: Bro | Version: git/master
Keywords: |
---------------------+------------------------
If you extend a record, the empty container types don't work anymore. The
following code::
{{{
type Blah: record {
whatever: string;
};
redef record Blah += {
test2: set[count] &default=set();
};
global foobar: Blah;
}}}
Results in this crash::
{{{
[build (topic/policy-scripts-new)]$ gdb --args ./src/bro test23.bro
GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May 5 04:36:56 UTC
2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries ........ done
(gdb) r
Starting program: ./src/bro test23.bro
Reading symbols for shared libraries .+++++++ done
./test23.bro, line 6 (set() and set[count]): error, &default value has
inconsistent type
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028
0x0000000100085138 in BroType::Tag (this=0x0) at Type.h:75
75 TypeTag Tag() const { return tag; }
(gdb) bt
#0 0x0000000100085138 in BroType::Tag (this=0x0) at Type.h:75
#1 0x0000000100224e60 in same_type (t1=0x100cb2be0, t2=0x0, is_init=0) at
./src/Type.cc:1645
#2 0x00000001000a5fe3 in Attributes::CheckAttr (this=0x100cb2d70,
a=0x100cb2c90) at ./src/Attr.cc:268
#3 0x00000001000a6e2a in Attributes::AddAttr (this=0x100cb2d70,
attr=0x100cb2c90) at ./src/Attr.cc:134
#4 0x00000001000a73b0 in Attributes::Attributes (this=0x100cb2d70,
a=0x100cb2710, t=0x100cb27c0, arg_in_record=false) at ./src/Attr.cc:105
#5 0x0000000100220de3 in TypeDecl::TypeDecl (this=0x100cb2d50,
t=0x100cb27c0, i=0x100b6e0c0 "test2", arg_attrs=0x100cb2710,
in_record=false) at ./src/Type.cc:789
#6 0x0000000100080f22 in yyparse () at parse.y:954
#7 0x0000000100094a1d in main (argc=2, argv=0x7fff5fbfeba0) at
./src/main.cc:736
(gdb)
}}}
--
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/460>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list