segfault using latest svn tree

Don Zickus dzickus at gmail.com
Sat Jun 13 00:20:59 EDT 2009


On Sat, Jun 6, 2009 at 12:12 PM, Phil Longstaff<plongstaff at rogers.com> wrote:
> Hmmm... I just built from svn using your configure options and had no
> problem. Were there any problems during configure or make? Is it
> reproducible? Can you send a sample data file with the problem?

OK, so I figured out my problem, SWIG_RUNTIME_VERSION was set to a
mixture of "3" and "4", which caused SWIG_TypeQueryModule to not find
any modules, return NULL and blow up when deferenced in
SWIG_MangledTypeQueryModule.  Anyway fixed that.

This leads me to another segfault doing the same thing, but this time
in gnc_html_history_set_node_destroy_cb().  Apparently the variable
'hist' is not a valid pointer.

After reading through gnc_plugin_page_report_create_widget(), it sorta
makes sense because the priv->html->priv pointer is never allocated
any memory.

Now I don't do GTK programming so I could be misunderstanding how the
code works, but in
(sorry for the cut-n-paste)

gnc_plugin_page_report_create_widget():
...
<snip>

        topLvl = GTK_WINDOW(gnc_ui_get_toplevel());
//        priv->html = gnc_html_new( topLvl );
	priv->html = gnc_html_factory_create_html(); <<<<<<New G_OBJ created here
=========
struct _GncHtmlGtkhtml {
	GncHtml parent_instance;

	/*< private >*/
	GncHtmlGtkhtmlPrivate* priv;
};
But 'priv' is a pointer and still needs memory?
=========
		gnc_html_set_parent( priv->html, topLvl );  <<<<<Not interesting

        gnc_html_history_set_node_destroy_cb(gnc_html_get_history(priv->html),
>>>>>gnc_html_get_history() basically does a priv->html->priv->history
>>>>>but I don't see where priv->html->priv is initialized or even 'history' for that matter??


gnc_plugin_page_report_history_destroy_cb,
                                             (gpointer)priv);

As a result the first call in gnc_html_history_set_node_destroy_cb()
is hist->destroy_cb = cb; which blows up.  From what I can read
priv->html->priv and priv->html->priv->history are never initialized,
so who knows what memory they are coming from which would explain my
segfaults.

I would try to allocate the memory to prove if it works or not, but I
am not smart enough to figure out how to properly allocate that
memory.  It looks to abstract and complicated for my tiny brain. :-(

Help?

Cheers,
Don


More information about the gnucash-devel mailing list