List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 12 1999 11:06pm
Subject:Core whilst using the C API, mysql_select_db
View as plain text  
>>>>> "Steven" == Steven Fletcher <flec@stripped> writes:

Steven> Hi all.
Steven> I encountered an odd problem today. I have a program that's pulling
Steven> information from some Magick (1.4) services databases and inserting the
Steven> info into an SQL server. For the first time in about 10 weeks of use, it
Steven> decided to core on me. I ran a quick GDB check but didn't have chance to
Steven> run a full trace, sadly, before I updated the databases and ran the
Steven> program again, which worked flawlessley.

>> (flec@relic) 07:48:39 (sqlservices) > gdb listnicks
>> GDB is free software and you are welcome to distribute copies of it
>> under certain conditions; type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB; type "show warranty" for details.
>> GDB 4.16 (i386-unknown-freebsd), 
>> Copyright 1996 Free Software Foundation, Inc...(no debugging symbols found)...
>> (gdb) core-file listnicks.core
>> Core was generated by `listnicks'.
>> Program terminated with signal 11, Segmentation fault.
>> Reading symbols from /usr/local/lib/mysql/libmysqlclient.so.7...
>> (no debugging symbols found)...done.
>> Reading symbols from /usr/lib/libc.so.3...(no debugging symbols found)...done.
>> Reading symbols from /usr/lib/libm.so.2...(no debugging symbols found)...done.
>> Reading symbols from /usr/lib/libcrypt.so.2...(no debugging symbols found)...
>> done.
>> Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols found)...
>> done.
>> #0  0x280f8de6 in memcpy ()
>> (gdb) down
>> Bottom (i.e., innermost) frame selected; you cannot go down.
>> (gdb) up
>> #1  0xb in ?? ()
>> (gdb) up
>> #2  0x28084df1 in mysql_select_db ()
>> (gdb) up
>> #3  0x80572eb in listmemos ()
>> (gdb) up
>> #4  0x805bcd1 in listnicks ()
>> (gdb) 

Steven> I can understand then, of course, that somewhere along the line one of
Steven> the databases got corrupted and broke the program for reasons unknown.
Steven> I'm a bit stumped however, because the broken file seemed to break
Steven> memcpy() from within mysql_select_db(), which is what I certainly
Steven> wouldn't expect. If it broke some other part of my program, example
Steven> mysql_query() then I'd understand... but can anyone throw any light on
Steven> the matter here?

Hi!

My guess would be that somehow the MYSQL structure in your client
got trashed by a stray pointer and this crashed your program when
mysql_select_db tried to use it.

Regards,
Monty

PS: Sorry for the long delay before replying, but I just come back from
    a 2 weeks vacation trip.
Thread
Core whilst using the C API, mysql_select_db(Steven Fletcher)22 Oct
  • Re: Core whilst using the C API, mysql_select_dbsinisa22 Oct
  • Core whilst using the C API, mysql_select_dbMichael Widenius13 Nov