Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10879 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51676 invoked by uid 1010); 2 Jul 2004 21:53:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51569 invoked from network); 2 Jul 2004 21:53:37 -0000 Received: from unknown (HELO distance.intux.org) (213.239.198.8) by pb1.pair.com with SMTP; 2 Jul 2004 21:53:37 -0000 Received: (qmail 26184 invoked from network); 2 Jul 2004 21:48:28 -0000 Received: from unknown (HELO saiwala) (intux?org?fschaper@82.82.156.169) by distance.intux.org with SMTP; 2 Jul 2004 21:48:28 -0000 Message-ID: <014e01c4607e$c40f0140$9d00a8c0@saiwala> To: Cc: , "Marcus Boerger" Date: Fri, 2 Jul 2004 23:51:44 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_014B_01C4608F.875522F0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: [PATCH] destructors called after module shutdown From: fschaper@intux.org ("Florian Schaper") ------=_NextPart_000_014B_01C4608F.875522F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Currently object's destructors are called in the zend_deactivate function in main.c after the modules request_shutdown_func has been called (main.c - php_call_shutdown_functions(void); ) . Since no code should be executed after module request shutdown unexpected behaviour might occur like the one descibed in bug#27555 affecting the session extension. Maybe somebody can take a look. ./regards Florian get("test1","testval"); $oSes->add("test1","testval"); ?> ------=_NextPart_000_014B_01C4608F.875522F0 Content-Type: text/plain; name="destructors.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="destructors.patch.txt" Index: ZendEngine2/zend.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend.c,v=0A= retrieving revision 1.285=0A= diff -u -r1.285 zend.c=0A= --- ZendEngine2/zend.c 1 Jun 2004 11:45:46 -0000 1.285=0A= +++ ZendEngine2/zend.c 2 Jul 2004 18:32:10 -0000=0A= @@ -805,6 +805,13 @@=0A= } zend_end_try();=0A= }=0A= =0A= +void zend_call_destructors(TSRMLS_D)=20 +{ + zend_try { + shutdown_destructors(TSRMLS_C); + } zend_end_try(); +}=0A= +=0A= void zend_deactivate(TSRMLS_D)=0A= {=0A= /* we're no longer executing anything */=0A= Index: ZendEngine2/zend.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend.h,v=0A= retrieving revision 1.255=0A= diff -u -r1.255 zend.h=0A= --- ZendEngine2/zend.h 7 Jun 2004 18:57:34 -0000 1.255=0A= +++ ZendEngine2/zend.h 2 Jul 2004 18:32:11 -0000=0A= @@ -450,6 +450,7 @@=0A= =0A= void zend_activate(TSRMLS_D);=0A= void zend_deactivate(TSRMLS_D);=0A= +void zend_call_destructors(TSRMLS_D); void zend_activate_modules(TSRMLS_D);=0A= void zend_deactivate_modules(TSRMLS_D);=0A= void zend_post_deactivate_modules(TSRMLS_D);=0A= Index: ZendEngine2/zend_execute.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_execute.h,v=0A= retrieving revision 1.72=0A= diff -u -r1.72 zend_execute.h=0A= --- ZendEngine2/zend_execute.h 16 Mar 2004 10:14:52 -0000 1.72=0A= +++ ZendEngine2/zend_execute.h 2 Jul 2004 18:32:11 -0000=0A= @@ -49,6 +49,7 @@=0A= =0A= void init_executor(TSRMLS_D);=0A= void shutdown_executor(TSRMLS_D);=0A= +void shutdown_destructors(TSRMLS_D);=0A= ZEND_API void execute(zend_op_array *op_array TSRMLS_DC);=0A= ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int = return_value_used TSRMLS_DC);=0A= ZEND_API int zend_is_true(zval *op);=0A= Index: ZendEngine2/zend_execute_API.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_execute_API.c,v=0A= retrieving revision 1.287=0A= diff -u -r1.287 zend_execute_API.c=0A= --- ZendEngine2/zend_execute_API.c 18 May 2004 20:14:54 -0000 1.287=0A= +++ ZendEngine2/zend_execute_API.c 2 Jul 2004 18:32:11 -0000=0A= @@ -187,6 +187,12 @@=0A= EG(float_separator)[0] =3D '.';=0A= }=0A= =0A= +void shutdown_destructors(TSRMLS_D) { + zend_try { + zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC); + } zend_end_try(); +}=0A= +=0A= void shutdown_executor(TSRMLS_D)=0A= {=0A= zend_try {=0A= @@ -206,7 +212,6 @@=0A= }=0A= */=0A= zend_llist_apply(&zend_extensions, (llist_apply_func_t) = zend_extension_deactivator TSRMLS_CC);=0A= - zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);=0A= zend_hash_graceful_reverse_destroy(&EG(symbol_table));=0A= } zend_end_try();=0A= =0A= Index: main/main.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/main/main.c,v=0A= retrieving revision 1.604=0A= diff -u -r1.604 main.c=0A= --- main/main.c 28 May 2004 14:14:26 -0000 1.604=0A= +++ main/main.c 2 Jul 2004 18:32:16 -0000=0A= @@ -1190,6 +1190,10 @@=0A= sapi_send_headers(TSRMLS_C);=0A= } zend_end_try();=0A= =0A= + zend_try { + zend_call_destructors(TSRMLS_C); + } zend_end_try();=0A= +=0A= if (PG(modules_activated)) zend_try {=0A= php_call_shutdown_functions();=0A= } zend_end_try();=0A= ------=_NextPart_000_014B_01C4608F.875522F0--