ID:               28883
 Updated by:       [EMAIL PROTECTED]
 Reported By:      novicky at aarongroup dot cz
-Status:           Assigned
+Status:           Feedback
 Bug Type:         Informix related
 Operating System: *
 PHP Version:      5CVS, 4CVS (2005-02-05)
 Assigned To:      nobbie
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2004-06-22 19:08:12] novicky at aarongroup dot cz

Description:
------------
There is a problem in function ifx_do_close which can lead to crash
during module shutdown.
The function ifx_do_close is called during shutdown from list
destrucors _close_ifx_link and _close_ifx_plink. If something goes
wrong in this function, error reporting is performed and emalloc is
called. Calling emalloc is not possible during memory destruction and
can cause segfault.
It is necessary to remove all error reporting from ifx_do_close (which
is in fact useless).

Here is a patch:

--- ifx.ec.orig 2004-06-01 02:52:14.000000000 +0200
+++ ifx.ec      2004-06-22 18:46:01.000000000 +0200
@@ -295,7 +295,6 @@
        PARAMETER char *link;
 EXEC SQL END DECLARE SECTION;
 {
-       char *ifx_err = NULL;
        TSRMLS_FETCH();
 
        EXEC SQL SET CONNECTION :link;
@@ -310,32 +309,12 @@
                        if (ifx_check() == 0)   {
                                /* DISCONNECT again, after rollback */
                                EXEC SQL DISCONNECT :link;
-                               if (ifx_check() < 0)   {
-                                       IFXG(sv_sqlcode) = SQLCODE;
-                                       php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Disconnect link %s
after Automatic Rollback fails (%s)", link, (ifx_err =
ifx_error(link)));
                                }
-                       }
-                       if (ifx_check() < 0)   {
+                       else if (ifx_check() < 0)   {
                                /* CLOSE database if rollback or disconnect 
fails */
                                EXEC SQL CLOSE DATABASE;
-                               if (ifx_check() < 0)   {
-                                       IFXG(sv_sqlcode) = SQLCODE;
-                                       php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Close database fails
%s (%s)", link, (ifx_err = ifx_error(link)));
-                               }
                        }
                }
-               else if (SQLCODE < 0)   {
-                       IFXG(sv_sqlcode) = SQLCODE;
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect 
link %s
fails (%s)", link, (ifx_err = ifx_error(link)));
-               }
-       }       
-       else   {
-               IFXG(sv_sqlcode) = SQLCODE;
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s 
fails
(%s)", link, (ifx_err = ifx_error(link)));
-       }
-
-       if (ifx_err) {
-               efree(ifx_err);
        }
 }
 





------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28883&edit=1

Reply via email to