Skip to contentSkip to conversation

libcrypto core dump in 64bit

DISCUSSION H.Merijn Brand 3 participants 7 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Any hints?

/pro/3gl/LINUX/git-1.5.4.rc5/t 154 > sh t5302-pack-index.sh

*   ok 1: setup
*   ok 2: pack-objects with index version 1
*   ok 3: pack-objects with index version 2
*   ok 4: both packs should be identical
*   ok 5: index v1 and index v2 should be different
*   ok 6: index-pack with index version 1
*   ok 7: index-pack with index version 2
*   ok 8: index-pack results should match pack-objects ones
*   ok 9: index v2: force some 64-bit offsets with pack-objects
t5302-pack-index.sh[67]: 3156 Illegal instruction(coredump)
* FAIL 10: index v2: verify a pack with some 64-bit offsets
        git verify-pack -v "test-3-${pack3}.pack"

FATAL: Unexpected exit with code 0

HP gdb 5.7 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 5.7 (based on GDB) is covered by the GNU General Public License. Type "show copying" to see the conditions to change it and/or distribute copies. Type "show warranty" for warranty/support. ..
Core was generated by `git'.
Program terminated with signal 4, Illegal instruction.
ILL_REGNAT - Register NaT Consumption
#0 0xc0000000033c8940:0 in sha1_block_asm_host_order+0x22e0 ()
from /usr/local/ssl/lib/libcrypto.so
(gdb) where
#0 0xc0000000033c8940:0 in sha1_block_asm_host_order+0x22e0 ()
from /usr/local/ssl/lib/libcrypto.so
#1 0xc0000000033cb680:0 in SHA1_Update () at ../md32_common.h:476 #2 0x40000000000ef560:0 in verify_pack (p=0x6000000000037e40, verbose=1)

    at pack-check.c:168
#3  0x40000000000d5130:0 in cmd_verify_pack (argc=2, argv=<not available>,
    prefix=<NaT>) at builtin-verify-pack.c:43
#4  0x40000000000440e0:0 in handle_internal_command (argc=3,
    argv=0x9fffffffffffee88) at git.c:257

#5 0x40000000000446a0:0 in main (argc=3, argv=0x9fffffffffffee88) at git.c:447 (gdb)

Signature · 5 lines
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/
#1 lore raw

Hi,

Quoted 1 line · H.Merijn Brand

Any hints?

Yes.

Quoted 2 lines

#0 0xc0000000033c8940:0 in sha1_block_asm_host_order+0x22e0 ()
from /usr/local/ssl/lib/libcrypto.so

This seems to be an OpenSSL issue, probably in its Itanium-optimised code (since Itanium is not _all_ that common, it is quite likely that no many people exercise this part of the code).

Unfortunately, I am not at all an expert in Itanium's assembler, otherwise I'd try to help...

Sorry,
Dscho

#2 lore raw
Quoted 6 lines · Johannes Schindelin

Hi,

Quoted 1 line · H.Merijn Brand

Any hints?

Quoted 8 lines

Yes.

Quoted 2 lines

#0 0xc0000000033c8940:0 in sha1_block_asm_host_order+0x22e0 ()
from /usr/local/ssl/lib/libcrypto.so

This seems to be an OpenSSL issue, probably in its Itanium-optimised code (since Itanium is not _all_ that common, it is quite likely that no many people exercise this part of the code).

Now tried with HP C-ANSI-C -O3, -O2, -O1, and -O0 and with GNU gcc 4.2.1 -O3 All give the same failure

Quoted 2 lines

Unfortunately, I am not at all an expert in Itanium's assembler, otherwise I'd try to help...

Signature · 5 lines
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/
#3 lore raw

Hello,

Quoted 5 lines · H.Merijn Brand <h.m.brand <at> xs4all.nl> writes:
Quoted 3 lines · On Mon, 11 Feb 2008 22:42:16 +0000 (GMT), Johannes Schindelin…
Quoted 2 lines

#0 0xc0000000033c8940:0 in sha1_block_asm_host_order+0x22e0 ()
from /usr/local/ssl/lib/libcrypto.so

Quoted 9 lines
Quoted 3 lines

This seems to be an OpenSSL issue, probably in its Itanium-optimised code (since Itanium is not _all_ that common, it is quite likely that no many people exercise this part of the code).

Now tried with HP C-ANSI-C -O3, -O2, -O1, and -O0 and with GNU gcc 4.2.1 -O3 All give the same failure

Quoted 2 lines

Unfortunately, I am not at all an expert in Itanium's assembler, otherwise I'd try to help...

yes, this is OpenSSL issue. I had to recompile OpenSSL myself to make it work (with no-asm option)

I'm using only HP cc for building git (with all the toolchain). (No gcc here)

# uname -mrs
HP-UX B.11.23 ia64
# cc --version
cc: HP C/aC++ B3910B A.06.14 [Feb 22 2007]

Michal

#4 lore raw
Quoted 12 lines · Michal Rokos

Hello,

Quoted 9 lines · H.Merijn Brand <h.m.brand <at> xs4all.nl> writes:
Quoted 6 lines · On Mon, 11 Feb 2008 22:42:16 +0000 (GMT), Johannes Schindelin…
Quoted 2 lines

#0 0xc0000000033c8940:0 in sha1_block_asm_host_order+0x22e0 ()
from /usr/local/ssl/lib/libcrypto.so

This seems to be an OpenSSL issue, probably in its Itanium-optimised code (since Itanium is not _all_ that common, it is quite likely that no many people exercise this part of the code).

Quoted 8 lines
Quoted 5 lines

Now tried with HP C-ANSI-C -O3, -O2, -O1, and -O0 and with GNU gcc 4.2.1 -O3 All give the same failure

Quoted 2 lines

Unfortunately, I am not at all an expert in Itanium's assembler, otherwise I'd try to help...

yes, this is OpenSSL issue. I had to recompile OpenSSL myself to make it work (with no-asm option)

OK, I did the same now, and the docs tell me to turn down optimization to +O2 when you choose to do so.

Apart from that, when you create shared libs, the default build creates a conflicting situation, so you have to throw away the files that cause dup
names: aes-ia64.o rc4-ia64.o bn-ia64.o from libcrypto.a

t5302-pack-index.sh now passes

Quoted 6 lines

I'm using only HP cc for building git (with all the toolchain). (No gcc here)

# uname -mrs
HP-UX B.11.23 ia64
# cc --version
cc: HP C/aC++ B3910B A.06.14 [Feb 22 2007]

HP-UX 11.23/64 U rx1620/64 Itanium 2/1600(2) ia64 2037 Mb
cc: HP C/aC++ B3910B A.06.15 [May 16 2007]

Did you get the full test suite to pass?

Signature · 5 lines
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/
#5 lore raw

Hello,

Quoted 1 line · H.Merijn Brand

Did you get the full test suite to pass?

No - vanilla git's master won't pass (since HPUX vsnprintf is broken (it returns -1 when n is exceeded).

With strbuf workarounds test suite passes up to t4200-rerere.sh.

I did not try to investigate further or continue with the rest of the tests.

MR

#6 lore raw
Quoted 7 lines · Michal Rokos

Hello,

Quoted 1 line · H.Merijn Brand

Did you get the full test suite to pass?

No - vanilla git's master won't pass (since HPUX vsnprintf is broken (it returns -1 when n is exceeded).

strbuf.c 2008-02-13 11:26:56 +0100 renamed from strbuf.c 2008-02-02 05:09:01 +0100 +1 -1
diff -purN git-1.5.4/strbuf.c git-1.5.4p/strbuf.c
@@ -127,7 +127,7 @@ void strbuf_addf(struct strbuf *sb, cons
        int len;
        va_list ap;
 
-       if (!strbuf_avail(sb))
+       if (strbuf_avail(sb) < 64)
                strbuf_grow(sb, 64);
        va_start(ap, fmt);
        len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
Quoted 3 lines

With strbuf workarounds test suite passes up to t4200-rerere.sh.

I did not try to investigate further or continue with the rest of the tests.

I did, and got here
http://www.xs4all.nl/~procura/git-1.5.4-hpux1123ipf64.diff

Note, ntar = GNU tar, and npatch is the 'patch' as the rest of the world knows it. Our perl is in /pro. We do not want to interfere with the system perl (and mine is always newer anyway).

git-clone is a shell script, and it's return value is ignored somewhere

/pro/3gl/LINUX/git-1.5.4p/t 122 > cat do-tests
#!/bin/sh

export TAR=ntar
rm -f *.err
for t in t[0-9]*.sh ; do
echo $t
sh $t > test.err 2>&1 || mv test.err $t.err
rm -f test.err
done
/pro/3gl/LINUX/git-1.5.4p/t 123 > ll *.err
204744 -rw-rw-rw- 1 merijn softwr 344 Feb 13 11:49 t5600-clone-fail-cleanup.sh.err 204788 -rw-rw-rw- 1 merijn softwr 458 Feb 13 11:49 t5701-clone-local.sh.err 205057 -rw-rw-rw- 1 merijn softwr 3039 Feb 13 11:50 t6002-rev-list-bisect.sh.err 204643 -rw-rw-rw- 1 merijn softwr 3980 Feb 13 11:50 t6003-rev-list-topo-order.sh.err 204808 -rw-rw-rw- 1 merijn softwr 899 Feb 13 11:50 t6022-merge-rename.sh.err 204697 -rw-rw-rw- 1 merijn softwr 1340 Feb 13 11:52 t7201-co.sh.err 204747 -rw-rw-rw- 1 merijn softwr 149 Feb 13 11:53 t9300-fast-import.sh.err 204699 -rw-rw-rw- 1 merijn softwr 1651 Feb 13 11:53 t9301-fast-export.sh.err /pro/3gl/LINUX/git-1.5.4p/t 124 >

Signature · 5 lines
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/