Discussion:
PEM_write_X509 - access violation
Alexey S. Poluntchenko
2002-09-23 18:27:46 UTC
Permalink
code:

// prepare x509 content

FILE *fp = fopen("test.cer", "wbr+");
// not null

PEM_write_X509(fp, x509); // <- access violation (i'm using win2k pro)

fclose(fp);

could any body tell me the reason?

thanks
wbr
Christian Hohnstaedt
2002-09-28 16:24:33 UTC
Permalink
Same here on a WIN98 box,

seems like all PEM_write_XXX functions do segfault.
OpenSSL was compiled with the VC++ .dsp files provided
by http://www.iconsinc.com/~agray/ossldev/

the same code runs without errors on linux

Regards
Christian
Post by Alexey S. Poluntchenko
// prepare x509 content
FILE *fp = fopen("test.cer", "wbr+");
// not null
PEM_write_X509(fp, x509); // <- access violation (i'm using win2k pro)
fclose(fp);
could any body tell me the reason?
thanks
wbr
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Dr. Stephen Henson
2002-09-28 22:04:54 UTC
Permalink
Post by Christian Hohnstaedt
Same here on a WIN98 box,
seems like all PEM_write_XXX functions do segfault.
OpenSSL was compiled with the VC++ .dsp files provided
by http://www.iconsinc.com/~agray/ossldev/
the same code runs without errors on linux
Read the FAQ.

Steve.
--
Dr. Stephen Henson steve-MCmKBN63+***@public.gmane.org
OpenSSL Project http://www.openssl.org/~steve/
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Cory Albrecht
2002-09-29 23:26:29 UTC
Permalink
Post by Dr. Stephen Henson
Post by Christian Hohnstaedt
Same here on a WIN98 box,
seems like all PEM_write_XXX functions do segfault.
OpenSSL was compiled with the VC++ .dsp files provided
by http://www.iconsinc.com/~agray/ossldev/
the same code runs without errors on linux
Read the FAQ.
For me it's any of the *_fp() functions which crash - something like
PEM_write_bio_PrivateKey() or PEM_read_bio_X509() work fine. And it's
all of the functions which use a FILE* argument instead of a BIO* which
crash on me.

Since I already knew it wasn't the single threaded vs. multi-threaded
problem mentioned in the FAQ, I wondered briefly if it was related to
OPENSSL_NO_FP_API (I had seen that in the headers while lookign for
otehr things), but since my program linked properly with nothing left
unfound I decided it couldn't be that.

This wasn't a big problem for me since I had no overwhelming reason to
have to use a FILE* instead of a BIO* - all I was doing was opening the
file, reading in/writing out the certificate/key and immediately
closing the file.

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Dr. Stephen Henson
2002-09-30 00:16:15 UTC
Permalink
Post by Cory Albrecht
Post by Dr. Stephen Henson
Post by Christian Hohnstaedt
Same here on a WIN98 box,
seems like all PEM_write_XXX functions do segfault.
OpenSSL was compiled with the VC++ .dsp files provided
by http://www.iconsinc.com/~agray/ossldev/
the same code runs without errors on linux
Read the FAQ.
For me it's any of the *_fp() functions which crash - something like
PEM_write_bio_PrivateKey() or PEM_read_bio_X509() work fine. And it's
all of the functions which use a FILE* argument instead of a BIO* which
crash on me.
Since I already knew it wasn't the single threaded vs. multi-threaded
problem mentioned in the FAQ, I wondered briefly if it was related to
OPENSSL_NO_FP_API (I had seen that in the headers while lookign for
otehr things), but since my program linked properly with nothing left
unfound I decided it couldn't be that.
This wasn't a big problem for me since I had no overwhelming reason to
have to use a FILE* instead of a BIO* - all I was doing was opening the
file, reading in/writing out the certificate/key and immediately
closing the file.
Since the Win32 crashing question gets asked about once per week the initial
response is to point someone at the FAQ which covers almost all cases.

Things like FILE * crashing on Win32 only are almost always done to a runtime
library conflict of some kind. Either multi/single thread or debugging/non
debugging or some DLL linked in somewhere with a conflicting RTL.

Try compiling OpenSSL in the conventional way as mentioned in INSTALL.W32 and
see if it still happens.

Steve.
--
Dr. Stephen Henson steve-MCmKBN63+***@public.gmane.org
OpenSSL Project http://www.openssl.org/~steve/
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Loading...