On Wed, Nov 08, 2006 at 01:48:13PM +0900, Thang Nguyen wrote: > Im having a problem in my app. Im wondering that it is due to a > confliction between apr and glibc. If not, the fault is mine. > > My app is using multi-threading fastcgi, mysqlpp for db. I used pthread > for creating threads before, but apr_thread has a nice resource list, so > i changed to apr_thread. Im using apr_reslist for creating (mysqlpp) > connection pool in my app. > > The "double free or corruption" problem occurred just after my app has > finished. In the whole app, it has no problem at all. If i didnt use > create_pool() to create a (apr_hash of) apr_reslist, the problem > disappeared. So, i guess the problem is due to the process of freeing > the apr_reslist_t(s) or terminating the (apr) app.
Two helpful tricks when tracking down this kind of issue are: 1) rebuild your application against an APR configured using --enable-pool-debug; this will help highlight pool issues faster 2) run your application with the following environment variable set: export MALLOC_CHECK_=2 (note the careful placement of the underscores) this will mean glibc will do extra heap checking and will abort() sooner when any heap corruption is noticed. joe
