Page MenuHome GnuPG

pinentry-gtk2 hangs when GNOME a11y is enable
Closed, ResolvedPublic

Description

When pinentry-gtk-2 is invoked by an opensc module from firefox, if GNOME a11y
is enabled, it hangs. Here is the backtrace:

#0 0x00110416 in kernel_vsyscall ()
#1 0x008abeeb in poll () from /lib/libc.so.6
#2 0x00a4664c in g_poll () from /lib/libglib-2.0.so.0
#3 0x00a39044 in ?? () from /lib/libglib-2.0.so.0
#4 0x00a39449 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#5 0x044edd78 in link_main_iteration () from /usr/lib/libORBit-2.so.0
#6 0x044cfd74 in giop_recv_buffer_get () from /usr/lib/libORBit-2.so.0
#7 0x044d4e5c in ORBit_small_invoke_stub () from /usr/lib/libORBit-2.so.0
#8 0x044d5086 in ORBit_small_invoke_stub_n () from /usr/lib/libORBit-2.so.0
#9 0x044e1b38 in ORBit_c_stub_invoke () from /usr/lib/libORBit-2.so.0
#10 0x046d9865 in Accessibility_EventListener_notifyEvent () from
/usr/lib/libspi.so.0
#11 0x00690ddc in ?? () from /usr/lib/gtk-2.0/modules/libatk-bridge.so
#12 0x00691568 in ?? () from /usr/lib/gtk-2.0/modules/libatk-bridge.so
#13 0x00b3dc70 in ?? () from /lib/libgobject-2.0.so.0
#14 0x00b3f65c in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
#15 0x00b3faf7 in g_signal_emit () from /lib/libgobject-2.0.so.0
#16 0x002a320b in ?? () from /usr/lib/gtk-2.0/modules/libgail.so
#17 0x00b3691f in g_cclosure_marshal_VOID
UINT_POINTER () from /lib/libgobject-
2.0.so.0
#18 0x00b296e3 in g_closure_invoke () from /lib/libgobject-2.0.so.0
#19 0x00b3e255 in ?? () from /lib/libgobject-2.0.so.0
#20 0x00b3f65c in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
#21 0x00b3f92d in g_signal_emit_by_name () from /lib/libgobject-2.0.so.0
#22 0x0029afe4 in ?? () from /usr/lib/gtk-2.0/modules/libgail.so
#23 0x00b3dc70 in ?? () from /lib/libgobject-2.0.so.0
#24 0x00b3f65c in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
#25 0x00b3faf7 in g_signal_emit () from /lib/libgobject-2.0.so.0
#26 0x03f53612 in gtk_widget_show () from /usr/lib/libgtk-x11-2.0.so.0
#27 0x03f533a2 in gtk_widget_show_all () from /usr/lib/libgtk-x11-2.0.so.0
#28 0x0804d1cc in create_window (pe=0x805c8a0) at pinentry-gtk-2.c:498
#29 gtk_cmd_handler (pe=0x805c8a0) at pinentry-gtk-2.c:513
#30 0x08053c92 in cmd_confirm (ctx=0xb7731004, line=0xb773103b "") at
pinentry.c:927
#31 0x080566a9 in dispatch_command (ctx=0xb7731004) at assuan-handler.c:435
#32 process_request (ctx=0xb7731004) at assuan-handler.c:458
#33 0x08056a77 in assuan_process (ctx=0xb7731004) at assuan-handler.c:526
#34 0x080536a7 in pinentry_loop () at pinentry.c:1089
#35 0x0804de2c in main (argc=1, argv=0xbf92ded4) at pinentry-gtk-2.c:571

if GNOME a11y is disabled, it works fine.

Details

Version
0.8.0

Event Timeline

Sorry, I have no clue about GNOME a11y. Given that pinentry uses its own widget
it is likely that tools which take over the input run into problems. As a quick
workaround you may want to try "pinentry -g".

I guess it is worth to write specific pinentry versions for certain
accessibility problems. Please take this to a gnupg maling list for further
discussion.

When GNOME a11y is enabled, every gtk2 application loads 2 dynamic modules (gail
and atk-bridge) that are initialized at gtk_init. These modules installs some
hooks to provide the at-spi with information about the widgets.

What is happening here, is that atk-bridge uses threads and it exposes bugs in
applications that in other situations are not visible.

I have been looking at pinentry-gtk-2 code and it does some non-standard things.
It runs the gtk main loop inside its own loop, it runs gtk functions after the
loop, and gtksecentry takes gdk lock without having initalized glib or gdk
threads.

However I am not able to reproduce the hang when running pinentry-gtk-2 from the
command line. I only get it in this situation:

  • Start firefox
  • Go to a page to sing a text with the certificate in my e-card through opensc-

pkcs11.so

  • OpenSc module calls libassuan to get the confirmation from the use
  • pinentry-gtk-2 is invoked by libassuan

I have tried to make a simple program riping all the libassuan code from the
opensc driver to make it easier to debug but got no luck.

Is that still a problem with the latest Pinentry (0.9.1 or 0.9.2)?

neal added a project: Restricted Project.Jul 26 2015, 7:47 PM
neal added a subscriber: neal.

Hi, I've just replaced the use of our custom entry widget with the standard Gtk+
entry widget. This should fix the problem. Please report back whether this is
the case. Thanks.

0.9.6 has meanwhile been released - any news?

neal claimed this task.

I'm marking this as resolved. If it is still an issue, please feel free to
reopen. Thanks.

neal removed a project: Restricted Project.Nov 6 2015, 12:41 PM