Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)

2001-08-28 Thread Greg Stein

On Mon, Aug 27, 2001 at 04:08:25PM +0200, Pavel Novy wrote:
...
 I agree this is an undesirable way for bitfields to be aligned, but this
 agrees with MSVC, upon which we based the bitfield layout.  (In MSVC the
 smallest we can make the struct is 4 bytes!)
 
 I think the way to work around this is to change the bitfield base type to
 unsigned char.  The type of the bitfield is used in determining how it is
 aligned; thus, using a smaller type will require a smaller alignment.
...
 --- util_uri.h.orig   Mon Feb 26 16:49:32 2001
 +++ util_uri.hMon Aug 27 15:44:41 2001
 @@ -106,10 +106,10 @@
  
  unsigned short port; /* The port number, numeric, valid only if port_str != 
NULL */
  
 -unsigned is_initialized:1;
 +unsigned char is_initialized:1;
  
 -unsigned dns_looked_up:1;
 -unsigned dns_resolved:1;
 +unsigned char dns_looked_up:1;
 +unsigned char dns_resolved:1;
  
  } uri_components;


Screw the bitfields. Just change all of them to plain old unsigned chars.
(and apr_byte_t in APR). There is no reason to be miserly with bits here.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/



Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)

2001-08-28 Thread Pavel Novy

Hi,

William A. Rowe, Jr. wrote:

From: "Pavel Novy" [EMAIL PROTECTED]
Sent: Monday, August 27, 2001 9:08 AM


I suggest to fix the problem as described (patch attached), even if it will be 
considered as CodeWarrior's bug (and fixed, then)

by Metrowerks or not. I've detailedly analyzed the issue and I see no way how to stay 
backwardly compatible with this issue, so all
binaries for NetWare platform (Apache core+modules from CVS sources and all "3rd 
party" external modules produced with CW) should be
re-built after the fix (if it will be commited) - it will not be possible to mix new 
NLMs with older Apache core or modules.

I have tested the fix with CW 5.3 and gcc 2.95.3 and it seems that alignment of 
problematic structures is the same (it differs

from current status quo, of course). The change in the source file shared on all 
platforms is requested, so verification on these
ones will be needed. I don't expect problems (no change in alignment) on platforms 
where the GNU stuff is used (gcc). Thanks.

Pavel,

  I'm sorry, I cannot see this code change for the 1.3 generation.  I sympathize that 
the
implementors on the Netware platform refuse to see eye to eye (or even attempt to 
bring
some sort of compatiblity options to the table.)  And the unsigned char solution is 
very
slow, compared to integer manipulation, so I'm not sure we would choose that anyways.

I don't know how much are you familiar with the bitfields and gcc, but 
I've spend enough hours analyzing this weird issue already... I have 
tested with gcc 2.95.2 on Linux - it is obvious that  this change in the 
base type doesn't affect speed of produced code. Please take a look on 
attached sample (especially .s files) to see differences with changed 
base type to char, short, int and long. The bitfield is very specific 
kind of C(++) type and gcc implements it the following way: the smallest 
amount of memory is used to store merged "bit elements" used in a struct 
- if it fits into char (8 bits), then one byte is used to store/access 
whole bitfield (gcc, Watcom).

There is the essential difference in implementation of the bitfields 
between gcc and CodeWarrior and it is the source of the problem. I am 
not able to decide which implementation is wrong and which is not (even 
if that used in CW is very unusual), but I am pretty sure, that proposed 
change causes no problems on Linux platform (not sure for other ones). 
The problems expected on NetWare platform I've described already.


  Please bring this discussion to Apache 2.0.  I know Brad Nicholes and company at 
Novell
are working hard to support Apache 2.0.  This implementation will be a far more 
secure and
stable platform than the 1.3 hybrid/threaded implementations (win32/os2/netware etc.)

I believe that they are doing their job well (and it is hard) and hoping 
that version 2.0 of the Apache server will be the best one ever. 
However, even if version 1.3 is ugly in some cases, it is the only one 
version currently available for NetWare platform. My target was build 
the Apache server for NetWare from the CVS sources with GNU stuff and I 
have succeeded with this, so I hope it will be supported way by default 
in 2.0. In other case I will be in the same situation like I was with 
version 1.3, when some new sources for NetWare platform will be out.


  If we direct our energies at solving the problem there, and we can agree on a 
mechansim,
I see this issue being resolved in Apache 2.0.

Bill

There are no sources for NetWare platform available yet, so I can't do 
anything with this. I don't really want to waste developers' time, but 
version 1.3 is still the current one...

Regards,
Pavel

P.S.: BTW, another way how to solve the problem without changes in the 
sources is to throw CodeWarrior away and use gcc as a tool for all 
target platforms... (But it is impossible to do it just now.)


 bitfield-sample.zip


Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)

2001-08-28 Thread Günter Knauf

