On 12/17/2012 7:01 AM, Anna Pavlova wrote:
> Hello,
>
> I am new to OpenSC but I was looking for a 3rd party tool with which I could 
> test my self-developed pkcs11 library and I came across the OpenSC 
> pkcs11-tool.
>
> I installed OpenSC under Ubuntu11.10, following 
> http://www.gooze.eu/howto/smartcard-quickstarter-guide/opensc-installation-under-gnu-linux
>   everything went fine, but when I wanted to run the pkcs11-tool:
>
>  >  pkcs11-tool --module /home/anna/PKCS11_Project/libPkcs11.so -l -O


>
> I got segmentation fault.
>
> I was able to find the place where the code crashed. In pkcs11-tool.c the 
> line (558):
>
> rv = p11->C_Initialize(NULL);

Sounds like p11 == NULL, or p11->C_Initialize is NULL or not valid.
It should point at your C_Initialize routine.

Can you run this under gdb?

>
> seem to crash. The message is just "Segmentation fault"
>
> The module loads apparently fine.
> module = C_LoadModule(opt_module, &p11);  //no error here
>
> The problem is, that in my pkcs11 library I put an error message at the very 
> beginning of the C_Initialize function, but not even this is printed out. So 
> I don't think the crash comes from my library.
> I turned on the creation of a log file in my pkcs11 library, but not even my 
> pkcs11 library log file is created.
>

Did you define a C_GetFunctionList in the module?

You must make sure the you module is linked as a module
and not just a shared library, so that functions returned by
  C_GetFunctionList  points at the functions in your module,
and not ones that may be defined by the caller.

Have a look at the pkcs11-spy too which is a PKCS#11 module that loads
a second PKCS#11 module.

>
> I tried to google this problem and found this old thread:
> http://www.opensc-project.org/pipermail/opensc-devel/2003-April/000831.html
>
> But it didn't really help me (rebuilding openssl didn't solve the problem..). 
> Could anyone help?
>
> Thanks for any help,
> Anna
>
>
> _______________________________________________
> opensc-devel mailing list
> opensc-devel@lists.opensc-project.org
> http://www.opensc-project.org/mailman/listinfo/opensc-devel
>

-- 

  Douglas E. Engert  <deeng...@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to