You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when use matcher gomega.Equal it will use format.Message() to format actual and expected.
When format a struct type, the call chain is as follows:
Message -> Object -> formatValue ->formatStruct
when format struct contains a field which is a cgo struct, it may be panic:
typedefstructpcre_extra {
unsigned long intflags; /* Bits for which fields are set */void*study_data; /* Opaque data from pcre_study() */unsigned long intmatch_limit; /* Maximum number of calls to match() */void*callout_data; /* Data passed back in callouts */constunsigned char*tables; /* Pointer to character tables */unsigned long intmatch_limit_recursion; /* Max recursive calls to match() */unsigned char**mark; /* For passing back a mark pointer */void*executable_jit; /* Contains a pointer to a compiled jit code */
} pcre_extra;
hey @Cylkal - sorry I haven't been able to get to this sooner. I'll have to carve out some time to take a deeper look at it. For now, if it helps you get unstuck, you could implement the GomegaStringer interface to control how your object's output is formatted and possibly avoid the panic?
hey @Cylkal - sorry I haven't been able to get to this sooner. I'll have to carve out some time to take a deeper look at it. For now, if it helps you get unstuck, you could implement the GomegaStringer interface to control how your object's output is formatted and possibly avoid the panic?
go version go1.16.7 linux/amd64
when use matcher gomega.Equal it will use format.Message() to format actual and expected.
When format a struct type, the call chain is as follows:
Message -> Object -> formatValue ->formatStruct
when format struct contains a field which is a cgo struct, it may be panic:
the cgo struct like:
where pcre_extra define:
use fmt, it print like:
and panic occurs when visit field
match_limit_recursion
by call reflect.Value.Uint().Could you avoid format cgo struct, or other method like add a new format methd not format unexported field?
The text was updated successfully, but these errors were encountered: