MacOSX and libassuan / gnupg v2.0.15 problem
Closed, ResolvedPublic

Description

I am having problems with unpatched gpg-agent under Snow Leopard with
gnupg v2.0.15:

./gpg-agent --daemon --verbose --use-standard-socket --no-detach
gpg-agent[9481]: listening on socket `/Users/benjamin/.gnupg/S.gpg-agent'
gpg-agent[9481]: listening on socket `/Users/benjamin/.gnupg/S.gpg-agent.ssh'
GPG_AGENT_INFO=/Users/benjamin/.gnupg/S.gpg-agent:9482:1; export GPG_AGENT_INFO;
SSH_AUTH_SOCK=/Users/benjamin/.gnupg/S.gpg-agent.ssh; export SSH_AUTH_SOCK;
SSH_AGENT_PID=9482; export SSH_AGENT_PID;
gpg-agent[9482]: gpg-agent (GnuPG) 2.0.15 started
Macintosh:agent benjamin$ gpg-agent[9482]: handler 0x305630 for fd 7 started
gpg-agent[9482]: starting a new PIN Entry
gpg-agent[9482]: handler 0x305630 for fd 7 terminated
gpg-agent[9482]: handler 0x3055a0 for fd 7 started
gpg-agent[9482]: starting a new PIN Entry
gpg-agent[9482]: handler 0x3055a0 for fd 7 terminated
gpg-agent[9482]: handler 0x3058d0 for fd 7 started
gpg-agent[9482]: can't connect my own socket: Invalid value passed to IPC
gpg-agent[9482]: this process is useless - shutting down
gpg-agent[9482]: gpg-agent (GnuPG) 2.0.15 stopped

This issue has been confirmed by other people using my MacGPG2 package
albeit with a patched copy of gpg-agent. I haven't had chance to
investigate this thoroughly at this stage.

GnuPG is compiled with the following options:

export MACOSX_DEPLOYMENT_TARGET=10.4
export CFLAGS="-mmacosx-version-min=10.4 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
export CC=/usr/bin/gcc-4.0

(Above necessary to generate Universal Binary that works on Tiger and above)

./configure --disable-dependency-tracking
--with-pinentry-pgm=/usr/local/libexec/pinentry-mac.app/Contents/MacOS/pinentry-
mac

[...]
configure: checking for libraries
checking for gpg-error-config... /usr/local/bin/gpg-error-config
checking for GPG Error - version >= 1.4... yes (1.7)
checking for libgcrypt-config... /usr/local/bin/libgcrypt-config
checking for LIBGCRYPT - version >= 1.4.0... yes (1.4.5)
checking LIBGCRYPT API version... okay
checking for libassuan-config... /usr/local/bin/libassuan-config
checking for LIBASSUAN - version >= 2.0.0... yes (2.0.0)
checking LIBASSUAN API version... okay
checking for ksba-config... /usr/local/bin/ksba-config
checking for KSBA - version >= 1.0.2... yes (1.0.7)
checking KSBA API version... okay
checking for usb_bulk_write in -lusb... yes
checking for usb_create_match... no
checking for library containing dlopen... none required
checking for openpty in -lutil... no
checking for shred... /usr/bin/shred
checking for pth-config... /usr/local/bin/pth-config
checking for PTH - version >= 1.3.7... yes
checking whether PTH installation is sane... yes
[...]

GnuPG v2.0.15 has been configured as follows:

Platform:  Darwin (i386-apple-darwin10.2.0)

OpenPGP:   yes
S/MIME:    yes
Agent:     yes
Smartcard: yes

Protect tool:      (default)
Default agent:     (default)
Default pinentry:

/usr/local/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac

Default scdaemon:  (default)
Default dirmngr:   (default)

The only significant change is the move to libassuan v2.0.0, which I
strongly suspect as it provides the IPC library. libassuan was
compiled with the same options as v1.0.5:

export MACOSX_DEPLOYMENT_TARGET=10.4
export CFLAGS="-mmacosx-version-min=10.4 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
export CC=/usr/bin/gcc-4.0

$ ./configure --enable-static=no --disable-dependency-tracking
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... i386-apple-darwin10.2.0
checking host system type... i386-apple-darwin10.2.0
configure: autobuild project... libassuan
configure: autobuild revision... 2.0.0
configure: autobuild hostname... Macintosh.local
configure: autobuild timestamp... 20100319-094319
checking for style of include used by make... GNU
checking for gcc... /usr/bin/gcc-4.0
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc-4.0 accepts -g... yes
checking for /usr/bin/gcc-4.0 option to accept ISO C89... none needed
checking dependency style of /usr/bin/gcc-4.0... none
checking how to run the C preprocessor... /usr/bin/gcc-4.0 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by /usr/bin/gcc-4.0...
/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld)
is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld option to
reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from /usr/bin/gcc-4.0 object... ok
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/bin/gcc-4.0 supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc-4.0 option to produce PIC... -fno-common -DPIC
checking if /usr/bin/gcc-4.0 PIC flag -fno-common -DPIC works... yes
checking if /usr/bin/gcc-4.0 static flag -static works... no
checking if /usr/bin/gcc-4.0 supports -c -o file.o... yes
checking if /usr/bin/gcc-4.0 supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gcc-4.0 linker
(/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) supports shared
libraries... yes
checking dynamic linker characteristics... darwin10.2.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for windres... no
checking for gawk... (cached) awk
checking for gcc... (cached) /usr/bin/gcc-4.0
checking whether we are using the GNU C compiler... (cached) yes
checking whether /usr/bin/gcc-4.0 accepts -g... (cached) yes
checking for /usr/bin/gcc-4.0 option to accept ISO C89... (cached) none needed
checking dependency style of /usr/bin/gcc-4.0... (cached) none
checking how to run the C preprocessor... /usr/bin/gcc-4.0 -E
checking whether /usr/bin/gcc-4.0 and cc understand -c and -o together... yes
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking if gcc supports -Wpointer-arith... yes
checking for setsockopt... yes
checking for ANSI C header files... (cached) yes
checking for string.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for uintptr_t... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking return type of signal handlers... void
checking whether sys_siglist is declared... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for socklen_t... yes
checking for struct cmsghdr.cmsg_len... yes
checking for gpg-error-config... /usr/local/bin/gpg-error-config
checking for GPG Error - version >= 1.4... yes
checking for flockfile... yes
checking for funlockfile... yes
checking for library containing nanosleep... none required
checking for funopen... yes
checking for isascii... yes
checking for putc_unlocked... yes
checking for memrchr... no
checking for stpcpy... yes
checking for unistd.h... (cached) yes
checking for setenv... yes
checking for vasprintf... yes
checking for SO_PEERCRED... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating m4/Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating tests/Makefile
config.status: creating src/libassuan-config
config.status: creating src/versioninfo.rc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

Details

Version
v2.0.15
benjamin-d set Version to v2.0.15.Mar 21 2010, 2:46 PM
benjamin-d added projects: gnupg, Bug Report.
benjamin-d added a subscriber: benjamin-d.

Continued testing has shown that this behaviour is only exhibited when
using standard sockets. When not using them I have, so far, been
unable to replicate this problem.

Traces submitted to Marcus now attached to ticket.

libassuan-failure shows abnormal termination with standard sockets.

Traces submitted to Marcus now attached to ticket.

libassuan-success shows success with standard sockets.

Traces submitted to Marcus now attached to ticket.

CORRECTION - libassuan-failure shows abnormal termination withOUT standard
sockets.

Ticket created a month ago and not allocated to anyone.

Is this system actually checked?

werner added a subscriber: werner.Apr 19 2010, 8:51 AM

Sorry, we are very busy these times.
Marcus, if you ahve a bit of spare time, can you please look at it?

werner assigned this task to marcus.Apr 19 2010, 8:51 AM
werner added a subscriber: marcus.

No worries regarding delay - just keen to ensure not over-looked.

As per mailing list post, since tested with:

libassuan svn 373.
Libgpg-error v1.8-svn239 (Dependency).

Libassuan fails with the following, which I have not had chance to investigate
yet:

