# [patch] build_id implementation

- Thread: https://externals.io/message/42653
- Original archive: https://news-web.php.net/php.internals/42653
- Started by Stanislav Malyshev on 2009-01-16T01:07:31+00:00
- Messages: 4
- 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

---

## #42653 — Stanislav Malyshev — 2009-01-16T01:07:31+00:00

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

Hi!

Attached is the patch implementing build ID. Please comment. If no 
objections are raised I'm going to commit it tomorrow.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #42664 — johannes@php.net — 2009-01-16T17:38:38+00:00

URL: https://externals.io/message/42653#42664 · In reply to: #42653

Hi,

On Thu, 2009-01-15 at 17:07 -0800, Stanislav Malyshev wrote: 
> Index: Zend/zend_modules.h
[...]
> @@ -70,8 +68,7 @@
>  struct _zend_module_entry {
>  	unsigned short size;
>  	unsigned int zend_api;
> -	unsigned char zend_debug;
> -	unsigned char zts;
> +	char *build_id;
>  	const struct _zend_ini_entry *ini_entry;
>  	const struct _zend_module_dep *deps;
>  	const char *name;

If I got it right it will, when loading a 5.3 extension in 5.2, try to
read the extension name from the wrong location and therefor most likely
segfault while generating the error message. (it will also try to read
zend_debug and zts, of course, but there it should be able to safely
read random data)

So I'd like to keep the structure in a way that the offset to the name
pointer is still he same.

johannes

---

## #42666 — Stanislav Malyshev — 2009-01-16T17:45:54+00:00

URL: https://externals.io/message/42653#42666 · In reply to: #42664

Hi!

> If I got it right it will, when loading a 5.3 extension in 5.2, try to
> read the extension name from the wrong location and therefor most likely
> segfault while generating the error message. (it will also try to read
> zend_debug and zts, of course, but there it should be able to safely
> read random data)

Hm, you are right. I guess we'd have to keep the structure intact, 
thanks for noticing it.

-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #42671 — jvlad — 2009-01-17T03:02:27+00:00

URL: https://externals.io/message/42653#42671 · In reply to: #42653

> Hi!
>
> Attached is the patch implementing build ID. Please comment. If no
> objections are raised I'm going to commit it tomorrow.
...
>+ fprintf(stderr, "Cannot load %s - it was build with configuration %s, 
>whereas running engine is %s\n",

Why not to call zend_error instead?
It would make more sense because by default zend_error falls back to the 
output anyway and
honors php.ini settings like error_log, so admins will see the trouble in 
the log if it is set.

-jv
