Re: c problem (long post)

From: Antonio Julio Lossio Botelho Junior (abotelho@visgraf.impa.br)
Date: Thu Dec 02 1999 - 01:04:25 EST


Adam Chappell wrote:
>
> On Wed, Nov 24, 1999 at 03:46:11PM -0200, Antonio Julio Lossio Botelho Junior wrote:
> > Hello.
> > I'm doing a little C program that access a msql server and
> > a strange thing is happening.
> > Every time I compile the program, it works just fine.
> > Then, time passes and it start aborting for illegal instruction
> > or segmentation fault. All I have to do so it will work
> > back is recompile.
> > Other C programs work fine, and all my program do is connect
> > to msql servers...
>
> Doesn't look very complicated to me and I can't see why
> it wouldn't work unless perhaps the msql server took
> offence in some way to being connected to and then disconnected
> from without any query. Even then, I'd guess your error checking
> would report this.
>
> I think the best thing to do might be to use something like
> 'gdb program-name core-file-name' and the 'bt' command
> to figure out exactly where in your program that the
> problem happened.
>
> Also check you're using the correct versions of the msql
> client library for your server.
>
> -- Adam.

The versions are ok, I think. The client is 2.0.11 and the server is
2.0.3.

The result I got today, running is gdb is this:
------------
Program received signal SIGILL, Illegal instruction.
0x804b004 in readPkt ()
(gdb) where
#0 0x804b004 in readPkt ()
#1 0x8049554 in msqlConnect ()
#2 0x8048d0d in main () at msqltest.c:10
#3 0x4002fcb3 in __libc_start_main (main=0x8048cf0 <main>, argc=1,
argv=0xbffff9b4, init=0x8048958 <_init>, fini=0x804b5ec <_fini>,
    rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff9ac) at
../sysdeps/generic/libc-start.c:78
(gdb)
--------------

Pay attention that this result is random.... friday I got
segmentation fault, today is illegal instruction :-)

One thing the is really strange is the status of the
connections msql open (watch via netstat -a).
I think this problem may be related with the status CLOSE_WAIT.

I don't know... I'm really_really lost here.

Just to be sure, my box is a Red Hat 6.0 with msql 2.0.11.

Thanks in advance.

-- 
[ ], Antonio Julio Botelho
IMPA - Visgraf
abotelho@visgraf.impa.br
-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/



This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:04:03 EST