Subject: | t/01-call_credentials.t crashes with "double free or corruption (fasttop)" on ppc64le, s390x, and armv7hl |
t/01-call_credentials.t test crashes always on ppc64le, s390x, and armv7hl platforms with "double free or corruption (fasttop)". It passes on x86_64, i686 and aarch64. I don't have a back trace yet, but a compiler warning seems to highlight a possible reason:
mv Grpc.xsc Grpc.c
[...]
gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -DVERSION=\"0.20\" -DXS_VERSION=\"0.20\" -fPIC "-I/usr/lib64/perl5/CORE" -DGRPC_VERSION_1_1 -DGRPC_VERSION_1_2 -DGRPC_VERSION_1_4 -DGRPC_RECV_STATUS_ON_CLIENT_HAS_ERROR_STRING -DGRPC_SSL_CREDENTIALS_HAS_4_ARGS Grpc.c
[...]
BUILDSTDERR: ./ext/call_credentials.xs: In function 'XS_Grpc__XS__CallCredentials_createFromPlugin':
BUILDSTDERR: ./ext/call_credentials.xs:19:25: warning: assignment to 'int (*)(void *, grpc_auth_metadata_context, void (*)(void *, const grpc_metadata *, size_t, grpc_status_code, const char *), void *, grpc_metadata *, size_t *, grpc_status_code *, const char **)' {aka 'int (*)(void *, struct <anonymous>, void (*)(void *, const struct grpc_metadata *, long unsigned int, enum <anonymous>, const char *), void *, struct grpc_metadata *, long unsigned int *, enum <anonymous> *, const char **)'} from incompatible pointer type 'void (*)(void *, grpc_auth_metadata_context, void (*)(void *, const grpc_metadata *, size_t, grpc_status_code, const char *), void *)' {aka 'void (*)(void *, struct <anonymous>, void (*)(void *, const struct grpc_metadata *, long unsigned int, enum <anonymous>, const char *), void *)'} [-Wincompatible-pointer-types]
BUILDSTDERR: 19 | plugin.get_metadata = plugin_get_metadata;
BUILDSTDERR: | ^
Although the warning presents on all platforms.
I have perl 5.28.1, gcc 9.0.1, glibc 2.29.9000, grpc 1.18.0.