Answer the question
In order to leave comments, you need to log in
C++ how to determine why an application is crashing?
Good day,% habrauser%!
I am writing a simple fcgi application using openssl that will encrypt/decrypt incoming data. I don't know much about C++, everything is collected from examples and finished with a file, so there may be strange things, please point them out :) so that you can fix it. The first problem is that the application in windows crashes on the second request (this is not observed under ubuntu), the first one works fine. The second problem is that in windows the correct data is displayed in the console after decryption, but when answering a request, in addition to the main data, there are still line breaks and a piece of the "left" line, and in ubuntu the data is not decrypted at all.
I collect the team
g++ function.cpp main.cpp -o encrypt -I/usr/include/openssl/ -L/usr/lib/ssl/ -lssl -lcrypto -lfcgi -ldl -lpthread -lboost_regex
Answer the question
In order to leave comments, you need to log in
refactoring will save the world :) I should have been more careful with pointers.
but there was another problem , I will be grateful for the help!
Learn to use a debugger. For Windows and Ubuntu, the GDB debugger is great. Build the program with the -g flag, then load it into gdb:
In GDB, give the command to run (type run, press Enter). Cause a crash in your program, enter the "bt" command, which will let you know which function your program crashed on.
Not an expert.
Try moving OpenSSL_add_all_algorithms, EVP_cleanup and OPENSSL_config out of the encript_scring function so that they are only called once.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question