Subject: ModSSL 2.8.8 + Apache 1.3.24 crashing on Windows

From: Hassan S <[email-masked]>
Date: Wed, 03 Apr 2002 17:03:38 +0530

Hi,

   I have a situation where I have to redirect from a HTTP to a HTTPS
connection
via a servlet. That is I send a HTTP GET request to a servlet which in
reply sends
a redirect to a web page with the URL protocol changed to HTTPS.

Till Apache 1.3.20+ModSSL 2.8.4 this was working fine. But after I
upgraded
to Apache 1.3.24+ModSSL 2.8.8 (to get the security fixes :) ), it is
crashing
with a error message like

"The instruction at "0x6ff90e08" referenced memory at "0x72676f76". The
memory
could not be read."

If I click Cancel to debug using VC++ it shows an invalid memory access
in ApacheCore.dll.

My platform config is

Windows 2000
MS VC++ 6.0 (SP5)
OpenSSL 0.9.6c (built using MASM optimizations).

Please let me know where the problem is, or maybe where I should look to
try and
debug this. This has become a critical issue for me!

Regards,
Hassan.

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: "Andrew Lietzow" <[email-masked]>
Date: Wed, 3 Apr 2002 08:52:05 -0600

Dear Hassan,
RE:>>Windows 2000
Not to be smart or anything but why are you trying to run a server based
application on a desktop operating system?   Since PC's are so cheap and
Linux is so cheap, why not invest in a machine that will do what you want it
to do without having to pull out all of your hair?

RE:>>> "The instruction at "0x6ff90e08" referenced memory at "0x72676f76".
The memory could not be read."
This tells very little about the problem.  Oh, I suppose the authors of
these programs might be able to figure out what instruction is in that
memory location at the exact time that your programs fail, but this is
typical of Desktop O/S's.  They give you a bomb and then hope you can figure
it out.

RE:>>This has become a critical issue for me!
If that were true, you would already be running this on Linux...   Well,
maybe that's a bit strong but I am serious that source code type
applications are more compatible with source code type O/S's.  Do you have a
vested interest in running this on Windows 2000?  Is that a must do for you?
IMHO, whatever is holding you back from installing this application onto
Linux, you might as well deal with it and then move on ... RedHat, SuSE,
Caldera, Mandrake... just do it!

Andrew Lietzow
The ACL Group, Inc.

---

From: Hassan S <[email-masked]>
Date: Wed, 03 Apr 2002 20:52:58 +0530

Thanks for your suggestion Andrew, but that doesn't help me ! My application
should support Windows also. So, there is no way for me other than fixing
this problem.

Any other suggestions/experiences please?

Thanks
Hassan

---

From: Hassan S <[email-masked]>
Date: Sat, 06 Apr 2002 13:17:22 +0530

Hi Ralf,

I built the Apache and mod_ssl in Debug configuration to trace out this
consistent problem. When I got this unreferenced memory, I clicked cancel to
debug using VC++. It says "invalid memory Access" and points to the
following source code.

    API_EXPORT(void *) ap_ctx_get(ap_ctx *ctx, char *key)
    {
        int i;

==>    for (i = 0; ctx->cr_entry[i] != NULL; i++)
                if (strcmp(ctx->cr_entry[i]->ce_key, key) == 0)
                return ctx->cr_entry[i]->ce_val;
        return NULL;
    }

So, ctx can be either a NULL pointer or uninitialised or corrupted memory
reference for this case.

Here is the full debug functional trace:
ap_ctx_get(ap_ctx_rec *, char *)
ssl_io_suck_read(ssl_st *, char *, int)
SSL_recvwithtimeout(buff_struct *, char *, int)
ssl_io_hook_recvwithtimeout(buff_struct *, char *, int)
ap_hook_call_func(char *, ap_hook_entry *, ap_hook_func *)
ap_hook_call(char *)
buff_read(buff_struct *, void *, int)
saferead_guts(buff_struct *, void *, int)
read_with_errors(buff_struct *, void *, int)
ap_bgets(char * int , buff_struct *)
getline(char *, int, buff_struct *, int)
read_request_line(request_rec *)
ap_read_request(conn_rec *)
child_sub_main(int)
child_main(int)

