apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53533] New: Apache crash when call dbd_mysql_select() and dbd_mysql_get_row() with different pool
Date Wed, 11 Jul 2012 08:12:38 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53533

          Priority: P2
            Bug ID: 53533
          Assignee: bugs@apr.apache.org
           Summary: Apache crash when call dbd_mysql_select() and
                    dbd_mysql_get_row() with different pool
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: arthur.echo@gmail.com
          Hardware: PC
            Status: NEW
           Version: 1.4.1
         Component: APR-util
           Product: APR

My project cannot call apr_dbd_get_row() without clearing up the pool when
export a plenty of data from MySQL because the APR memory pool is not a GC and
the data size is larger than physical memory.

As a work around, I call apr_dbd_select() with the request_rec->pool, and then
call apr_dbd_get_row() with a subpool of request_rec->pool in a for loop. I
always clear the subpool after every thousand rows fetched. Unfortunately, the
last call apr_dbd_get_row() ways makes the httpd segment fault. Because when
there is no data left, the mysql driver will call apr_pool_cleanup_run() on the
subpool. Obviously, that is incorrect.

--- dbd/apr_dbd_mysql.c    2012-07-11 15:42:49.193079005 +0800
+++ dbd/apr_dbd_mysql_new.c    2012-07-11 15:50:52.593079004 +0800
@@ -325,7 +325,7 @@
         (*row)->len = mysql_fetch_lengths(res->res);
     }
     else {
-        apr_pool_cleanup_run(pool, res->res, free_result);
+        apr_pool_cleanup_run(res->pool, res->res, free_result);
     }
     return ret;
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message