<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 5:19 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id=":7kr" class="" style="overflow:hidden">+    if (smartcard_manager) {<br>
+        GList *readers;<br>
+        GList *it;<br>
+        g_signal_connect(smartcard_manager, "<span class="">reader</span>-added",<br>
+                         (GCallback)reader_added_cb, self);<br>
+        g_signal_connect(smartcard_manager, "<span class="">reader</span>-removed",<br>
+                         (GCallback)reader_removed_cb, self);<br>
+        readers = spice_smartcard_manager_get_readers(smartcard_manager);<br>
+        for (it = readers; it != NULL; it = it->next) {<br>
+            SpiceSmartcardReader *<span class="">reader</span>;</div></blockquote></div><br><br></div><div class="gmail_extra">This code is not safe and can crash with windows build:<br><br></div><div class="gmail_extra">
#0  0x7c919af2 in ntdll!RtlpWaitForCriticalSection ()
<br>   from C:\WINDOWS\system32\ntdll.dll
<br>#1  0x7c901046 in ntdll!RtlEnterCriticalSection ()
<br>   from C:\WINDOWS\system32\ntdll.dll
<br>#2  0x0034903c in ?? ()
<br>#3  0x03339ad0 in _fu458____stack_chk_guard ()
<br>    at /home/user/pkg/mingw-qemu/qemu-1.4.0/util/qemu-thread-win32.c:44
<br>#4  0x03333c03 in _fu187____stack_chk_guard ()
<br>    at /home/user/pkg/mingw-qemu/qemu-1.4.0/libcacard/vreader.c:351
<br>#5  0x03333d03 in _fu193____stack_chk_guard ()
<br>    at /home/user/pkg/mingw-qemu/qemu-1.4.0/libcacard/vreader.c:386
<br>#6  0x00f17061 in spice_smartcard_manager_get_readers (manager=0x55c4d98)
<br>    at ../../gtk/smartcard-manager.c:619
<br>#7  0x004177ab in create_spice_session (self=0x55e0378)
<br>    at ../../src/virt-viewer-session-spice.c:269
<br>#8  0x00419d68 in virt_viewer_session_spice_new (app=0x55cf068,
<br>    main_window=0x55df000) at ../../src/virt-viewer-session-spice.c:859
<br>#9  0x0040492e in virt_viewer_app_create_session (self=0x55cf068,
<br>    type=0x565e058 "spice") at ../../src/virt-viewer-app.c:908
<br>#10 0x0041d5ac in remote_viewer_start (app=0x55cf068)
<br>    at ../../src/remote-viewer.c:1020
<br>#11 0x004060d4 in virt_viewer_app_start (self=0x55cf068)
<br>    at ../../src/virt-viewer-app.c:1548
<br>#12 0x0041dddf in main (argc=1, argv=0x53b70e8)
<br>    at ../../src/remote-viewer-main.c:173<br><br></div><div class="gmail_extra">It seems to be missing a call to vreader_init(), called from vcard_emul_init() in smartcard_manager_init()_async()<br clear="all"></div>
<div class="gmail_extra"><br><br></div><div class="gmail_extra">-- <br>Marc-André Lureau
</div></div>