I understand that memory has been allocated for the request object and for
the context (r->ctx) in ap_read_request as follows. And, I am pretty sure
that we built under EAPI only.

 r = ap_pcalloc(p, sizeof(request_rec));
 r->pool            = p;
.....
.....
#ifdef EAPI
    r->ctx = ap_ctx_new(r->pool);
#endif /* EAPI */

Then, How come this ctx value can be NULL or invalid? Is this memory pool
will be cleaned-up intermittently?

By handling this exception with __try and  __except block in
ssl_io_suck_read, I can avoid these invalid memory reference errors. But, I
want to make sure this doesn't break anything else.
I feel there is some buggy code added in mod_ssl2.8.8 since I am not facing
this problem with Apache1.3.20 and mod_ssl2.8.4 on the same Win2k server in
SSL mode. And, please note that Apache1.3.24 is working perfectly in http
mode for me. Please let me know, if you need any other information.

Any help is greatly appreciated.

Thanks
Hassan

---

From: Server Admin <[email-masked]>
Date: Sat, 06 Apr 2002 09:23:43 -0600

Hello, Pardon me for modifying this topic, but I have concerns about what
version of modssl to use, especially after reading this message.

I'm new to the list and run Apache-1.3.22_1. I was looking for a modssl
version that could be used with it in order to set up HTTPS for a virtual
host. But, I noticed the links have all been broken or pulled for modssl
release 2.8.5. Since I haven't seen the archives yet, I assume there is a
good reason and I would need to update Apache and use the latest 
modssl.

Can some one confirm that I should give up looking for a modssl for my
version of Apache..?? Going to take several hours to upgrade....

Many thanks....!!

At 01:17 PM 4.6.2002 +0530, Hassan S wrote: 

Hi Ralf, 

I built the Apache and mod_ssl in Debug configuration to trace out this
consistent problem. When I got this unreferenced memory, I clicked cancel
to debug using VC++. It says "invalid memory Access" and points to the
following source code. 

    { 

        int i; 

<bold>==>    for (i = 0; ctx->cr_entry[i] != NULL; i++)</bold> 

        return NULL; 

    } 

<underline>Here is the full debug functional trace:</underline> 

<color><param>ffff,0000,0000</param>ap_ctx_get(ap_ctx_rec *, char
*)</color> 

ap_hook_call(char *) 

<color><param>3333,3333,ffff</param>ap_read_request(conn_rec *)</color> 

child_sub_main(int) 

child_main(int) 

I understand that memory has been allocated for the request object and
for the context (r->ctx) in ap_read_request as follows. And, I am pretty
sure that we built under EAPI only. 

<color><param>3333,3333,ffff</param> r = ap_pcalloc(p,
sizeof(request_rec));</color> 

<color><param>3333,3333,ffff</param> r->pool            = p;</color> 

<color><param>3333,3333,ffff</param>.....</color> 

<color><param>3333,3333,ffff</param>.....</color> 

<color><param>3333,3333,ffff</param>#ifdef EAPI</color> 

<color><param>3333,3333,ffff</param>    r->ctx =
ap_ctx_new(r->pool);</color> 

<color><param>3333,3333,ffff</param>#endif /* EAPI */</color> 

By handling this exception with __try and  __except block in
ssl_io_suck_read, I can avoid these invalid memory reference errors. But,
I want to make sure this doesn't break anything else. 

I feel there is some buggy code added in mod_ssl2.8.8 since I am not
facing this problem with Apache1.3.20 and mod_ssl2.8.4 on the same Win2k
server in SSL mode. And, please note that Apache1.3.24 is working
perfectly in http mode for me. Please let me know, if you need any other
information. 

Thanks 

Hassan 

Hassan S wrote: 

<excerpt>Hi, 

connection 

reply sends 

upgraded 

crashing 

memory 

could not be read." 

in ApacheCore.dll. 

My platform config is 

Windows 2000 

MS VC++ 6.0 (SP5) 

try and 

Regards, 

Hassan. 

</excerpt>

<<<<<<<<

.... our website: http://www.sage-one.net/

