From: Michael R. <re...@eu...> - 2004-03-08 10:27:20
|
Hi Javi, > I've installed gdb and these are the results: >=20 > # gdb --args lcd4linux -Fq > GNU gdb 6.0 > Copyright 2003 Free Software Foundation, Inc. > (gdb) run > Starting program: /home/javi/programacion/lcd4linux/lcd4linux -Fqf >=20 > Program received signal SIGSEGV, Segmentation fault. > 0x40020995 in mysql_init () from /usr/lib/libmysqlclient.so.12 > (gdb) bt > #0 0x40020995 in mysql_init () from /usr/lib/libmysqlclient.so.12 > The problem seems to be the mysql_init () function, from /usr/lib/libmy= sqlclient.so.12 You are right. Strange.... I know nothing about MySQL, but the following from your code looks=20 strange to me: MYSQL *conex; mysql_init(conex); conex seems to be something like a 'Context'. As it is a pointer, it=20 points to nowhere, and no memory is allocated for the data structure. Maybe this should be: MYSQL conex; mysql_init(&conex); Note that here the structure is allocated on the stack, and the address=20 is passed to mysql_init(). > =BFIs there something I can do? or is better I forgets the plugin and w= ait untill the "exec" plugin is ported to the NextGen. No, I don't want you to forget this plugin. This looks cool! I think=20 there are a lot of uses for such a database plugin! What would be even cooler are some status informations from MySQL. Any=20 ideas where to get them from? But I see another problem here, same as with the (not yet ported, for=20 exactly this reason) mail plugin: These plugins can take some time to=20 deliver a result (if, for example, the query is quite complicated, or=20 lots of rows are affected; or if the mailbox must be polled via a slow=20 internet connection). This would distrub lcd4linux's quite tight timings. Such plugins should work asynchronously. Which in turn is quite complex=20 to implement. The plugin should fork() on initialization, the child=20 would be responsible for fetching the data, the parent takes the results=20 via shared memory (and locked by a mutex) and delivers them to the=20 evaluator. Or is there another (probably easier) way to achieve this? Anyone out there with experience with such things? bye, Michael --=20 Michael Reinelt Tel: +43 676 3079941 Geisslergasse 4 Fax: +43 316 692343 A-8045 Graz, Austria e-mail: re...@eu... |