How to get detailed errors: "F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)"?
-
Use a debugger and take a look in the stack trace to see where the error comes from.
@Christian-Ehrlicher I updated the content of the question, please look again.Tks.
-
@Christian-Ehrlicher I updated the content of the question, please look again.Tks.
@senmx
The code you have written seems to have nothing to do with Qt.Since you are told
Cause: null pointer dereference
why don't you put some more error checking into your code? For example, maybe
r = RSA_new();
is returningnullptr
, I don't do, how are you sure it does not? Or, put in someqDebug()
statements or similar between the lines so you know where you get to. -
@senmx
The code you have written seems to have nothing to do with Qt.Since you are told
Cause: null pointer dereference
why don't you put some more error checking into your code? For example, maybe
r = RSA_new();
is returningnullptr
, I don't do, how are you sure it does not? Or, put in someqDebug()
statements or similar between the lines so you know where you get to. -
@JonB Remove this sentence and it can run normally,at least no error
EVP_PKEY_assign_RSA(evpkey, r);
-
@senmx
And you did check whetherr == nullptr
?In any case, you should look at the documentation of the non-Qt library functions you are calling. Maybe your
evpkey
data is wrong. -
Hi,
Do you base your code on an official example ?
If so can you share it ? -
@SGaist The magic is that it is normal to using a demo to test this function separately.Even add this sentence
EVP_PKEY_assign_RSA(evpkey, r);
The key is that you cannot get detailed error logs.
@senmx said in How to get detailed errors: "F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)"?:
@SGaist The magic is that it is normal to using a demo to test this function separately.
What do you mean by that ?
-
@SGaist It's okay, it shouldn't be caused by that, the key is is there a way to get detailed logs?
-
@JonB Yes. I now suspect that there is a memory leak in EVP_PKEY_assign_RSA, causing the following code to be wrong.
@senmx
Well a memory leak would not cause a crash, rather only some wasted memory. So that should not be the cause of the issue you report.Despite being asked, you still have not said a word about what this library is and more importantly where you get the sample for the code you have written.....
-
@senmx
Well a memory leak would not cause a crash, rather only some wasted memory. So that should not be the cause of the issue you report.Despite being asked, you still have not said a word about what this library is and more importantly where you get the sample for the code you have written.....
-
@JonB Tks. It's just a guessing, it's probably a pointer memory problem.How to get a more detailed error stack?
@senmx said in How to get detailed errors: "F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)"?:
@JonB Tks. It's just a guessing, it's probably a pointer memory problem.How to get a more detailed error stack?
Install the debug symbols of that library and use a debugger.
-
@senmx
Well a memory leak would not cause a crash, rather only some wasted memory. So that should not be the cause of the issue you report.Despite being asked, you still have not said a word about what this library is and more importantly where you get the sample for the code you have written.....
-
@JonB Presumably you are referring to this question.What library you are asking is just a piece of code. There is no library. My main question is how to get detailed error information. I'm already trying to solve it myself.
@senmx said in How to get detailed errors: "F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)"?:
There is no library.
Oh! So all the code you originally showed, and the
EVP_PKEY_assign_RSA(evpkey, r);
you still have, is not in a library? It's your own code, with your own source code. And there was I, thinking it was all code from OpenSSL, when in fact it is not, and you just happen to have chosen to name all your own classes/functions to match those supplied from OpenSSL....So you don't need to install any debug symbols like @SGaist said, you can just look at your own source code. Will be much easier.