Bonsoir,

J'aurais une question concernant un petit souci que je rencontre depuis hier soir maintenant. Je développe
une application en C sous Debian Etch. Elle se compose de deux modules que j'ai développé séparément :

- Un premier qui vérifie le résultat d'une requête HTTP et qui autorise ou non la poursuite de l'exécution
de l'applicatif

- Un second qui se connecte à une base de données et fait son méli-mélo d'actions.

Mon souci a commencé lorsque j'ai souhaité assembler ces deux modules. J'ai réussi à faire des librairies,
à faire mes fichiers d'entête, à les intégrer à mon programme principal et à utiliser les fonctions. Aucune
erreur ni avertissement ne s'affiche lors de la compilation de mon programme.

Seulement voilà, lors de son exécution, j'obtiens un "Segmentation Fault". J'ai trouvé sur Internet comment
faire pour débugger une application en C et j'ai trouvé l'outil gdb. J'ai réussi à sortir ces informations :

ns1:/usr/src/# gdb poller
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) r
Starting program: /usr/src//poller
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1212082496 (LWP 11601)]
Checking licence... This may take some seconds...
Licence check : Ok.
Initialisation du client MySQL...
Initialisé.
Définition de l'environnement du client MySQL...
Définit.
Connexion au serveur MySQL...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212082496 (LWP 11601)]
0xb7d0772d in free () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb7d0772d in free () from /lib/tls/i686/cmov/libc.so.6
#1 0xb7e1adf1 in my_no_flags_free () from /usr/lib/libmysqlclient.so.15
#2 0xb7e3ed8c in mysql_real_query () from /usr/lib/libmysqlclient.so.15
#3 0xb7e413a8 in mysql_real_connect () from /usr/lib/libmysqlclient.so.15
#4 0x08048fda in main () at poller.c:50
(gdb) frame 0
#0 0xb7d0772d in free () from /lib/tls/i686/cmov/libc.so.6
(gdb) frame 1
#1 0xb7e1adf1 in my_no_flags_free () from /usr/lib/libmysqlclient.so.15
(gdb) frame 2
#2 0xb7e3ed8c in mysql_real_query () from /usr/lib/libmysqlclient.so.15
(gdb) frame 3
#3 0xb7e413a8 in mysql_real_connect () from /usr/lib/libmysqlclient.so.15
(gdb) frame 4
#4 0x08048fda in main () at poller.c:50
50 if (!mysql_real_connect(MySQL_Link, MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_BASE, 0, NULL, 0)) {
Pour information, je vous ai mis à disposition les fichiers sources :

poller.c http://pastebin.deus-rulez.com/pastebin.php?show=10
deb_licence.c http://pastebin.deus-rulez.com/pastebin.php?show=11

Ainsi qu'un petit package global du projet (il n'y a pas grand chose) : http://www.deus-rulez.com/c_bugs.tar.gz

Auriez vous une idée de solution ? J'ai cherché sur Internet et je n'ai trouvé aucune information.

Merci par avance pour vos lumières,

Havran

PS : gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)