Page MenuHome GnuPG

gpgscm crashes on big endian architectures
Closed, ResolvedPublic

Description

gpgscm crashes on big endian architectures, particularly ppc64 BE. This is
regression in 2.1.19, the 2.1.18 does not have this issue.

Details

Version
2.1.19

Event Timeline

t8m set Version to 2.1.19.
t8m added a subscriber: t8m.

Just running gpgscm crashes with segfault. Is this backtrace sufficient or do
you need me to investigate further?

(gdb) run
Starting program: /root/rpmbuild/BUILD/gnupg-2.1.19/tests/gpgscm/gpgscm
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.25.90-1.fc27.ppc64
Error: init.scm:785: eval: unbound variable: define-macro

Program received signal SIGSEGV, Segmentation fault.
oblist_find_by_name (name=name@entry=0x20071a50 "args",
slot=slot@entry=0x3fffffffe680, sc=<optimized out>, sc=<optimized out>) at
scheme.c:1128
1128 s = symname(car(x));
Missing separate debuginfos, use: dnf debuginfo-install
libgcrypt-1.7.6-2.fc26.ppc64 libgpg-error-1.25-2.fc26.ppc64
ncurses-libs-6.0-8.20170212.fc26.ppc64 readline-7.0-5.fc26.ppc64
(gdb) bt
#0 oblist_find_by_name (name=name@entry=0x20071a50 "args",
slot=slot@entry=0x3fffffffe680, sc=<optimized out>, sc=<optimized out>) at
scheme.c:1128
#1 0x000000002001cd4c in mk_symbol (sc=sc@entry=0x20070660, name=0x20071a50
"args") at scheme.c:1384
#2 0x000000002001de6c in mk_atom (sc=sc@entry=0x20070660, q=<optimized out>) at
scheme.c:1496
#3 0x0000000020021114 in opexe_5 (sc=0x20070660, op=<optimized out>) at
scheme.c:5012
#4 0x000000002001d770 in Eval_Cycle (sc=sc@entry=0x20070660,
op=op@entry=OP_T0LVL) at scheme.c:5392
#5 0x000000002002712c in scheme_load_named_file (sc=0x20070660, fin=0x200d4de0,
filename=0x20038d30 "ffi.scm") at scheme.c:5782
#6 0x000000002000d590 in load (sc=0x20070660, file_name=0x20038d30 "ffi.scm",
lookup_in_cwd=<optimized out>, lookup_in_path=1) at main.c:180
#7 0x000000002000cf88 in main (argc=<optimized out>, argv=<optimized out>) at
main.c:268

print x
$1 = (pointer) 0xa200b8868
(gdb) print *x
Cannot access memory at address 0xa200b8868

Would you be so kind to test the attached patch?

(I'm operating on a hunch. Also, I'm not happy with that feature I introduced,
so I'm going to remove it one way or another. But if this was the cause of the
troubles, I'd add a remark in the commit message.)

Yes, this fixed the segfault.