There are two problems with gnutls-3.6.3 on NetBSD.
One is a compilation issue: NetBSD does not provide strdupa(), but
this is used unconditionally. The attached patch changes the code to
use the standard strdup() instead.
(gdb) bt
#0 0x000076184023eb3a in kill () from /usr/lib/libc.so.12
#1 (closed) 0x0000761841a0b430 in pthread__assertfunc (file=file@entry=0x761841a0c3d0 "/usr/src/lib/libpthread/pthread_tsd.c", line=line@entry=176,
function=function@entry=0x761841a0c480 "pthread__add_specific", expr=expr@entry=0x761841a0c410 "pthread__tsd_destructors[key] != NULL")
at /usr/src/lib/libpthread/pthread.c:1100
#2 (closed) 0x0000761841a07aed in pthread__add_specific (self=0x761842f09800, key=0, value=value@entry=0x0) at /usr/src/lib/libpthread/pthread_tsd.c:176
#3 (closed) 0x0000761841a07d86 in pthread_setspecific (key=, value=value@entry=0x0) at /usr/src/lib/libpthread/pthread_specific.c:69
#4 0x00007618426f6546 in p11_library_uninit () at common/library.c:153
#5 (closed) 0x000076184262f509 in ?? () from /usr/pkg/lib/libp11-kit.so.0
#6 (closed) 0x0000761842f16d00 in ?? ()
#7 (closed) 0x00007618426f6629 in ?? () from /usr/pkg/lib/libp11-kit.so.0
#8 (closed) 0x0000000000000000 in ?? ()
pkcs12-utf8 provides utf8 on command line, could it be that the shell does not handle that? If you replace /bin/sh with /bin/bash does it change anything?