Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

segfault in GCRYCTL_SET_THREAD_CBS

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


dkg at fifthhorseman

Oct 27, 2009, 3:50 PM

Post #1 of 3 (787 views)
Permalink
segfault in GCRYCTL_SET_THREAD_CBS

The attached simple program tries to initialize gcrypt with pthread
support. On my debian system (testing/unstable, libgcrypt11 1.4.4-4)
this triggers a segfault during the call to
gcry_control(GCRYCTL_SET_THREAD_CBS).

What am i doing wrong? What have i missed?

--dkg
Attachments: main.c (0.61 KB)
  Makefile (0.12 KB)
  signature.asc (0.87 KB)


wk at gnupg

Oct 28, 2009, 6:54 AM

Post #2 of 3 (761 views)
Permalink
Re: segfault in GCRYCTL_SET_THREAD_CBS [In reply to]

On Tue, 27 Oct 2009 23:50, dkg [at] fifthhorseman said:

- ret = gcry_control(GCRYCTL_SET_THREAD_CBS, gcry_threads_pthread);
+ ret = gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);

This is the usual problem with general purpose ioctl-alike fucntions:
You don't have any type checking. I added examples to the docs.

Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


dkg at fifthhorseman

Oct 28, 2009, 8:04 AM

Post #3 of 3 (757 views)
Permalink
Re: segfault in GCRYCTL_SET_THREAD_CBS [In reply to]

On 10/28/2009 09:54 AM, Werner Koch wrote:
> On Tue, 27 Oct 2009 23:50, dkg [at] fifthhorseman said:
>
> - ret = gcry_control(GCRYCTL_SET_THREAD_CBS, gcry_threads_pthread);
> + ret = gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
>
> This is the usual problem with general purpose ioctl-alike fucntions:
> You don't have any type checking. I added examples to the docs.

Thanks, Werner. That does fix it for me, and it seems obvious in
retrospect ;) I suspect having the examples in the docs will be useful.

Regards,

--dkg
Attachments: signature.asc (0.87 KB)

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.