# Fix for bug #25543

- Thread: https://externals.io/message/4659
- Original archive: https://news-web.php.net/php.internals/4659
- Started by Moriyoshi Koizumi on 2003-10-03T00:32:24+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

---

## #4659 — Moriyoshi Koizumi — 2003-10-03T00:32:24+00:00

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

Hi,

Attached is a fix for bug #25543 (Error in `set_error_handler()` definition), 
which is caused by disordered scheduling of the garbage collection 
(zend_clean_garbage()).

With this patch I'm adding the following two inline functions, 
zend_begin_atomic() and zend_end_atomic(), to prevent GC from being 
performed at the right time. Calls to those functions are inserted 
at the beginning / end of zend_fetch_dimension_address(), 
zend_fetch_property_address(), and some other functions of the same kind.

I'll commit these shortly if you don't see any problem.

Regards,

Moriyoshi

---

## #4660 — Jani Taskinen — 2003-10-03T05:43:08+00:00

URL: https://externals.io/message/4659#4660 · In reply to: #4659

#25543 is documentation 'bug', what exactly does your
    patch fix? I don't see anything wrong with `set_error_handler()`..
    
    --Jani
    



>Hi,
>
>Attached is a fix for bug #25543 (Error in `set_error_handler()` definition), 
>which is caused by disordered scheduling of the garbage collection 
>(zend_clean_garbage()).
>
>With this patch I'm adding the following two inline functions, 
>zend_begin_atomic() and zend_end_atomic(), to prevent GC from being 
>performed at the right time. Calls to those functions are inserted 
>at the beginning / end of zend_fetch_dimension_address(), 
>zend_fetch_property_address(), and some other functions of the same kind.
>
>I'll commit these shortly if you don't see any problem.
>
>Regards,
>
>Moriyoshi

---

## #4661 — r.willenbacher — 2003-10-03T12:17:56+00:00

URL: https://externals.io/message/4659#4661 · In reply to: #4660

>     #25543 is documentation 'bug', what exactly does your
>     patch fix? I don't see anything wrong with `set_error_handler()`..
>
>     --Jani
>
> 
> > […]

as the patch filenames suggest he meant to fix bug
#25547 (error_handler and array index with function call).

-- 
ralf willenbacher (bj@ocrana.de)

---

## #4668 — Andi Gutmans — 2003-10-04T00:03:21+00:00

URL: https://externals.io/message/4659#4668 · In reply to: #4659

Hi,

I don't like this patch because already the gc is a very sensitive 
mechanism and we're not allowed to collect too much or too little at any 
given time. Your patch can easily lead to too much being collected before 
previous zval's are freed which can lead to problems (this mechanism was 
refined a couple of times due to such problems).
The only real solution I can see is to nuke the garbage completely. I 
already have a rough idea of how to do it but it requires quite a lot of work.
BTW, I didn't quite understand the bug report 25543. It doesn't seem to be 
very well written (I know it's not you :)

Andi

At 09:32 AM 10/3/2003 +0900, Moriyoshi Koizumi wrote:
>Hi,
>
>Attached is a fix for bug #25543 (Error in `set_error_handler()` definition),
>which is caused by disordered scheduling of the garbage collection
>(zend_clean_garbage()).
>
>With this patch I'm adding the following two inline functions,
>zend_begin_atomic() and zend_end_atomic(), to prevent GC from being
>performed at the right time. Calls to those functions are inserted
>at the beginning / end of zend_fetch_dimension_address(),
>zend_fetch_property_address(), and some other functions of the same kind.
>
>I'll commit these shortly if you don't see any problem.
>
>Regards,
>
>Moriyoshi
