Hi, I was not aware SSL with multi threading could lead to such issues.
My understanding is heap would be allocated for your webserver and not per lib loaded. I would strongly advice running your code under a valgrind (or equivalent). The heap could be corrupted by a something like a double free in your custom code. Cheers! On Mon, Dec 13, 2010 at 2:25 PM, Marin Bek <[email protected]> wrote: > Hello, > > yes, it seems heap gets corrupted when SSL is used. The situation is: My > application uses axis2, which uses SSL. I built them all using /MD now, > since I found in openSSL documentation that heap corruption could occur if > SSL used in multiple threads, and the error doesn't occur when pure HTTP is > used. Suggested method is to use \MD threading. It is now more stable, and > it seems it is now my application failing due to heap corruption. But if I > understand correctly, that shouldn't be an issue since it is also > dynamically linked. > > I built openssl using instructions included in source and nasm. > Axis2 is version 1.6 and built using options: > ENABLE_SSL = 1 > ENABLE_LIBCURL = 0 > ENABLE_LIBXML2=0 > WITH_TCP = 0 > WITH_ARCHIVE = 0 > OPENSSL_BIN_DIR = H:\openssl\dir > CRUNTIME = /MD > EMBED_MANIFEST = 1 > DEBUG = 1 > > Application is built using \MD as I already said. > > Am I supposed to do anything else to prevent heap corruption when > multithreading? > > Thank you > > > On Mon, Dec 13, 2010 at 1:05 PM, Rico M <[email protected]> wrote: > >> Getting back to the topic.... >> >> If i understand correctly, you are creating the environemnt with every >> call and the failure seems to happen on the second call...? >> >> I am doing something similar as above and it does not fail. It may be a >> case of heap corruption some where after the first call is processed. >> >> Cheers! >> >> >> >> On Fri, Dec 10, 2010 at 3:27 PM, Marin Bek <[email protected]> wrote: >> >>> Hello, >>> >>> our app uses axis2 to communicate with our java service via SOAP. >>> Everything works, but there are issues when a new call is made. >>> >>> Way it works: >>> 1. app signs in to server using https, env is opened with >>> axutil_env_create_all and stub with axis2_stub_create_MyApp >>> Return data is successfully received and signout is conducted. stub and >>> env are freed with axis2_stub_free and axutil_env_free. Pointers are not >>> reset to 0, so I don't know if this actually works? >>> >>> 2. The same functions are called with the same data (sign in), env and >>> stub are created once more, and sign is being conducted, but I get a "memory >>> access violation" on : >>> ret_node = axis2_svc_client_send_receive_with_op_qname( >>> svc_client, env, op_qname, payload); >>> >>> >>> Methods are auto-generated, so I guess they should be ok. >>> >>> Any ideas why this should happen? We don't have env and stub open all the >>> time because it may be that there is no activity for several hours. >>> >>> Thank you... >>> >> >> >
