After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172813 - Not thread safe usage of gnutls.
Not thread safe usage of gnutls.
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Other
2.10.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-06 14:22 UTC by Vasily Chekalkin
Modified: 2005-04-10 18:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch. (766 bytes, patch)
2005-04-06 14:37 UTC, Vasily Chekalkin
none Details | Review
New version of patch. (1.43 KB, patch)
2005-04-06 15:12 UTC, Vasily Chekalkin
none Details | Review

Description Vasily Chekalkin 2005-04-06 14:22:37 UTC
Distribution/Version: Ubuntu

In function _gnome_vfs_ssl_init calls gnutls_global_init. But for thread-enabled
programs there must previous call like gcry_control (GCRYCTL_SET_THREAD_CBS,
&gcry_threads_pthread) for set mutex lock/unlock callbacks.
Comment 1 Vasily Chekalkin 2005-04-06 14:37:45 UTC
Created attachment 39749 [details] [review]
Patch.

Proposed patch.
Comment 2 Christophe Fergeau 2005-04-06 14:45:15 UTC
I'm not sure at all gnome-vfs can assume it's being run on a system with pthread
available, iirc it uses gthread as a thread abstraction. So it would be better
to provide custom locking functions as described on
http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html
(I guess you know that url, putting it there for other people reading this bug
report ;) Dunno if that's doable though ;)
Comment 3 Vasily Chekalkin 2005-04-06 15:12:08 UTC
Created attachment 39752 [details] [review]
New version of patch.

Now with help of gthread.

But it is my first usage of GThread. And it does not contains any error
handling 'cause I didn't find how to handle it in GThread.
Comment 4 Christophe Fergeau 2005-04-07 12:14:43 UTC
What kind of error handling is needed? 
Comment 5 Vasily Chekalkin 2005-04-07 14:05:13 UTC
Hmm... I just don't know what kind of errors can return GThread calls. For
example if g_mutex_new failed how he report it? Just returns null pointer or what?
Comment 6 Christophe Fergeau 2005-04-07 14:06:51 UTC
Haven't looked at the source, but this is what most glib functions do, so I
guess g_mutex_new will do that too.
Comment 7 Vasily Chekalkin 2005-04-07 14:08:37 UTC
Ok, that means that my patch is correct :)
Comment 8 Christian Kellner 2005-04-10 18:45:23 UTC
Commit a version with small changes of this patch to cvs HEAD. 
Thanks for the patch! :)