1

我正在使用 RSA_sign() 创建 dkim 签名。有时,极其不可预知的代码会崩溃

我得到一个像这样的 gdb 转储

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

公司-dkim.c 可在此处 获得 http://code.google.com/p/firm-dkim/source/browse/trunk/firm-dkim.c

我怎样才能进一步调试呢?

谢谢拉姆

4

1 回答 1

1

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.

于 2012-02-07T15:09:05.753 回答