Question

I am using RSA_sign() to create dkim signatures. Sometimes , extremely unpredictably the code just crashes

I get a gdb dump like this

Thread 39 (Thread 0x41401940 (LWP 31921)):
#0  0x0000003b9dacc3bb in BN_div () from /lib64/libcrypto.so.6
#1  0x0000003b9daceb40 in BN_mod_inverse () from /lib64/libcrypto.so.6
#2  0x0000003b9dacb609 in BN_BLINDING_create_param () from /lib64/libcrypto.so.6
#3  0x0000003b9dadc9f7 in RSA_setup_blinding () from /lib64/libcrypto.so.6
#4  0x0000003b9daee954 in ?? () from /lib64/libcrypto.so.6
#5  0x0000003b9daef56b in ?? () from /lib64/libcrypto.so.6
#6  0x0000003b9da6e965 in RSA_sign () from /lib64/libcrypto.so.6
#7  0x0000000000403e7f in dkim_create (headers=0x2aaaac001840, headerc=7,
......., v=0) at firm-dkim.c:145

The firm-dkim.c is available here http://code.google.com/p/firm-dkim/source/browse/trunk/firm-dkim.c

How can I debug this further ?

Thanks Ram

Was it helpful?

Solution

Ok I think I got the error The code over here firm-dkim.c. Does not allocate any memory for RSA *rsa_private , line 48

And this unallocated memory area is used in RSA_sign() and RSA_free()

I think that must be causing the segfault. I have alloc'ed memory now and I am running the daemon in production. Hopefully no more segfaults now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top