List:General Discussion« Previous MessageNext Message »
From:Pooly Date:September 21 2005 5:09pm
Subject:Re: mysql_free_result() & 2 different connections
View as plain text  
Hi,

> It is Linux Slackware 10.1 with MySQL 4.1.4 installed from source... I have
> tested it too (same program and same version of MySQL) with FreeBSD and the
> result is almost the same, the difference is that Linux craches with glib
> message and in FreeBSD just sends a warning that the results have been
> already free...

4.1.4 is beta version, isn't it ? I'll suggest you try the latest
binary for 4.1 available for your setup.

> I suspect that the current version of MySQL frees the resources automatically,

no, it does not :-)

> in FreeBSD the warning was more explicit, it said something like "trying to
> free again a result chunk"... this one performed a single query and a single
> result_free() so there was no place for a mistake...
> 

again, showing _real_ code would help, or a strip-down code that
crashes. The MySQL api does not free ressources automatically, so if
you have the crash on two different system, I would think the bug
comes from your code.

> > That would leave a nice memory leak indeed...
> > eventually, recompile and set a break-point before calling mysql_free,
> > and look at all variables.
> 
> MySQL internal variables? to see the status before? that's a good idea, I will
> do it, thanks for your comments and will post it as soon as I get results :-)
> 

nop, you MYSQL_RES, and it's value. did you set to NULL after freeing
it ? that would help.

> Regards
> 
> P.S.
> I already posted it to bugs.mysql.com but still do not get response
> 

again, I doubt it's a bug in the api, I use various 4.0.x, 4.1.x daily
and several OS and I've never had a crash in it (except from my own
mistakes, non-null terminated query strings, threads messing up,
freeing twice a result, non-allocating of result). the API is pretty
robust :-)

-- 
Pooly
Webzine Rock : http://www.w-fenec.org/
Thread
mysql_free_result() & 2 different connectionsMiguel Cardenas17 Sep
  • Re: mysql_free_result() & 2 different connectionsPooly18 Sep
    • mysql_free_result() CRASHESMiguel Cardenas18 Sep
    • Re: mysql_free_result() & 2 different connectionsMiguel Cardenas20 Sep
      • Re: mysql_free_result() & 2 different connectionsPooly20 Sep
        • Re: mysql_free_result() & 2 different connectionsMiguel Cardenas20 Sep
          • Re: mysql_free_result() & 2 different connectionsPooly20 Sep
            • Re: mysql_free_result() & 2 different connectionsMiguel Cardenas21 Sep
              • Re: mysql_free_result() & 2 different connectionsPooly21 Sep
                • Re: mysql_free_result() & 2 different connectionsMiguel Cardenas22 Sep