gcc-4.0 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -mmacosx-version-
min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -
Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -c ce-server.c
In file included from ce-server.c:51:
common.h: In function ‘do_strconcat’:
common.h:265: warning: implicit declaration of function ‘stpcpy’
common.h:265: warning: incompatible implicit declaration of built-in function
‘stpcpy’
In file included from ce-server.c:51:
common.h: In function ‘do_strconcat’:
common.h:265: warning: implicit declaration of function ‘stpcpy’
common.h:265: warning: incompatible implicit declaration of built-in function
‘stpcpy’
ce-server.c: In function ‘server’:
ce-server.c:1291: error: ‘fd_set’ undeclared (first use in this function)
ce-server.c:1291: error: (Each undeclared identifier is reported only once
ce-server.c:1291: error: for each function it appears in.)
ce-server.c:1291: error: syntax error before ‘rfds’
ce-server.c:1295: warning: implicit declaration of function ‘FD_ZERO’
ce-server.c:1295: error: ‘rfds’ undeclared (first use in this function)
ce-server.c:1296: warning: implicit declaration of function ‘FD_SET’
ce-server.c:1309: warning: implicit declaration of function ‘select’
ce-server.c:1311: warning: implicit declaration of function ‘FD_ISSET’
ce-server.c: In function ‘server’:
ce-server.c:1291: error: ‘fd_set’ undeclared (first use in this function)
ce-server.c:1291: error: (Each undeclared identifier is reported only once
ce-server.c:1291: error: for each function it appears in.)
ce-server.c:1291: error: syntax error before ‘rfds’
ce-server.c:1295: warning: implicit declaration of function ‘FD_ZERO’
ce-server.c:1295: error: ‘rfds’ undeclared (first use in this function)
ce-server.c:1296: warning: implicit declaration of function ‘FD_SET’
ce-server.c:1309: warning: implicit declaration of function ‘select’
ce-server.c:1311: warning: implicit declaration of function ‘FD_ISSET’
lipo: can't figure out the architecture type of: /var/folders/1V/1VnkOifVHtupY-
d0-4-OcU+++TI/-Tmp-//ccGR617m.out
make[3]: * [ce-server.o] Error 1
make[2]:
* [all] Error 2
make[1]: * [all-recursive] Error 1
make:
* [all] Error 2

Compiling libassuan SVN revision 378 gives:

In file included from ce-server.c:51:
common.h: In function ‘do_strconcat’:
common.h:265: warning: implicit declaration of function ‘stpcpy’
common.h:265: warning: incompatible implicit declaration of built-in function
‘stpcpy’
In file included from ce-server.c:51:
common.h: In function ‘do_strconcat’:
common.h:265: warning: implicit declaration of function ‘stpcpy’
common.h:265: warning: incompatible implicit declaration of built-in function
‘stpcpy’
ce-server.c: In function ‘server’:
ce-server.c:1291: error: ‘fd_set’ undeclared (first use in this function)
ce-server.c:1291: error: (Each undeclared identifier is reported only once
ce-server.c:1291: error: for each function it appears in.)
ce-server.c:1291: error: syntax error before ‘rfds’
ce-server.c:1295: warning: implicit declaration of function ‘FD_ZERO’
ce-server.c:1295: error: ‘rfds’ undeclared (first use in this function)
ce-server.c:1296: warning: implicit declaration of function ‘FD_SET’
ce-server.c:1309: warning: implicit declaration of function ‘select’
ce-server.c:1311: warning: implicit declaration of function ‘FD_ISSET’
ce-server.c: In function ‘server’:
ce-server.c:1291: error: ‘fd_set’ undeclared (first use in this function)
ce-server.c:1291: error: (Each undeclared identifier is reported only once
ce-server.c:1291: error: for each function it appears in.)
ce-server.c:1291: error: syntax error before ‘rfds’
ce-server.c:1295: warning: implicit declaration of function ‘FD_ZERO’
ce-server.c:1295: error: ‘rfds’ undeclared (first use in this function)
ce-server.c:1296: warning: implicit declaration of function ‘FD_SET’
ce-server.c:1309: warning: implicit declaration of function ‘select’
ce-server.c:1311: warning: implicit declaration of function ‘FD_ISSET’
lipo: can't figure out the architecture type of: /var/folders/1V/1VnkOifVHtupY-
d0-4-OcU+++TI/-Tmp-//ccTATAP3.out
make[3]: * [ce-server.o] Error 1
make[2]:
* [all] Error 2
make[1]: * [all-recursive] Error 1
make:
* [all] Error 2

No time to investigate further.

Any update?!?

Well, ce-server.c is code we used for some tests on WindowsCE. There is no need
to build it on other platforms. I disabled building ce-server.

Is the gpg-agent:
can't connect my own socket: Invalid value passed to IPC
still a problem?

Revision 389 compiled fine - many thanks!

benjamin-d closed this task as Resolved.Oct 24 2010, 3:01 PM

Testing suggests that the "can't connect my own socket: Invalid value passed to
IPC" gpg-agent issue has been resolved.

Many thanks!

benjamin-d reopened this task as Open.Oct 24 2010, 4:06 PM

Thanks for testing.

werner closed this task as Resolved.Oct 25 2010, 4:41 PM
Unknown Object (User) updated the task description. (Show Details)May 23 2017, 4:04 AM
Unknown Object (User) removed projects: Bug Report, gnupg.
Unknown Object (User) removed subscribers: marcus, werner, benjamin-d.
marcus updated the task description. (Show Details)May 23 2017, 9:41 AM
marcus added projects: Bug Report, gnupg.
marcus added subscribers: marcus, werner, benjamin-d.