gpg card status crash

Nicholas Cole nicholas.cole at gmail.com
Wed May 12 01:39:31 CEST 2010


On Tue, May 11, 2010 at 11:15 PM, David Shaw <dshaw at jabberwocky.com> wrote:
> On May 11, 2010, at 5:12 PM, Nicholas Cole wrote:
>
>>>> On gpg 1.4.10, the following command works fine:
>>>>
>>>> gpg --card-status
>>>>
>>>> The following command causes gpg to crash:
>>>>
>>>> Macintosh-2:~ nicholas$ gpg  --status-fd 1 --card-status
>>>> gpg(34195) malloc: *** mmap(size=6594112295125651456) failed (error code=12)
>>>> *** error: can't allocate region
>>>> *** set a breakpoint in malloc_error_break to debug
>>>
>>> Need more information to even guess.  What OS is this?  (Your prompt is "Macintosh" - is this an OSX box?  If so, what version of OSX?)
>>> What card reader do you use?  What version of the card is this?
>>
>> Dear David,
>>
>> Sorry for the poor report.  I'm running OS X 10.6.3, with version 2 of
>> the card and with the GREMALTO USB Shell Token version 2.
>
> Hmm.  I tried to duplicate this (same OSX, same card, but different card reader), but without any luck.  Can you try and get a backtrace?  To do that, run "gdb /the/path/to/gpg" then enter "break malloc_error_break", and finally "run --status-fd 1 --card-status".  When you get a prompt, enter "bt full".  Send the output of the bt full.
>

Dear David,

I have posted the full report from that at the end of this email.

I'm having a (possibly related?) problem with that reader, which is
that it frequently refuses to read the card at all.  At first I
thought the card was not seated properly, but I've concluded that it
is.  Sometimes the reader works flawlessly, and sometimes gpg reports
that the card is not present.  The error only occurs if the reader has
been removed and then reattached.  I have not been able to work out
conditions under which it works and fails.  Do you have any
suggestions for how to go about tracking down the problem?

Best wishes,

Nicholas


gdb `which gpg`
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5
04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries ......
warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/blocksort.o"
- no debug information available for "blocksort.c".


warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/huffman.o"
- no debug information available for "huffman.c".


warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/crctable.o"
- no debug information available for "crctable.c".


warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/randtable.o"
- no debug information available for "randtable.c".


warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/compress.o"
- no debug information available for "compress.c".


warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/decompress.o"
- no debug information available for "decompress.c".


warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/work/bzip2-1.0.5/bzlib.o"
- no debug information available for "bzlib.c".

.. done

(gdb) break malloc_error_break
Breakpoint 1 at 0x4189374bb859cd
(gdb) run --status-fd 1 --card-status
Starting program: /opt/local/bin/gpg --status-fd 1 --card-status
Reading symbols for shared libraries .+++++++...... done
Reading symbols for shared libraries . done
gpg(472) malloc: *** mmap(size=6594112295125651456) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

Breakpoint 1, 0x00007fff8399a9cd in malloc_error_break ()
(gdb) bt full
#0  0x00007fff8399a9cd in malloc_error_break ()
No symbol table info available.
#1  0x00007fff8399bb24 in szone_error ()
No symbol table info available.
#2  0x00007fff838c1256 in allocate_pages ()
No symbol table info available.
#3  0x00007fff838d1235 in large_malloc ()
No symbol table info available.
#4  0x00007fff838c2fa8 in szone_malloc_should_clear ()
No symbol table info available.
#5  0x00007fff838c236a in malloc_zone_malloc ()
No symbol table info available.
#6  0x00007fff838c0668 in malloc ()
No symbol table info available.
#7  0x000000010009e967 in xmalloc ()
No symbol table info available.
#8  0x000000010003ff26 in apdu_open_reader ()
No symbol table info available.
#9  0x0000000100030808 in open_card ()
No symbol table info available.
#10 0x0000000100031975 in agent_learn ()
No symbol table info available.
#11 0x00000001000344a6 in card_status ()
No symbol table info available.
#12 0x0000000100007dfa in main ()
No symbol table info available.
(gdb)



More information about the Gnupg-devel mailing list