Re: Procedure for Debugging?

"Matthew Boehm" <[email protected]> Thu, 31 Mar 2005 14:08:26 -0600
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Ben Johnson wrote:

> looks like the app died during a mysql_reconnect().  maybe it does
> this during every ping, but I doubt it.  I think the reason the
> problem is intermittent is that it only happens after your app has
> lost its connection to the database.

    I've got two things here. First, I didn't realize mysql_reconnect was a
real function in the mysql library. I had written my own function for my
module called mysql_reconnect. Shouldn't this have cause some kind of
compiler warning?

    Secondly, yes, this crash is happening after a loss of connection to the
database. I started my app yesterday morning, didn't do anything with it and
this morning I tried to check the status of its connection to mysql and it
segfaulted again.

> What's causing it isn't entirely clear, but it should be fairly easy
> to track down.  my_strcasecomp_8bit() is being passed a pointer

    Here is the code segment from get_charset_number which calls
my_strcasecmp, which then calls my_strcasecomp_8bit:

444          if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) &&
445              !my_strcasecmp(&my_charset_latin1, cs[0]->csname,
charset_name))

    my_strcasecmp is just an alias:

include/m_ctype.h:#define my_strcasecmp(s, a, b)
((s)->coll->strcasecmp((s), (a), (b)))

Somehow, "cs[0]->csname" has a value of 1, which is bad.

Seeing as how my module only calls mysql_ping, I don't see how this segfault
is being cause by my app. Any ideas?

> oh...  btw, you just showed everyone your password, so you better change
it.

    I had changed it and the IP before I posted, so everyone saw a fake one.
;)

Thanks,
Matthew


-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]