# Module shutdown order again

- Thread: https://externals.io/message/68551
- Original archive: https://news-web.php.net/php.internals/68551
- Started by Rasmus Lerdorf on 2013-08-17T11:37:30+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #68551 — Rasmus Lerdorf — 2013-08-17T11:37:30+00:00

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

Looking at https://bugs.php.net/bug.php?id=65463

My brain is foggy on why we call zend_destroy_modules() before
zend_hash_destroy(GLOBAL_CLASS_TABLE) in zend_shutdown(). Anyone
remember the reason?

I have verified the issue described in 65463. On a `SIGTERM` to Apache
mid-request, the extension ends up getting unloaded before the global
class table is destroyed causing the segfault described in the bug.

-Rasmus

---

## #68553 — Jan Ehrhardt — 2013-08-17T21:24:13+00:00

URL: https://externals.io/message/68551#68553 · In reply to: #68551

Rasmus Lerdorf in php.internals (Sat, 17 Aug 2013 07:37:30 -0400):
>Looking at https://bugs.php.net/bug.php?id=65463

When I saw the subject, I was reminded of
https://bugs.php.net/bug.php?id=65338

That was another case of unorderly unloading modules. I thought it was a
bug in zend_string.c, but Dmitry solved it by patching opcache.

Disregard this message if it is not related at all.

Jan
