I encountered this same error and tried deleting the entire source tree and configuring for 64bit using ./Configure aix64-cc --prefix=/usr/local.

I still got the same segmentation fault as B via RT did. So I started trying to find out why. I modified the make file to add the -g debug option (I'm sure there are better ways to turn on debug). That wasn't enough to get a meaningful stack traceback I also had to add -qfullpath -qsymtab -qtbtable -qkeepparm to get the traceback, and all the function parameters.

Since the seg fault created a core file, I was able to look at the stack with dbx and I found the problem -> I <- was having.


.() at 0xf410
fwrite_unlocked(??, ??, ??, ??) at 0x900000000079320
fwrite(??, ??, ??, ??) at 0x9000000000794b8
[EMAIL PROTECTED](0x110105470, 0x1010c9b6, 0x1000000010, 0x0), line 181 in "bss_file.c" file_write(b = 0x0000001000000010, in = (nil), inl = 1), line 179 in "bss_file.c" BIO_write(b = 0x0000000110105470, in = 0x000000001010c9b6, inl = 16), line 201 in "bio_lib.c" X509_NAME_print(0x110105470, 0x11010f1f0, 0x1000000010), line 482 in "t_x509.c" X509_NAME_print_ex(0x110105470, 0x11010f1f0, 0x1000000010, 0x0), line 512 in "a_strex.c"
X509_REQ_print_ex(0x110105470, 0x110105d90, 0x0, 0x0), line 125 in "t_req.c"
x509_main(0x9, 0xffffffffffff288), line 970 in "x509.c"
[EMAIL PROTECTED](0x1100ea950, 0x900000009, 0xffffffffffff240, 0x100000001), line 402 in "openssl.c" lock_dbg_cb(mode = 1, type = 9, file = "^O\377\377\377\377\377\364x^O\377\377\377\377\377\364}^O\377\377\377\377\377\364\203^O\377\377\377\377\377\364\207^O\377\377\377\377\377\364\221^O\377\377\377\377\377\364\234^O\377\377\ 377\377\377\364\245^O\377\377\377\377\377\364\256^O\377\377\377\377\377\364\263", line = 1), line 396 in "openssl.c"
main(Argc = 9, Argv = 0x0ffffffffffff240), line 321 in "openssl.c"

------ from bio_lib.c ------
 176   int BIO_write(BIO *b, const void *in, int inl)
 177           {
 178           int i;
 179           long (*cb)();
 180
 181           if (b == NULL)
 182                   return(0);
 183
 184           cb=b->callback;
 185           if ((b->method == NULL) || (b->method->bwrite == NULL))
 186                   {
 187                   BIOerr(BIO_F_BIO_WRITE,BIO_R_UNSUPPORTED_METHOD);
 188                   return(-2);
 189                   }
 190
 191           if ((cb != NULL) &&
 192                   ((i=(int)cb(b,BIO_CB_WRITE,in,inl,0L,1L)) <= 0))
 193                           return(i);
 194
 195           if (!b->init)
 196                   {
 197                   BIOerr(BIO_F_BIO_WRITE,BIO_R_UNINITIALIZED);
 198                   return(-2);
 199                   }
 200
 201           i=b->method->bwrite(b,in,inl);
 202
 203           if (i > 0) b->num_write+=(unsigned long)i;
 204
 205           if (cb != NULL)
 206                   i=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,in,inl,
 207                           0L,(long)i);
 208           return(i);
 209           }
------ end from bio_lib.c ------

As the stack traceback shows, the BIO_write function calls the file_write
function with what is supposed to be the buffer to be written as the
second argument. What the traceback also shows is that the argument
'in = (nil)'. Reviewing the code between lines 176 (start) and the
file_write function call (line 201), we can see that nothing should
have set the in argument to nil (or NULL). But the stack traceback
doesn't lie, it is nil. With that in mind, I figured the optimizer was
causing this and removed the -O from the Makefile.

That fixed it! The entire test suite completed. But no optimization?
bummer.

So I thought of using a #pragma in bio_lib.c. To insure that no other
systems would encounter the pragma I placed a #ifdef OPENSSL_SYSNAME_AIX
around the pragma.

I tried a number of different pragma's and I haven't yet successfully passed the
"convert a certificate into a certificate request using 'x509'" test.
I am now wondering if there is a buffer overrun or other pointer math
getting messed up somewhere else that is stomping on pointers in the BIO struct.

I've got to get some other work done so this is going to have to wait for
me or someone else to figure out later.

For now deleting the -O (cap o) in the CFLAG of the Makefile after running
./Configure seems to work.

In closing, I should mention I did find some other errors in the make test and I don't know enough to know if they are related. I included them below for completeness.

error 10 at 0 depth lookup:certificate has expired
error 10 at 0 depth lookup:certificate has expired
error 40 at 0 depth lookup:proxy certificates not allowed, please set the appropriate flag error 40 at 0 depth lookup:proxy certificates not allowed, please set the appropriate flag
ERROR in CLIENT
495854:error:1407E086:SSL routines:SSL2_SET_CERTIFICATE:certificate verify failed:s2_clnt.c:1066:

There are actually a good number of the last error repeated, but I didn't want this to get any longer.

Hope all this helps

cah



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to