# Fatal error 'Unable to read from thread kernel pipe' when using mail function

- Thread: https://externals.io/message/21263
- Original archive: https://news-web.php.net/php.internals/21263
- Started by Stut on 2005-12-17T15:33:47+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #21263 — Stut — 2005-12-17T15:33:47+00:00

URL: https://externals.io/message/21263#21263

I hope this gets through - the subscription confirmation email seems
to be taking its time to get to me but I can't afford to wait. I would
appreciate it if responses could be CC'd to me to ensure I get them.

I've googled and also asked this question on the php-general list but
have had no responses. Hopefully the gurus on this list will be able
to help.

I've just upgraded the PHP installation on my server to v4.4.1 and
the mail function has stopped working. I created a script that simply
calls the mail function to send a test email ad this is what I get when
I run it...

stut@brian:~$ php test.php
Fatal error 'Unable to read from thread kernel pipe' at line 1100 in
file /usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0)
Abort trap (core dumped)

The email gets sent successfully on the CLI despite crashing. When the
mail function is called from a web page it never gets sent and the
script never finishes.

I've googled for this error and all references I found that related to
PHP basically say that it's due to Apache and PHP being compiled in
different threading modes. This cannot be the case in this instance
since Apache is using the prefork MPM and even if it wasn't it's
happening on the CLI where Apache is not involved.

I've tried rebuilding Apache WITHOUT_THREADS and then rebuilding PHP
but this made no difference.

Any clues people might have as to the cause of this problem would be
gratefully received.

FYI: Environment is FreeBSD 5.2, Apache 2.0 and Postfix.

Cheers.

-Stut

---

## #21264 — Jani Taskinen — 2005-12-17T15:37:01+00:00

URL: https://externals.io/message/21263#21264 · In reply to: #21263

You need to use the prefork MPM within Apache2.
     Rebuilding apache like that propably wont make any difference.
     And you really need to reconfigure and recompile PHP after that.

     --Jani




>
> I hope this gets through - the subscription confirmation email seems
> to be taking its time to get to me but I can't afford to wait. I would
> appreciate it if responses could be CC'd to me to ensure I get them.
>
> I've googled and also asked this question on the php-general list but
> have had no responses. Hopefully the gurus on this list will be able
> to help.
>
> I've just upgraded the PHP installation on my server to v4.4.1 and
> the mail function has stopped working. I created a script that simply
> calls the mail function to send a test email ad this is what I get when
> I run it...
>
> stut@brian:~$ php test.php
> Fatal error 'Unable to read from thread kernel pipe' at line 1100 in
> file /usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0)
> Abort trap (core dumped)
>
> The email gets sent successfully on the CLI despite crashing. When the
> mail function is called from a web page it never gets sent and the
> script never finishes.
>
> I've googled for this error and all references I found that related to
> PHP basically say that it's due to Apache and PHP being compiled in
> different threading modes. This cannot be the case in this instance
> since Apache is using the prefork MPM and even if it wasn't it's
> happening on the CLI where Apache is not involved.
>
> I've tried rebuilding Apache WITHOUT_THREADS and then rebuilding PHP
> but this made no difference.
>
> Any clues people might have as to the cause of this problem would be
> gratefully received.
>
> FYI: Environment is FreeBSD 5.2, Apache 2.0 and Postfix.
>
> Cheers.
>
> -Stut
>
>

-- 
Give me your money at @ <http://pecl.php.net/wishlist.php/sniper>
Donating money may make me happier and friendlier for a limited period!
Death to all 4 letter abbreviations starting with P!

---

## #21268 — Stut — 2005-12-17T15:47:44+00:00

URL: https://externals.io/message/21263#21268 · In reply to: #21264

As far as I can tell it is using the prefork MPM since I believe this
is the default option for building it with the FreeBSD port. How can I
tell for sure?

Thanks.

-Stut


>
>      You need to use the prefork MPM within Apache2.
>      Rebuilding apache like that propably wont make any difference.
>      And you really need to reconfigure and recompile PHP after that.
>
>      --Jani
>
>
> 
>
> > […]
>
> --
> Give me your money at @ <http://pecl.php.net/wishlist.php/sniper>
> Donating money may make me happier and friendlier for a limited period!
> Death to all 4 letter abbreviations starting with P!

---

## #21265 — Stut — 2005-12-17T16:48:16+00:00

URL: https://externals.io/message/21263#21265 · In reply to: #21264

Ok, I've rebuilt Apache2 forcing the prefork MPM option. I then
rebuilt PHP4 and all the extensions. It's still doing it. What other
possible causes are there?

I did read in the results Google gave me that if the Apache2 MPM is
the problem then anything that pipes out to a system call will fail,
but I can use system and passthru without any issues. I'm fairly
certain it's not related to Apache2.

-Stut


>
>      You need to use the prefork MPM within Apache2.
>      Rebuilding apache like that propably wont make any difference.
>      And you really need to reconfigure and recompile PHP after that.
>
>      --Jani
>
>
> 
>
> > […]
>
> --
> Give me your money at @ <http://pecl.php.net/wishlist.php/sniper>
> Donating money may make me happier and friendlier for a limited period!
> Death to all 4 letter abbreviations starting with P!

---

## #21266 — Wez Furlong — 2005-12-17T18:17:34+00:00

URL: https://externals.io/message/21263#21266 · In reply to: #21265

I'd suggest using gdb to get a backtrace.
It sounds like your libc is broken to me.

Oh, wait, you're running FreeBSD 5.  That's broken.  Use 4 or 6.

--Wez.


> Ok, I've rebuilt Apache2 forcing the prefork MPM option. I then
> rebuilt PHP4 and all the extensions. It's still doing it. What other
> possible causes are there?
>
> I did read in the results Google gave me that if the Apache2 MPM is
> the problem then anything that pipes out to a system call will fail,
> but I can use system and passthru without any issues. I'm fairly
> certain it's not related to Apache2.
>
> -Stut
>
> 
> > […]
