You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2009/11/20 12:49:32 UTC

DO NOT REPLY [Bug 48247] New: Apache HTTP server could respond HEAD message under PPC platform when using apr1.3.5

https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

           Summary: Apache HTTP server could respond HEAD message under
                    PPC platform when using apr1.3.5
           Product: APR
           Version: 1.3.5
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: dongliqian@gmail.com


Created an attachment (id=24571)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24571)
The patch file for apr-1.3.5/network_io/sockets.c

Problem description:
The issue occurred when I used Apache HTTP server 2.2.11 and apr1.3.5 under PPC
platform. The Apache HTTP server couldn't respond the HEAD message under
following environment:
1. Apache HTTP server is configured with multiple ports.
2. When compiling APR, with APR_O_NONBLOCK_INHERITED enabled.
3. Apache HTTP server is running on PPC platform.

Root Cause:
After investigation, I found that there is a small bug when accepting a new
conneciton. 
In function apr_socket_accept of file apr-1.3.5/network_io/sockets.c, if the
new socket finds its father socket is in non-blocking mode, it calls
apr_set_option to change the non-blocking mode. However, the function
apr_set_option only changes the value in struct apr_socket_t, and the real
non-blocking mode of the socket has not been modified. So I think we'd better
call function apr_socket_opt_set to set the real non-blocking mode of the new
socket.

Please see attached for the patched file.

Thanks,
Tony

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could not respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

tony dong <do...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Apache HTTP server could    |Apache HTTP server could
                   |respond HEAD message under  |not respond HEAD message
                   |PPC platform when using     |under PPC platform when
                   |apr1.3.5                    |using apr1.3.5

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

tony dong <do...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5
           Platform|Other                       |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could not respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

--- Comment #3 from tony dong <do...@gmail.com> 2010-02-04 00:31:53 UTC ---
Hi Jeff,

Thanks for your attention.
I haven't set it myself. After running cnofigure` command, I found the macro
has been set as 1.
I guess maybe it's because I compiled it on the powerpc platform.
And I still think it's a bug, because the function apr_set_option only set the
flag in the structure apr_socket_t, and the non-blocking mode recorded by
operating system hasn't been modified. I think here we should call function
apr_socket_opt_set to set the non-blocking mode. This function can modify the
real non-blocking mode.

Thanks,
Tony

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could not respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

--- Comment #4 from Jeff Trawick <tr...@apache.org> 2010-02-04 04:37:14 UTC ---
>I haven't set it myself. After running cnofigure` command, I found the macro
>has been set as 1.

Thanks for the clarification.

>I guess maybe it's because I compiled it on the powerpc platform.

Who knows?

>And I still think it's a bug,
Sure; the behavior you see, and comparison with other Linux boxes, indicates
that the macro should have been set to 0 by configure.

> because the function apr_set_option only set the
>flag in the structure apr_socket_t, and the non-blocking mode recorded by
>operating system hasn't been modified.

Note that this logic is controlled by the configure-time detection, so it is
that detection we need to explore.

Work-around:

Set this in your environment before running configure:

 export ac_cv_o_nonblock_inherited="no"

(make sure you run "make distclean" between different build attempts)

Finding the problem:

Look for the message starting with "checking if O_NONBLOCK setting" in your
config.log.  Here's what that section looks like in my Linux build.  Please
post your version.

configure:45431: checking if O_NONBLOCK setting is inherited from listening
sockets
configure:45550: /usr/bin/gcc -m32 -o conftest  -O0 -g -Wall
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread
-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE  conftest.c -lrt
-lcrypt  -lpthread -ldl >&5
conftest.c: In function 'main':
conftest.c:218: warning: implicit declaration of function 'exit'
conftest.c:218: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:220: warning: implicit declaration of function 'memset'
conftest.c:220: warning: incompatible implicit declaration of built-in function
'memset'
conftest.c:229: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:236: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:242: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:247: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:252: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:264: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:270: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:275: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c:279: warning: incompatible implicit declaration of built-in function
'exit'
configure:45553: $? = 0
configure:45559: ./conftest
O_NONBLOCK is not set in the child.
configure:45562: $? = 1

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could not respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

tony dong <do...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P5                          |P2
           Platform|All                         |PC
            Version|1.3.5                       |HEAD
           Severity|critical                    |normal

--- Comment #1 from tony dong <do...@gmail.com> 2010-01-05 23:29:37 UTC ---
Problem description:
The issue occurred when I used Apache HTTP server 2.2.11 and apr1.3.5 under PPC
platform. The Apache HTTP server couldn't respond the HEAD message under
following environment:
1. Apache HTTP server is configured with multiple ports.
2. When compiling APR, with APR_O_NONBLOCK_INHERITED enabled.
3. Apache HTTP server is running on PPC platform.

Root Cause:
After investigation, I found that there is a small bug when accepting a new
conneciton. 
In function apr_socket_accept of file apr-1.3.5/network_io/sockets.c, if the
new socket finds its father socket is in non-blocking mode, it calls
apr_set_option to change the non-blocking mode. However, the function
apr_set_option only changes the value in struct apr_socket_t, and the real
non-blocking mode of the socket has not been modified. So I think we'd better
call function apr_socket_opt_set to set the real non-blocking mode of the new
socket.

Please see attached for the patched file.

Thanks,
Tony

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

tony dong <do...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dongliqian@gmail.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 48247] Apache HTTP server could not respond HEAD message under PPC platform when using apr1.3.5

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48247

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Jeff Trawick <tr...@apache.org> 2010-01-31 07:25:51 UTC ---
What exactly do you mean by 

>2. When compiling APR, with APR_O_NONBLOCK_INHERITED enabled.

Did you set that yourself?  If so, that's invalid.  It isn't intended as a user
setting except in the theoretical exceptional situation where APR configure
doesn't set it properly.

On my 2.6.27-someubuntufoo kernel APR sets it automatically to 0.  I expect it
should have the same setting on any somewhat modern Linux kernel regardless of
architecture.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org