You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2012/03/13 01:22:47 UTC

DO NOT REPLY [Bug 52894] New: Apache aborts abnormally when ChrootDir is set

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

             Bug #: 52894
           Summary: Apache aborts abnormally when ChrootDir is set
           Product: Apache httpd-2
           Version: 2.4.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_unixd
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: tixu@cs.ucsd.edu
    Classification: Unclassified


To replay the abnormal abort, put the following line in httpd.conf:

ChrootDir /home/username/Downloads

note that "username" is the valid user name, so the path is a valid path (make
sure you use a valid path but not "/").

Then, run Apache httpd as root (use "su"), Apache httpd will abort abnormally,
with the following error message in error log:

libgcc_s.so.1 must be installed for pthread_cancel to work

By tracing the source code by gdb, we find that the abort is caused by calling
pthread_exit() in apr_thread_exit() in srclib/apr/threadproc/unix/thread.c
which is called by start_threads() in server/mpm/event/event.c or
server/mpm/worker/worker.c.

The strange thing is that when using the following configuration setting:

ChrootDir /

Everything is fine. The pthread_exit() is also called but it goes smoothly.
Also running without root (i.e., as normal user) won't cause this abort.

We have replayed this on Ubuntu 10.04, Ubuntu 11.10, and Fedora 13, the abort
behavior happened in all these three systems.

Thanks!

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

Tianyin Xu <ti...@cs.ucsd.edu> changed:

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

--- Comment #2 from Tianyin Xu <ti...@cs.ucsd.edu> 2012-03-13 00:40:54 UTC ---
(In reply to comment #1)
> Is there something unreasonable about having that lib in the chroot?

Hi, Eric,

We have the libgcc (otherwise it's no way to build from the source code). The
information is not accurate.

Another thing is that when you configure 

ChrootDir /

It goes through the same routine without any problem. Note that it also calls
pthread_exit() which led to the abort in configuration "ChrootDir /home/user".  

I really have no idea why these two configurations makes the difference.  

Thanks!

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

--- Comment #5 from Eric Covener <co...@gmail.com> 2012-03-13 01:02:38 UTC ---
I recall passing references to it being necessary within the chroot before. 
It's still not clear from your comments whether it's available both in your
root and chroot.  

If it's required, and not present in the chroot, We won't second-guess that the
system wants it there.

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

--- Comment #6 from Tianyin Xu <ti...@cs.ucsd.edu> 2012-03-13 01:55:17 UTC ---
(In reply to comment #5)
> I recall passing references to it being necessary within the chroot before. 
> It's still not clear from your comments whether it's available both in your
> root and chroot.  
> 
> If it's required, and not present in the chroot, We won't second-guess that the
> system wants it there.

Ok, so now I understand the problem.

So basically, 'chroot' is to run a program with a specified root directory. I
changed the root directory to some "dubby" directory (although it's a valid
directory). In the mean time, the dubby directory is not linked with the
libgcc. As a result, when I call the pthread_exit(), it just aborts with the
message to let me install libgcc. 

On the other hand, when I chroot to "/" which is the default root directory,
nothing changed and everything goes smoothly.

I have to say that the system response is really important. The error message
here is kind of misleading...:(

Thanks a lot for your patient, Eric. I do appreciate very much!

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

Eric Covener <co...@gmail.com> changed:

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

--- Comment #1 from Eric Covener <co...@gmail.com> 2012-03-13 00:27:56 UTC ---
Is there something unreasonable about having that lib in the chroot?

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

Eric Covener <co...@gmail.com> changed:

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

--- Comment #3 from Eric Covener <co...@gmail.com> 2012-03-13 00:43:29 UTC ---
(In reply to comment #2)
> (In reply to comment #1)
> > Is there something unreasonable about having that lib in the chroot?
> 
> Hi, Eric,
> 
> We have the libgcc (otherwise it's no way to build from the source code). The
> information is not accurate.
> 
> Another thing is that when you configure 
> 
> ChrootDir /
> 
> It goes through the same routine without any problem. Note that it also calls
> pthread_exit() which led to the abort in configuration "ChrootDir /home/user".  
> 
> I really have no idea why these two configurations makes the difference.  
> 

This is all consistent with it being present and usable in the root and not in
the chroot.

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

--- Comment #4 from Tianyin Xu <ti...@cs.ucsd.edu> 2012-03-13 00:56:21 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > Is there something unreasonable about having that lib in the chroot?
> > 
> > Hi, Eric,
> > 
> > We have the libgcc (otherwise it's no way to build from the source code). The
> > information is not accurate.
> > 
> > Another thing is that when you configure 
> > 
> > ChrootDir /
> > 
> > It goes through the same routine without any problem. Note that it also calls
> > pthread_exit() which led to the abort in configuration "ChrootDir /home/user".  
> > 
> > I really have no idea why these two configurations makes the difference.  
> > 
> 
> This is all consistent with it being present and usable in the root and not in
> the chroot.

Hi, Eric,

Sorry for the bothering. I still don't get it.:( 

Do you mean this is a normal behavior? Could you please explain a little bit
more? Also, do you need more information on this (I see you changed it to
NEEDINFO)?

Thanks a lot for the help!

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52894] Apache aborts abnormally when ChrootDir is set

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

Tianyin Xu <ti...@cs.ucsd.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tixu@cs.ucsd.edu

-- 
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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org