Hi Brad,

  About 90% of the NetWare specific changes for the APR layer have been
  checked into CVS.  I am still working on the final 10% (which is
  usually the hardest).  It may not look that way only because we were
  able to piggy back most of the NetWare code on Unix.  This is a good
  thing for us because it means that we didn't have to rewrite a lot of
  code.  I still have to organize some of the platform specific header
  files and get some of the kinks worked out in the project file, but
  we are close to having and APR layer that should work with the HTTPD
  server.  In theory as soon as we get APR complete, there shouldn't be
  any additional work necessary to make Apache 2.0 run.  Of course a
  theory is just a theory until it is proven and we won't have the
  proof until APR is complete for NetWare :).

thanks for your detailed info!
And please dont misunderstand me: 
I dont want to say something against your work, it was just only to tell Bill that we 
are currently unable to look at 2.0...

Can you please post here when you have checked in all files needed for building a 2.0 
version?

Thanks, Guenter.




Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)

2001-08-27 Thread William A. Rowe, Jr.

From: "Pavel Novy" [EMAIL PROTECTED]
Sent: Monday, August 27, 2001 9:08 AM


 I suggest to fix the problem as described (patch attached), even if it will be 
considered as CodeWarrior's bug (and fixed, then)
by Metrowerks or not. I've detailedly analyzed the issue and I see no way how to stay 
backwardly compatible with this issue, so all
binaries for NetWare platform (Apache core+modules from CVS sources and all "3rd 
party" external modules produced with CW) should be
re-built after the fix (if it will be commited) - it will not be possible to mix new 
NLMs with older Apache core or modules.

 I have tested the fix with CW 5.3 and gcc 2.95.3 and it seems that alignment of 
problematic structures is the same (it differs
from current status quo, of course). The change in the source file shared on all 
platforms is requested, so verification on these
ones will be needed. I don't expect problems (no change in alignment) on platforms 
where the GNU stuff is used (gcc). Thanks.

Pavel,

  I'm sorry, I cannot see this code change for the 1.3 generation.  I sympathize that 
the
implementors on the Netware platform refuse to see eye to eye (or even attempt to bring
some sort of compatiblity options to the table.)  And the unsigned char solution is 
very
slow, compared to integer manipulation, so I'm not sure we would choose that anyways.

  Please bring this discussion to Apache 2.0.  I know Brad Nicholes and company at 
Novell
are working hard to support Apache 2.0.  This implementation will be a far more secure 
and
stable platform than the 1.3 hybrid/threaded implementations (win32/os2/netware etc.)

  If we direct our energies at solving the problem there, and we can agree on a 
mechansim,
I see this issue being resolved in Apache 2.0.

Bill








 --- util_uri.h.orig Mon Feb 26 16:49:32 2001
 +++ util_uri.h Mon Aug 27 15:44:41 2001
 @@ -106,10 +106,10 @@

  unsigned short port; /* The port number, numeric, valid only if port_str != 
NULL */

 -unsigned is_initialized:1;
 +unsigned char is_initialized:1;

 -unsigned dns_looked_up:1;
 -unsigned dns_resolved:1;
 +unsigned char dns_looked_up:1;
 +unsigned char dns_resolved:1;

  } uri_components;






Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)

2001-08-27 Thread Günter Knauf

Hi Bill,

   Please bring this discussion to Apache 2.0.  I know Brad Nicholes and
   company at Novell
 are working hard to support Apache 2.0.  This implementation will be a far
 more secure and
 stable platform than the 1.3 hybrid/threaded implementations
 (win32/os2/netware etc.)

   If we direct our energies at solving the problem there, and we can agree
   on a mechansim,
 I see this issue being resolved in Apache 2.0.

at this time we cannot discuss anything about NetWare and 2.0 because the NetWare OS 
dependent files are not in CVS tree so we cannot build a 2.0 NetWare version...

Guenter.




Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)

2001-08-27 Thread Brad Nicholes

Guenter,
 About 90% of the NetWare specific changes for the APR layer have been checked 
into CVS.  I am still working on the final 10% (which is usually the hardest).  It may 
not look that way only because we were able to piggy back most of the NetWare code on 
Unix.  This is a good thing for us because it means that we didn't have to rewrite a 
lot of code.  I still have to organize some of the platform specific header files and 
get some of the kinks worked out in the project file, but we are close to having and 
APR layer that should work with the HTTPD server.  In theory as soon as we get APR 
complete, there shouldn't be any additional work necessary to make Apache 2.0 run.  Of 
course a theory is just a theory until it is proven and we won't have the proof until 
APR is complete for NetWare :).

thanks,
Brad

 [EMAIL PROTECTED] Monday, August 27, 2001 10:05:23 AM 
Hi Bill,

   Please bring this discussion to Apache 2.0.  I know Brad Nicholes and
   company at Novell
 are working hard to support Apache 2.0.  This implementation will be a far
 more secure and
 stable platform than the 1.3 hybrid/threaded implementations
 (win32/os2/netware etc.)

   If we direct our energies at solving the problem there, and we can agree
   on a mechansim,
 I see this issue being resolved in Apache 2.0.

at this time we cannot discuss anything about NetWare and 2.0 because the NetWare OS 
dependent files are not in CVS tree so we cannot build a 2.0 NetWare version...

Guenter.