Re: [gnome-db] libgda: problem with plugin_get_dsn_spec function.



On Fri, 2005-06-24 at 15:40 +1000, Bas Driessen wrote:
On Thu, 2005-06-23 at 23:06 +1000, Bas Driessen wrote:
Hello Vivien,

Haven't updated my libgda sources for a couple of weeks and am having problems getting my projects to work with the latest libgda cvs sources. A couple of weeks ago you put the following code in libgda/libgda/gda-config.c in function gda_config_get_provider_list:


                        if (plugin_get_dsn_spec != NULL)
                                info->dsn_spec = plugin_get_dsn_spec ();
                        else
                                info->dsn_spec = NULL;

This compiles fine, but at run-time my application falls over (segmentation violation) the 2nd line in the snippet above. If I set info->dsn_spec = NULL there, all appears to work fine. So my question is, what does that line do?

In my case it calls the function plugin_get_dsn_spec in providers/mysql/libmain.c There all processes OK, but it falls over the "return specs" line.

Any ideas?


Did look further into this problem. I have attached a small c application, based on the example (which is missing btw) c code in the manual. This application crashes (segm. violation) on the line:

gda_config_get_provider_list ()

The trace goes back to the area outlined in the previous e-mail. I would like to know if more people are having problems with this. I am using Fedora Core 4 (GCC 4.0)

To compile this small app, type:

gcc libgda_crash.c -o libgda_crash `pkg-config --cflags --libs libgda-2.0`

Use the latest CVS source, make sure that your PKG_CONFIG_PATH is set to the lib/pkgconfig directory where libgda is installed. Also set LD_LIBRARY_PATH to the lib directory where the libgda libs are located, so you can run this.

This proofs that the crash is not related to my projects. Will try to locate the problem, but if somebody has some ideas of what is happening, please let me know.

This issue has been resolved. In provider functions "plugin_get_dsn_spec" a "function g_file_get_contents" is called. The argument size of that function has to be of type gsize rather than gint. Even though the i386 did not make an issue out of it, x86_64 is very picky about using the correct data types. This has been corrected in libgda in CVS HEAD.

Thanks,
Bas.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]