Mailing List Archive

segfault in gcrypt 1.4.0
Hi,

I tried to compile gnupg-2.0.8 with libassuan-1.0.4, libgcrypt-1.4.0, libgpg-error-1.5 and libksba-1.0.3.
It gives me gpg2 in subdir g10 but stops with

make[3]: Entering directory `/extend/gpg/gnupg-2.0.8/tests/openpgp'
echo '#!/bin/sh' >./gpg_dearmor
echo "../../g10/gpg2 --no-options --no-greeting \
--no-secmem-warning --batch --dearmor" >>./gpg_dearmor
chmod 755 ./gpg_dearmor
./gpg_dearmor > ./pubring.gpg < ./pubring.asc
./gpg_dearmor: line 2: 4801 Speicherzugriffsfehler ../../g10/gpg2 --no-options --no-greeting --no-secmem-warning --batch --dearmor
make[3]: *** [pubring.gpg] Fehler 139
make[3]: Leaving directory `/extend/gpg/gnupg-2.0.8/tests/openpgp'
make[2]: *** [all-recursive] Fehler 1
make[2]: Leaving directory `/extend/gpg/gnupg-2.0.8/tests'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/extend/gpg/gnupg-2.0.8'
make: *** [all] Fehler 2

To get a closer look I compiled in a seperate directory /extend/gpg.
As I wrote yesterday, I need -fomit-frame-pointer to compile libgcrypt-1.4.0:
gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/extend/gpg/inst/include -g -O1 -Wall -Wpointer-arith -MT rijndael.lo -MD -MP -MF .deps/rijndael.Tpo -c rijndael.c -o rijndael.o
rijndael.c: In function `do_padlock':
rijndael.c:2062: error: can't find a register in class `GENERAL_REGS' while reloading `asm'

gcc --version
gcc (GCC) 3.3.3 (SuSE Linux)

I figured out that it is libgcrypt what segfaults...

(gdb) run
Starting program: /extend/gpg/gnupg-2.0.8/g10/gpg2

Program received signal SIGSEGV, Segmentation fault.
0x40095f60 in ?? () from /extend/gpg/inst/lib/libgcrypt.so.11
(gdb) bt
#0 0x40095f60 in ?? () from /extend/gpg/inst/lib/libgcrypt.so.11
#1 0x4009d97d in detect_ia32_gnuc () from /extend/gpg/inst/lib/libgcrypt.so.11
#2 0x756ceaf9 in ?? ()
#3 0x00000000 in ?? ()
#4 0x756e6547 in ?? ()
#5 0x49656e69 in ?? ()
#6 0x6c65746e in ?? ()
#7 0x401188a4 in __JCR_LIST__ () from /extend/gpg/inst/lib/libgcrypt.so.11
#8 0x4009f100 in _gcry_ath_mutex_destroy () from /extend/gpg/inst/lib/libgcrypt.so.11
#9 0x00000000 in ?? ()
#10 0x401188a4 in __JCR_LIST__ () from /extend/gpg/inst/lib/libgcrypt.so.11
#11 0x00000001 in ?? ()
#12 0x00000020 in ?? ()
#13 0x00000000 in ?? ()
#14 0x401188a4 in __JCR_LIST__ () from /extend/gpg/inst/lib/libgcrypt.so.11
#15 0x4009da0d in _gcry_detect_hw_features () from /extend/gpg/inst/lib/libgcrypt.so.11
#16 0x00000000 in ?? ()
#17 0x401188a4 in __JCR_LIST__ () from /extend/gpg/inst/lib/libgcrypt.so.11
#18 0x40098884 in global_init () from /extend/gpg/inst/lib/libgcrypt.so.11
#19 0x00000000 in ?? ()
#20 0x401188a4 in __JCR_LIST__ () from /extend/gpg/inst/lib/libgcrypt.so.11
#21 0x40098ee2 in _gcry_vcontrol () from /extend/gpg/inst/lib/libgcrypt.so.11
#22 0x080d93ec in ?? ()
#23 0x00000017 in ?? ()
#24 0x08049ece in ?? ()
#25 0x40092f4c in ?? () from /extend/gpg/inst/lib/libgcrypt.so.11
#26 0x00000000 in ?? ()
#27 0x401188a4 in __JCR_LIST__ () from /extend/gpg/inst/lib/libgcrypt.so.11
#28 0x4009652f in gcry_control () from /extend/gpg/inst/lib/libgcrypt.so.11
#29 0xbffff094 in ?? ()
#30 0x00000000 in ?? ()
#31 0x40096511 in gcry_control () from /extend/gpg/inst/lib/libgcrypt.so.11
#32 0x00000000 in ?? ()
#33 0x4022abd0 in __elf_set___libc_thread_subfreeres_element___rpc_thread_destroy__ () from /lib/tls/libc.so.6
#34 0x00000024 in ?? ()
#35 0xffffe000 in ?? ()
#36 0x00001000 in ?? ()
#37 0xbffff2b4 in ?? ()
#38 0x400106e5 in _dl_sysdep_start () from /lib/ld-linux.so.2
#39 0x4012e500 in __libc_start_main () from /lib/tls/libc.so.6
#40 0x0804c251 in _start () at ../sysdeps/i386/elf/start.S:102

No problems if I use libgcrypt-1.2.2.
How can I fix it?

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: segfault in gcrypt 1.4.0 [ In reply to ]
On Thu, 14 Feb 2008 19:39, gnupg@ethen.de said:

> I tried to compile gnupg-2.0.8 with libassuan-1.0.4, libgcrypt-1.4.0, libgpg-error-1.5 and libksba-1.0.3.
> It gives me gpg2 in subdir g10 but stops with

That segv is because you used an incomplete build of libgcrypt.

Use

./configure --disable-padlock

to build libgcrypt.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: segfault in gcrypt 1.4.0 [ In reply to ]
> > I tried to compile gnupg-2.0.8 with libassuan-1.0.4, libgcrypt-1.4.0,
> > libgpg-error-1.5 and libksba-1.0.3. It gives me gpg2 in subdir g10 but
> > stops with
>
> That segv is because you used an incomplete build of libgcrypt.
I don't get what's "incomplete" here.

>
> Use
>
> ./configure --disable-padlock
>
> to build libgcrypt.
I suffer the same problem as before that I need to set
CFLAGS="-fomit-frame-pointer" to be able to compile rijndael.c which gives me
a seg-faulting gnupg.

A workaround I found is to start "make" without CFLAGS, compile rijndael.c by
hand and start "make" again.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: segfault in gcrypt 1.4.0 [ In reply to ]
On Thu, 21 Feb 2008 21:13, gnupg@ethen.de said:

> I don't get what's "incomplete" here.

Neiterh do I ;-). The bug report was not really clear on what you did.
it looked like the library was build despite that a compile bug occurred.

> I suffer the same problem as before that I need to set
> CFLAGS="-fomit-frame-pointer" to be able to compile rijndael.c which gives me

You may not use -fomit-frame-pointer with libgcrypt 1.4.0 on ia32. We
have a fix in the works. Please describe the problem again you have
compiling libgcrypt (rijndael.c?).

> A workaround I found is to start "make" without CFLAGS, compile rijndael.c by

Don't mess around with the build system and then wonder about bugs at
other places.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: segfault in gcrypt 1.4.0 [ In reply to ]
> Neiterh do I ;-). The bug report was not really clear on what you did.
> it looked like the library was build despite that a compile bug occurred.
No, this one wasn't.

> You may not use -fomit-frame-pointer with libgcrypt 1.4.0 on ia32. We
> have a fix in the works. Please describe the problem again you have
> compiling libgcrypt (rijndael.c?).
Without -fomit-frame-pointer I can't compile rijndael.c, no matter if I
use ./configure --disable-padlock or not. Please see my message 2008-02-13
12:58 MESZ.

If I set CFLAGS="-fomit-frame-pointer" for the whole libgcrypt-build I get
that segfault in gnupg, no matter if I use ./configure --disable-padlock or
not.

Hope that helps.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: segfault in gcrypt 1.4.0 [ In reply to ]
On Fri, 22 Feb 2008 15:43, gnupg@ethen.de said:

> Without -fomit-frame-pointer I can't compile rijndael.c, no matter if I
> use ./configure --disable-padlock or not. Please see my message 2008-02-13
> 12:58 MESZ.

>From looking at the soruce that seems to be impossible. The __asm__
code is only used with padlock support configured. Please check whether

#define ENABLE_PADLOCK_SUPPORT 1

is enabled. It should not be if you used

./confgure --disable-padlock-support

Maybe I falsely suggested to use --disable-padlock which has no effect.

> If I set CFLAGS="-fomit-frame-pointer" for the whole libgcrypt-build I get
> that segfault in gnupg, no matter if I use ./configure --disable-padlock or

That is a different problem which happens only witout a frame pointer.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: segfault in gcrypt 1.4.0 [ In reply to ]
> ./confgure --disable-padlock-support

That fixed it...

I don't understand why there is a difference with or without
--disable-padlock-support on a non-VIA CPU. Does my Pentium III have anything
to do with padlock? What would --enable-padlock-support give me?

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel