Merge remote-tracking branch 'origin/topic/vern/Mar23-script-opt-maint'

* origin/topic/vern/Mar23-script-opt-maint:
  extend BTest "path" canonicalization to include compiled-to-C++ variable names
  use a subclass of TableType for incremental construction of compiled scripts
  script_opt/CPP: errors, recursive type fixes, fix embedded comments
  Fix for EnumVal's returning their underlying value
This commit is contained in:
Arne Welzel 2023-03-08 10:43:00 +01:00
commit c8cdc75f2b
34 changed files with 228 additions and 76 deletions

26
CHANGES
View file

@ -1,3 +1,29 @@
6.0.0-dev.162 | 2023-03-08 10:43:00 +0100
* extend BTest "path" canonicalization to include compiled-to-C++ variable names (Vern Paxson, Corelight)
* use a subclass of TableType for incremental construction of compiled scripts (Vern Paxson, Corelight)
* script_opt/CPP: errors, recursive type fixes, fix embedded comments (Vern Paxson, Corelight)
better (than nothing) run-time errors for compiled scripts
fixes for dealing with recursive types in compiled scripts
fix for values in compiled scripts containing embedded comment markers
* Fix for EnumVal's returning their underlying value (Vern Paxson, Corelight)
Change EnumVal()->AsEnum() to zeek_int_t.
* Manually prune CI ccache. (Benjamin Bannier, Corelight)
Since ccache in Cirrus currently does not preserve timestamps the
timestamp-based cache pruning implemented by ccache likely would just
remove random files. To work around this, this patch implements a manual
pruning step. This step runs after the build so that at least the files
used in the build should have their timestamps updated. We can then
force eviction of some of the unused files from the cache by cleaning
the cache with a size less than the maximum cache size.
6.0.0-dev.155 | 2023-03-07 09:28:27 -0700
* Add trigger_mgr to iosource_mgr later during startup (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
6.0.0-dev.155
6.0.0-dev.162

View file

@ -155,7 +155,7 @@ public:
UNDERLYING_ACCESSOR_DECL(detail::IntValImplementation, zeek_int_t, AsInt)
UNDERLYING_ACCESSOR_DECL(BoolVal, bool, AsBool)
UNDERLYING_ACCESSOR_DECL(EnumVal, int, AsEnum)
UNDERLYING_ACCESSOR_DECL(EnumVal, zeek_int_t, AsEnum)
UNDERLYING_ACCESSOR_DECL(detail::UnsignedValImplementation, zeek_uint_t, AsCount)
UNDERLYING_ACCESSOR_DECL(detail::DoubleValImplementation, double, AsDouble)
UNDERLYING_ACCESSOR_DECL(TimeVal, double, AsTime)
@ -1476,7 +1476,7 @@ protected:
friend class Val;
friend class EnumType;
friend EnumValPtr make_enum__CPP(TypePtr t, int i);
friend EnumValPtr make_enum__CPP(TypePtr t, zeek_int_t i);
template <class T, class... Ts> friend IntrusivePtr<T> make_intrusive(Ts&&... args);
@ -1700,7 +1700,7 @@ private:
UNDERLYING_ACCESSOR_DEF(detail::IntValImplementation, zeek_int_t, AsInt)
UNDERLYING_ACCESSOR_DEF(BoolVal, bool, AsBool)
UNDERLYING_ACCESSOR_DEF(EnumVal, int, AsEnum)
UNDERLYING_ACCESSOR_DEF(EnumVal, zeek_int_t, AsEnum)
UNDERLYING_ACCESSOR_DEF(detail::UnsignedValImplementation, zeek_uint_t, AsCount)
UNDERLYING_ACCESSOR_DEF(detail::DoubleValImplementation, double, AsDouble)
UNDERLYING_ACCESSOR_DEF(TimeVal, double, AsTime)

View file

@ -729,7 +729,8 @@ bool Manager::PublishLogCreate(EnumVal* stream, EnumVal* writer,
if ( ! stream_id )
{
reporter->Error("Failed to remotely log: stream %d doesn't have name", stream->AsEnum());
reporter->Error("Failed to remotely log: stream %" PRId64 " doesn't have name",
stream->AsEnum());
return false;
}
@ -737,7 +738,8 @@ bool Manager::PublishLogCreate(EnumVal* stream, EnumVal* writer,
if ( ! writer_id )
{
reporter->Error("Failed to remotely log: writer %d doesn't have name", writer->AsEnum());
reporter->Error("Failed to remotely log: writer %" PRId64 " doesn't have name",
writer->AsEnum());
return false;
}
@ -784,7 +786,8 @@ bool Manager::PublishLogWrite(EnumVal* stream, EnumVal* writer, string path, int
if ( ! stream_id )
{
reporter->Error("Failed to remotely log: stream %d doesn't have name", stream->AsEnum());
reporter->Error("Failed to remotely log: stream %" PRId64 " doesn't have name",
stream->AsEnum());
return false;
}
@ -792,7 +795,8 @@ bool Manager::PublishLogWrite(EnumVal* stream, EnumVal* writer, string path, int
if ( ! writer_id )
{
reporter->Error("Failed to remotely log: writer %d doesn't have name", writer->AsEnum());
reporter->Error("Failed to remotely log: writer %" PRId64 " doesn't have name",
writer->AsEnum());
return false;
}

View file

@ -178,7 +178,6 @@ public:
// The same, for a single attribute.
std::shared_ptr<CPP_InitInfo> RegisterAttr(const AttrPtr& attr);
int AttrOffset(const AttrPtr& attr) { return GI_Offset(RegisterAttr(attr)); }
// Returns a mapping of from Attr objects to their associated
// initialization information. The Attr must have previously
@ -595,6 +594,10 @@ private:
// Maps function names to priorities, for hooks & event handlers.
std::unordered_map<std::string, int> body_priorities;
// Maps function names to script locations, for better-than-nothing
// error reporting.
std::unordered_map<std::string, const Location*> body_locs;
// Maps function names to events relevant to them.
std::unordered_map<std::string, std::vector<std::string>> body_events;

View file

@ -103,6 +103,7 @@ void CPPCompile::CreateFunction(const FuncTypePtr& ft, const ProfileFunc* pf, co
body_hashes[fname] = pf->HashVal();
body_priorities[fname] = priority;
body_locs[fname] = body->GetLocationInfo();
body_names.emplace(body.get(), fname);
}
@ -136,13 +137,19 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c
}
}
Emit("%s_cl(const char* name%s) : CPPStmt(name)%s { }", fname, addl_args, inits);
const Obj* stmts = pf->ProfiledBody();
if ( ! stmts )
stmts = pf->ProfiledExpr();
auto loc = stmts->GetLocationInfo();
auto loc_info = string("\"") + loc->filename + "\", " + Fmt(loc->first_line);
Emit("%s_cl(const char* name%s) : CPPStmt(name, %s)%s { }", fname, addl_args, loc_info, inits);
// An additional constructor just used to generate place-holder
// instances, due to the mis-design that lambdas are identified
// by their Func objects rather than their FuncVal objects.
if ( lambda_ids && lambda_ids->length() > 0 )
Emit("%s_cl(const char* name) : CPPStmt(name) { }", fname);
Emit("%s_cl(const char* name) : CPPStmt(name, %s) { }", fname, loc_info);
Emit("ValPtr Exec(Frame* f, StmtFlowType& flow) override final");
StartBlock();
@ -178,7 +185,8 @@ void CPPCompile::DeclareDynCPPStmt()
Emit("class CPPDynStmt : public CPPStmt");
Emit("\t{");
Emit("public:");
Emit("\tCPPDynStmt(const char* _name, void* _func, int _type_signature) : CPPStmt(_name), "
Emit("\tCPPDynStmt(const char* _name, void* _func, int _type_signature, const char* filename, "
"int line_num) : CPPStmt(_name, filename, line_num), "
"func(_func), type_signature(_type_signature) { }");
Emit("\tValPtr Exec(Frame* f, StmtFlowType& flow) override final;");
Emit("private:");

View file

@ -274,9 +274,6 @@ shared_ptr<CPP_InitsInfo> CPPCompile::RegisterInitInfo(const char* tag, const ch
void CPPCompile::RegisterCompiledBody(const string& f)
{
auto h = body_hashes[f];
auto p = body_priorities[f];
// Build up an initializer of the events relevant to the function.
string events;
auto be = body_events.find(f);
@ -293,8 +290,15 @@ void CPPCompile::RegisterCompiledBody(const string& f)
auto fi = func_index.find(f);
ASSERT(fi != func_index.end());
auto type_signature = casting_index[fi->second];
Emit("\tCPP_RegisterBody(\"%s\", (void*) %s, %s, %s, %s, std::vector<std::string>(%s)),", f, f,
Fmt(type_signature), Fmt(p), Fmt(h), events);
auto h = body_hashes[f];
auto p = body_priorities[f];
auto loc = body_locs[f];
auto body_info = Fmt(p) + ", " + Fmt(h) + ", \"" + loc->filename + " (C++)\", " +
Fmt(loc->first_line);
Emit("\tCPP_RegisterBody(\"%s\", (void*) %s, %s, %s, std::vector<std::string>(%s)),", f, f,
Fmt(type_signature), body_info, events);
}
void CPPCompile::GenEpilog()
@ -368,6 +372,7 @@ void CPPCompile::GenCPPDynStmt()
StartBlock();
Emit("flow = FLOW_RETURN;");
Emit("f->SetOnlyCall(ce.get());");
Emit("switch ( type_signature )");
StartBlock();
@ -481,7 +486,8 @@ void CPPCompile::GenRegisterBodies()
Emit("for ( auto& b : CPP__bodies_to_register )");
StartBlock();
Emit("auto f = make_intrusive<CPPDynStmt>(b.func_name.c_str(), b.func, b.type_signature);");
Emit("auto f = make_intrusive<CPPDynStmt>(b.func_name.c_str(), b.func, b.type_signature, "
"b.filename, b.line_num);");
auto reg = standalone ? "register_standalone_body" : "register_body";
Emit("%s__CPP(f, b.priority, b.h, b.events, finish_init__CPP);", reg);

View file

@ -1336,7 +1336,7 @@ string CPPCompile::GenEnum(const TypePtr& t, const ValPtr& ev)
if ( ! et->HasRedefs() )
// Can use direct access.
return Fmt(v);
return std::to_string(v);
// Need to dynamically map the access.
int mapping_slot;

View file

@ -23,6 +23,28 @@ void CPPFunc::Describe(ODesc* d) const
d->Add(name);
}
CPPStmt::CPPStmt(const char* _name, const char* filename, int line_num)
: Stmt(STMT_CPP), name(_name)
{
// We build a fake CallExpr node to be used for error-reporting.
// It doesn't matter that it matches the actual function/event/hook
// type-checking-wise, but it *does* need to type-check.
auto no_args = make_intrusive<RecordType>(nullptr);
auto no_yield = base_type(TYPE_VOID);
auto ft = make_intrusive<FuncType>(no_args, no_yield, FUNC_FLAVOR_FUNCTION);
vector<StmtPtr> no_bodies;
vector<int> no_priorities;
auto sf = make_intrusive<ScriptFunc>(name, ft, no_bodies, no_priorities);
auto fv = make_intrusive<FuncVal>(sf);
auto empty_args = make_intrusive<ListExpr>();
ce = make_intrusive<CallExpr>(make_intrusive<ConstExpr>(fv), empty_args);
Location loc(filename, line_num, line_num, 1, 1);
ce->SetLocationInfo(&loc);
}
CPPLambdaFunc::CPPLambdaFunc(string _name, FuncTypePtr ft, CPPStmtPtr _l_body)
: ScriptFunc(move(_name), move(ft), {_l_body}, {0})
{

View file

@ -43,7 +43,7 @@ protected:
class CPPStmt : public Stmt
{
public:
CPPStmt(const char* _name) : Stmt(STMT_CPP), name(_name) { }
CPPStmt(const char* _name, const char* filename, int line_num);
const std::string& Name() { return name; }
@ -71,6 +71,9 @@ protected:
std::string name;
p_hash_type hash = 0ULL;
// A pseudo AST "call" node, used to support error localization.
CallExprPtr ce;
};
using CPPStmtPtr = IntrusivePtr<CPPStmt>;

View file

@ -1,5 +1,7 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include <regex>
#include "zeek/Desc.h"
#include "zeek/RE.h"
#include "zeek/ZeekString.h"
@ -95,7 +97,16 @@ void CPP_InitsInfo::BuildCohort(CPPCompile* c, std::vector<std::shared_ptr<CPP_I
vector<string> ivs;
auto o = co->InitObj();
if ( o )
c->Emit("/* #%s: Initializing %s: */", Fmt(co->Offset()), obj_desc(o));
{
auto od = obj_desc(o);
// Escape any embedded comment characters.
od = regex_replace(od, std::regex("/\\*"), "<<SLASH-STAR>>");
od = regex_replace(od, std::regex("\\*/"), "<<STAR-SLASH>>");
c->Emit("/* #%s: Initializing %s: */", Fmt(co->Offset()), od);
}
co->InitializerVals(ivs);
BuildCohortElement(c, co->InitializerType(), ivs);
++n;
@ -286,7 +297,8 @@ AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c)
if ( a_e )
{
auto gi = c->RegisterType(a_e->GetType());
init_cohort = max(init_cohort, gi->InitCohort() + 1);
if ( gi )
init_cohort = max(init_cohort, gi->InitCohort() + 1);
if ( ! CPPCompile::IsSimpleInitExpr(a_e) )
{
@ -307,7 +319,7 @@ AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c)
else if ( a_e->Tag() == EXPR_NAME )
{
auto g = a_e->AsNameExpr()->Id();
auto gi = c->RegisterGlobal(g);
gi = c->RegisterGlobal(g);
init_cohort = max(init_cohort, gi->InitCohort() + 1);
vals.emplace_back(Fmt(static_cast<int>(AE_NAME)));
@ -383,7 +395,8 @@ CallExprInitInfo::CallExprInitInfo(CPPCompile* c, ExprPtr _e, string _e_name, st
: CPP_InitInfo(_e), e(move(_e)), e_name(move(_e_name)), wrapper_class(move(_wrapper_class))
{
auto gi = c->RegisterType(e->GetType());
init_cohort = max(init_cohort, gi->InitCohort() + 1);
if ( gi )
init_cohort = max(init_cohort, gi->InitCohort() + 1);
}
LambdaRegistrationInfo::LambdaRegistrationInfo(CPPCompile* c, string _name, FuncTypePtr ft,
@ -477,12 +490,15 @@ void ListTypeInfo::AddInitializerVals(std::vector<std::string>& ivs) const
TableTypeInfo::TableTypeInfo(CPPCompile* _c, TypePtr _t) : AbstractTypeInfo(_c, move(_t))
{
// Note, we leave init_cohort at 0 because the skeleton of this type
// is built in the first cohort.
auto tbl = t->AsTableType();
auto gi = c->RegisterType(tbl->GetIndices());
ASSERT(gi);
indices = gi->Offset();
init_cohort = gi->InitCohort();
final_init_cohort = gi->InitCohort();
yield = tbl->Yield();
@ -490,7 +506,7 @@ TableTypeInfo::TableTypeInfo(CPPCompile* _c, TypePtr _t) : AbstractTypeInfo(_c,
{
gi = c->RegisterType(yield);
if ( gi )
init_cohort = max(init_cohort, gi->InitCohort());
final_init_cohort = max(final_init_cohort, gi->InitCohort());
}
}

View file

@ -257,7 +257,7 @@ EnumTypePtr get_enum_type__CPP(const string& enum_type_name)
return make_intrusive<EnumType>(enum_type_name);
}
EnumValPtr make_enum__CPP(TypePtr t, int i)
EnumValPtr make_enum__CPP(TypePtr t, zeek_int_t i)
{
auto et = cast_intrusive<EnumType>(move(t));
return make_intrusive<EnumVal>(et, i);

View file

@ -16,6 +16,21 @@ using FuncValPtr = IntrusivePtr<zeek::FuncVal>;
namespace detail
{
// A version of TableType that allows us to first build a "stub" and
// then fill in its actual index & yield later - necessary for dealing
// with recursive types.
class CPPTableType : public TableType
{
public:
CPPTableType() : TableType(nullptr, nullptr){};
void SetIndexAndYield(TypeListPtr ind, TypePtr yield)
{
ind = std::move(indices);
yield_type = std::move(yield);
}
};
// An initialization hook for a collection of compiled-to-C++ functions
// (the result of a single invocation of the compiler on a set of scripts).
using CPP_init_func = void (*)();
@ -84,7 +99,7 @@ extern EnumTypePtr get_enum_type__CPP(const std::string& enum_type_name);
// Returns an enum value corresponding to the given low-level value 'i'
// in the context of the given enum type 't'.
extern EnumValPtr make_enum__CPP(TypePtr t, int i);
extern EnumValPtr make_enum__CPP(TypePtr t, zeek_int_t i);
} // namespace zeek::detail
} // namespace zeek

View file

@ -271,6 +271,9 @@ void CPP_TypeInits::PreInit(InitsManager* im, int offset, ValElemVec& init_vals)
inits_vec[offset] = get_record_type__CPP(nullptr);
}
else if ( tag == TYPE_TABLE )
inits_vec[offset] = make_intrusive<CPPTableType>();
// else no pre-initialization needed
}
@ -320,7 +323,7 @@ void CPP_TypeInits::Generate(InitsManager* im, vector<TypePtr>& ivec, int offset
break;
case TYPE_TABLE:
t = BuildTableType(im, init_vals);
t = BuildTableType(im, init_vals, offset);
break;
case TYPE_FUNC:
@ -394,13 +397,18 @@ TypePtr CPP_TypeInits::BuildTypeList(InitsManager* im, ValElemVec& init_vals, in
return tl;
}
TypePtr CPP_TypeInits::BuildTableType(InitsManager* im, ValElemVec& init_vals) const
TypePtr CPP_TypeInits::BuildTableType(InitsManager* im, ValElemVec& init_vals, int offset) const
{
auto t = cast_intrusive<CPPTableType>(inits_vec[offset]);
ASSERT(t);
auto index = cast_intrusive<TypeList>(im->Types(init_vals[1]));
auto yield_i = init_vals[2];
auto yield = yield_i >= 0 ? im->Types(yield_i) : nullptr;
return make_intrusive<TableType>(index, yield);
t->SetIndexAndYield(index, yield);
return t;
}
TypePtr CPP_TypeInits::BuildFuncType(InitsManager* im, ValElemVec& init_vals) const

View file

@ -307,7 +307,7 @@ protected:
TypePtr BuildTypeType(InitsManager* im, ValElemVec& init_vals) const;
TypePtr BuildVectorType(InitsManager* im, ValElemVec& init_vals) const;
TypePtr BuildTypeList(InitsManager* im, ValElemVec& init_vals, int offset) const;
TypePtr BuildTableType(InitsManager* im, ValElemVec& init_vals) const;
TypePtr BuildTableType(InitsManager* im, ValElemVec& init_vals, int offset) const;
TypePtr BuildFuncType(InitsManager* im, ValElemVec& init_vals) const;
TypePtr BuildRecordType(InitsManager* im, ValElemVec& init_vals, int offset) const;
};
@ -556,9 +556,11 @@ protected:
struct CPP_RegisterBody
{
CPP_RegisterBody(std::string _func_name, void* _func, int _type_signature, int _priority,
p_hash_type _h, std::vector<std::string> _events)
p_hash_type _h, const char* _filename, int _line_num,
std::vector<std::string> _events)
: func_name(std::move(_func_name)), func(_func), type_signature(_type_signature),
priority(_priority), h(_h), events(std::move(_events))
priority(_priority), h(_h), filename(_filename), line_num(_line_num),
events(std::move(_events))
{
}
@ -567,6 +569,8 @@ struct CPP_RegisterBody
int type_signature;
int priority;
p_hash_type h;
const char* filename;
int line_num;
std::vector<std::string> events;
};

View file

@ -47,8 +47,6 @@ extern ValPtr when_index_slice__CPP(VectorVal* vec, const ListVal* lv);
// but (2) needing to have the address of that vector.
inline ValPtr invoke__CPP(Func* f, std::vector<ValPtr> args, Frame* frame)
{
if ( frame )
frame->SetOnlyCall(nullptr);
return f->Invoke(&args, frame);
}

View file

@ -551,7 +551,7 @@ void CPPCompile::GenForOverString(const ExprPtr& str, const IDPList* loop_vars)
{
Emit("auto sval__CPP = %s;", GenExpr(str, GEN_DONT_CARE));
Emit("for ( auto i__CPP = 0u; i__CPP < sval__CPP->Len(); ++i__CPP )");
Emit("for ( auto i__CPP = 0; i__CPP < sval__CPP->Len(); ++i__CPP )");
StartBlock();
Emit("auto sv__CPP = make_intrusive<StringVal>(1, (const char*) sval__CPP->Bytes() + i__CPP);");

View file

@ -15,7 +15,7 @@ The maintenance workflow:
to check in updates to the list of how the compiler currently fares
on various btests (see end of this doc):
Tue Feb 14 15:15:27 PST 2023
Sun Mar 5 12:02:44 PST 2023
2. Make sure the compiler can compile and execute the base scripts:
@ -42,7 +42,7 @@ The maintenance workflow:
"-O gen-C++" can successfully run on the input. Presently, it should
be able to do so for all of them, other than some exceptions noted below.
This step is parallelizable, say using xargs -P 10.
This step is parallelizable, say using xargs -P 10 -n 1.
7. Copy ./src/zeek to ./zeek.HOLD. This is used to speed up recompilation used
in the next step. However, it's also a headache to do development to

View file

@ -0,0 +1,6 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
hi
es
-------------------
0
0

View file

@ -0,0 +1,11 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
#separator \x09
#set_separator ,
#empty_field (empty)
#unset_field -
#path weird
#open XXXX-XX-XX-XX-XX-XX
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p name addl notice peer source
#types time string addr port addr port string string bool string string
XXXXXXXXXX.XXXXXX - - - - - max_find_all_string_length_exceeded <...>/find_all.zeek (C++), line 7: length 14 exceeded 5 F zeek -
#close XXXX-XX-XX-XX-XX-XX

View file

@ -0,0 +1,10 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
[this, is, a, test]
[one, two, three, four, one, two, three, four]
[this, is, a, test, test, test]
[]
[a, b]
[foo]
[bar, foo]
[]
[]

View file

@ -0,0 +1,11 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
#separator \x09
#set_separator ,
#empty_field (empty)
#unset_field -
#path weird
#open XXXX-XX-XX-XX-XX-XX
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p name addl notice peer source
#types time string addr port addr port string string bool string string
XXXXXXXXXX.XXXXXX - - - - - max_find_all_string_length_exceeded <...>/find_all_ordered.zeek (C++), line 7: length 14 exceeded 5 F zeek -
#close XXXX-XX-XX-XX-XX-XX

View file

@ -1,2 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <no location>: failed converting string to IP address (not an IP)
error in <...>/to_addr.zeek (C++), line 12: failed converting string to IP address (<___>testing_btest__tmp_bifs_to_addr_to_addr_zeek__global_stmts__zf() and not an IP)

View file

@ -1,3 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <no location>: bad conversion to double (NotADouble)
error in <no location>: bad conversion to double ()
error in <...>/to_double_from_string.zeek (C++), line 12: bad conversion to double (<___>testing_btest__tmp_bifs_to_double_from_string_to_double_from_string_zeek__global_stmts__zf() and NotADouble)
error in <...>/to_double_from_string.zeek (C++), line 12: bad conversion to double (<___>testing_btest__tmp_bifs_to_double_from_string_to_double_from_string_zeek__global_stmts__zf() and )

View file

@ -1,4 +1,4 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <no location>: failed converting string to IP prefix (10.0.0.0)
error in <no location>: failed converting string to IP prefix (10.0.0.0/222)
error in <no location>: failed converting string to IP prefix (don't work)
error in <...>/to_subnet.zeek (C++), line 6: failed converting string to IP prefix (<___>testing_btest__tmp_bifs_to_subnet_to_subnet_zeek__global_stmts__zf() and 10.0.0.0)
error in <...>/to_subnet.zeek (C++), line 6: failed converting string to IP prefix (<___>testing_btest__tmp_bifs_to_subnet_to_subnet_zeek__global_stmts__zf() and 10.0.0.0/222)
error in <...>/to_subnet.zeek (C++), line 6: failed converting string to IP prefix (<___>testing_btest__tmp_bifs_to_subnet_to_subnet_zeek__global_stmts__zf() and don't work)

View file

@ -1,6 +1,6 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error: Failed to attach master store backend_failure:
error: Could not create Broker master store '../fail'
error in <...>/create-failure.zeek (C++), line 61: Failed to attach master store backend_failure: (<___>testing_btest__tmp_broker_store_create_failure_create_failure_zeek__zeek_init__33__zf())
error in <...>/create-failure.zeek (C++), line 61: Could not create Broker master store '../fail' (<___>testing_btest__tmp_broker_store_create_failure_create_failure_zeek__zeek_init__33__zf())
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})

View file

@ -1,7 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
reporter_info|init test-info||XXXXXXXXXX.XXXXXX
reporter_warning|init test-warning||XXXXXXXXXX.XXXXXX
reporter_error|init test-error||XXXXXXXXXX.XXXXXX
reporter_info|done test-info||XXXXXXXXXX.XXXXXX
reporter_warning|done test-warning||XXXXXXXXXX.XXXXXX
reporter_error|done test-error||XXXXXXXXXX.XXXXXX
reporter_info|init test-info|<...>/reporter.zeek (C++), line 6|XXXXXXXXXX.XXXXXX
reporter_warning|init test-warning|<...>/reporter.zeek (C++), line 6|XXXXXXXXXX.XXXXXX
reporter_error|init test-error|<...>/reporter.zeek (C++), line 6|XXXXXXXXXX.XXXXXX
reporter_info|done test-info|<...>/reporter.zeek (C++), line 13|XXXXXXXXXX.XXXXXX
reporter_warning|done test-warning|<...>/reporter.zeek (C++), line 13|XXXXXXXXXX.XXXXXX
reporter_error|done test-error|<...>/reporter.zeek (C++), line 13|XXXXXXXXXX.XXXXXX

View file

@ -1,10 +1,10 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
pre test-info
warning: pre test-warning
error: pre test-error
init test-info
warning: init test-warning
error: init test-error
done test-info
warning: done test-warning
error: done test-error
<...>/reporter.zeek (C++), line 52: pre test-info
warning in <...>/reporter.zeek (C++), line 52: pre test-warning
error in <...>/reporter.zeek (C++), line 52: pre test-error
<...>/reporter.zeek (C++), line 6: init test-info
warning in <...>/reporter.zeek (C++), line 6: init test-warning
error in <...>/reporter.zeek (C++), line 6: init test-error
<...>/reporter.zeek (C++), line 13: done test-info
warning in <...>/reporter.zeek (C++), line 13: done test-warning
error in <...>/reporter.zeek (C++), line 13: done test-error

View file

@ -1,2 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
Hello, Zeek!
<...>/basic-no-errors.test (C++), line 11: Hello, Zeek!

View file

@ -7,5 +7,5 @@
#open XXXX-XX-XX-XX-XX-XX
#fields ts level message location
#types time enum string string
XXXXXXXXXX.XXXXXX Reporter::INFO Hello, Zeek! (empty)
XXXXXXXXXX.XXXXXX Reporter::INFO Hello, Zeek! <...>/basic-no-errors.test (C++), line 11
#close XXXX-XX-XX-XX-XX-XX

View file

@ -1,6 +1,6 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
runtime error in <...>/queue.zeek, line 152: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>], expression: Queue::ret[Queue::j], call stack:
#0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=<uninitialized>],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=<uninitialized>], top=7, bottom=0, size=0], [hello, goodbye, test])
#0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=<uninitialized>],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=<uninitialized>], top=7, bottom=0, size=0], [hello, goodbye, test]) at <...>/index-assignment-invalid.zeek (C++):32
#1 zeek_init()

View file

@ -2,13 +2,13 @@
Reporter::Hook - Exercise Reporter Hook (dynamic, version 1.0.0)
Implements Reporter (priority 0)
| Hook Some Info
| Hook error An Error
| Hook error An Error that does not show up in the log
| Hook Some Info <...>/reporter-hook.zeek (C++), line 15
| Hook error An Error <...>/reporter-hook.zeek (C++), line 15
| Hook error An Error that does not show up in the log <...>/reporter-hook.zeek (C++), line 15
| Hook runtime error in compiled code field value missing
| Hook warning A warning
Some Info
error: An Error
error: An Error that does not show up in the log
| Hook warning A warning <...>/reporter-hook.zeek (C++), line 15
<...>/reporter-hook.zeek (C++), line 15: Some Info
error in <...>/reporter-hook.zeek (C++), line 15: An Error
error in <...>/reporter-hook.zeek (C++), line 15: An Error that does not show up in the log
runtime error in compiled code: field value missing
warning: A warning
warning in <...>/reporter-hook.zeek (C++), line 15: A warning

View file

@ -7,8 +7,8 @@
#open XXXX-XX-XX-XX-XX-XX
#fields ts level message location
#types time enum string string
XXXXXXXXXX.XXXXXX Reporter::INFO Some Info (empty)
XXXXXXXXXX.XXXXXX Reporter::WARNING A warning (empty)
XXXXXXXXXX.XXXXXX Reporter::ERROR An Error (empty)
XXXXXXXXXX.XXXXXX Reporter::INFO Some Info <...>/reporter-hook.zeek (C++), line 15
XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/reporter-hook.zeek (C++), line 15
XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/reporter-hook.zeek (C++), line 15
XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing (empty)
#close XXXX-XX-XX-XX-XX-XX

View file

@ -9,4 +9,5 @@ else
fi
$sed 's#/+#/#g' |
$sed 's#[^( ]*testing_btest#<___>testing_btest#' |
$sed 's#([a-zA-Z]:)?/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\3#g'