You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Nick Kew <ni...@webthing.com> on 2007/02/03 10:48:04 UTC

apr_file operations returning system errno as apr_status_t

Someone on IRC #apache just reported a stupid error message:

    (20014)Error string not specified yet: Error retrieving pid
   file /var/run/apache2.pid

I took a look at what could be causing it, and it appears to
be down to apr_file_* functions returning an old-fashioned
system errno as an apr_status_t value.  I haven't reproduced
the user's reported error, but it comes from either
apr_file_open or apr_file_read (via apr_file_read_full).

Not sure how best to tackle this.  Is there some reasoning
behind what errno numbers can be returned here?

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Re: apr_file operations returning system errno as apr_status_t

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Justin Erenkrantz wrote:
> On 2/4/07, Garrett Rooney <ro...@electricjellyfish.net> wrote:
>> I was under the impression that apr_status_t is a superset of errno,
>> so returning the current errno should be perfectly fine...
> 
> It is.  -- justin

Sort of.  Posix errno's.  Other platforms need to munge their values
with apr_get_os_error/apr_set_os_error.  (Hmmm - it seems long past
time to rename these apr_os_error_get/apr_os_error_set.)

Other ranges are reserved for other errors ... getaddr results, and
dlerror results.

It gets complex - maybe some invocation of apr-config aught to spell out
what ranges have been mapped to what?

Bill

Re: apr_file operations returning system errno as apr_status_t

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 2/4/07, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> I was under the impression that apr_status_t is a superset of errno,
> so returning the current errno should be perfectly fine...

It is.  -- justin

Re: apr_file operations returning system errno as apr_status_t

Posted by Nick Kew <ni...@webthing.com>.
On Sun, 4 Feb 2007 00:07:22 +0100
"Garrett Rooney" <ro...@electricjellyfish.net> wrote:

> On 2/3/07, Nick Kew <ni...@webthing.com> wrote:
> > Someone on IRC #apache just reported a stupid error message:
> >
> >     (20014)Error string not specified yet: Error retrieving pid
> >    file /var/run/apache2.pid
> >
> > I took a look at what could be causing it, and it appears to
> > be down to apr_file_* functions returning an old-fashioned
> > system errno as an apr_status_t value.  I haven't reproduced
> > the user's reported error, but it comes from either
> > apr_file_open or apr_file_read (via apr_file_read_full).
> >
> > Not sure how best to tackle this.  Is there some reasoning
> > behind what errno numbers can be returned here?
> 
> I was under the impression that apr_status_t is a superset of errno,
> so returning the current errno should be perfectly fine...

Nevertheless, the outcome (nonsense in place of an error message)
is disturbing.  That string comes from apr_error_string(), which
should only happen for numbers in the range above APR_OS_START_ERROR
where these strings are defined.

Smells of bug to me, though it could of course be a build bug.

FWIW, this error looks like APR_EGENERAL offset from the wrong base.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Re: apr_file operations returning system errno as apr_status_t

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 2/3/07, Nick Kew <ni...@webthing.com> wrote:
> Someone on IRC #apache just reported a stupid error message:
>
>     (20014)Error string not specified yet: Error retrieving pid
>    file /var/run/apache2.pid
>
> I took a look at what could be causing it, and it appears to
> be down to apr_file_* functions returning an old-fashioned
> system errno as an apr_status_t value.  I haven't reproduced
> the user's reported error, but it comes from either
> apr_file_open or apr_file_read (via apr_file_read_full).
>
> Not sure how best to tackle this.  Is there some reasoning
> behind what errno numbers can be returned here?

I was under the impression that apr_status_t is a superset of errno,
so returning the current errno should be perfectly fine...

-garrett

Re: apr_file operations returning system errno as apr_status_t

Posted by Jeff Trawick <tr...@gmail.com>.
On 2/3/07, Nick Kew <ni...@webthing.com> wrote:
> Someone on IRC #apache just reported a stupid error message:
>
>     (20014)Error string not specified yet: Error retrieving pid
>    file /var/run/apache2.pid

20014 is APR_EGENERAL

I suspect that this is from httpd/server/log.c:read_pid() returning
APR_EGENERAL, rather than some apr function returning it.

create an empty pid file and try "apachectl stop"