Best regards,

Jack L. Stone

Server Admin

---

From: "Enrico Demarin" <[email-masked]>
Date: Sun, 7 Apr 2002 13:07:50 -0700

Have you tried putting KeepAlive Off in the SSL vhost ?
 
- Enrico

-----Original Message-----
From: [email-masked]
[mailto:[email-masked]] On Behalf Of Hassan S
Sent: April 5, 2002 11:47 PM
To: [email-masked]; Ralf S. Engelschall
Cc: Moinak Ghosh
Subject: Re: ModSSL 2.8.8 + Apache 1.3.24 crashing on Windows
Importance: High

Hi Ralf, 

I built the Apache and mod_ssl in Debug configuration to trace out this
consistent problem. When I got this unreferenced memory, I clicked
cancel to debug using VC++. It says "invalid memory Access" and points
to the following source code. 

So, ctx can be either a NULL pointer or uninitialised or corrupted
memory reference for this case. 

Then, How come this ctx value can be NULL or invalid? Is this memory
pool will be cleaned-up intermittently? 

By handling this exception with __try and  __except block in
ssl_io_suck_read, I can avoid these invalid memory reference errors.
But, I want to make sure this doesn't break anything else. 
I feel there is some buggy code added in mod_ssl2.8.8 since I am not
facing this problem with Apache1.3.20 and mod_ssl2.8.4 on the same Win2k
server in SSL mode. And, please note that Apache1.3.24 is working
perfectly in http mode for me. Please let me know, if you need any other
information. 

Thanks 
Hassan 

Hassan S wrote: 

Hi, 

My platform config is 

Windows 2000 
MS VC++ 6.0 (SP5) 

try and 

Regards, 
Hassan.

---

From: Sergi Mayordomo <[email-masked]>
Date: Mon, 08 Apr 2002 09:32:48 +0200

Server Admin escribió:
> 
> Hello, Pardon me for modifying this topic, but I have concerns about what version of modssl to use, especially after reading this message.
> 
> I'm new to the list and run Apache-1.3.22_1. I was looking for a modssl version that could be used with it in order to set up HTTPS for a virtual host. But, I noticed the links have all been broken or pulled for modssl release 2.8.5. Since I haven't seen the archives yet, I assume there is a good reason and I would need to update Apache and use the latest modssl.
> 
> Can some one confirm that I should give up looking for a modssl for my version of Apache..?? Going to take several hours to upgrade....
> 
> Many thanks....!!
> 
> I built the Apache and mod_ssl in Debug configuration to trace out this consistent problem. When I got this unreferenced memory, I clicked cancel to debug using VC++. It says "invalid memory Access" and points to the following source code.
> 
> So, ctx can be either a NULL pointer or uninitialised or corrupted memory reference for this case.
> 
> I understand that memory has been allocated for the request object and for the context (r->ctx) in ap_read_request as follows. And, I am pretty sure that we built under EAPI only.
> 
> Then, How come this ctx value can be NULL or invalid? Is this memory pool will be cleaned-up intermittently?
> 
> By handling this exception with __try and __except block in ssl_io_suck_read, I can avoid these invalid memory reference errors. But, I want to make sure this doesn't break anything else.
> I feel there is some buggy code added in mod_ssl2.8.8 since I am not facing this problem with Apache1.3.20 and mod_ssl2.8.4 on the same Win2k server in SSL mode. And, please note that Apache1.3.24 is working perfectly in http mode for me. Please let me know, if you need any other information.
> 
> <<<<
> Server Admin ______________________________________________________________________ Apache Interface to OpenSSL (mod_ssl) www.modssl.org User Support Mailing List [email-masked] Automated List Manager [email-masked]

Hi,
I have apache-1.3.22-2 (rpm, comes with RedHat 7.2), and it works really
fine with:
	openssl-0.9.6b-8
	mod_ssl-2.8.5-1
(rpms too).
In the official site(mod_ssl.org), i've seen this version is in a folder
named "obsolete", i don't know if newer versions works with this apache.
I supose obsolete are things that have problems(because aren't old) and
have supplied them, but not very information about this is given in the
web site.

Bye