After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 551128 - Non-gnome programs that use libgoffice with gnome-support crash on help buttons
Non-gnome programs that use libgoffice with gnome-support crash on help buttons
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
0.6.x
Other All
: Normal critical
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2008-09-06 15:01 UTC by Hib Eris
Modified: 2008-09-14 05:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for libgoffice (776 bytes, patch)
2008-09-06 15:09 UTC, Hib Eris
committed Details | Review
New patch for libgoffice (809 bytes, patch)
2008-09-11 11:55 UTC, Hib Eris
rejected Details | Review

Description Hib Eris 2008-09-06 15:01:14 UTC
Steps to reproduce:
1. Use standard libgoffice (with gnome enabled)
2. Compile gnumeric with the option -without-gnome
3. Run gnumeric, open search and replace dialog with crtl-h and click help button.
4. Crash! 


Stack trace:


Other information:
A patch will follow.
Comment 1 Hib Eris 2008-09-06 15:09:34 UTC
Created attachment 118164 [details] [review]
Patch for libgoffice

The call to gnome_help_display crashes a program if it is not a gnome program.

Libgoffice (with and without gnome support compiled in) should work well with both gnome and non gnome programs. This patch will fix this for the case where gnome_help_display is used.
Comment 2 Jean Bréfort 2008-09-11 08:22:28 UTC
Why do you replace:
#ifdef GOFFICE_WITH_GNOME
...
#elif defined(G_OS_WIN32)
...
#endif

by:
#if defined(G_OS_WIN32)
...
#else
#ifdef GOFFICE_WITH_GNOME
...
#endif
#endif

?
Comment 3 Hib Eris 2008-09-11 11:49:01 UTC
(In reply to comment #2)

I replaced:

#ifdef GOFFICE_WITH_GNOME
...
#elif defined(G_OS_WIN32)
...
#else
  go_gtk_notice_dialog...
#endif
 
by:
#if defined(G_OS_WIN32)
...
#else
#ifdef GOFFICE_WITH_GNOME
  if (gnome_program_get != NULL) {
     ....
     return;
  }
#endif
  go_gtk_notice_dialog...
#endif

Notice the go_gtk_notice_dialog call: through my patch this function is called not only when goffice is compiled _without_ GOFFICE_WITH_GNOME but also when goffice is compiled _with_ GOFFICE_WITH_GNOME while the program using goffice is not a gnome program.
To achieve this I have changed the order of the #if's, #ifdef's and #elif's a bit.

Looking back at this, I see than I have made the assumption that you cannot have a goffice compiled for win32 (defined(G_OS_WIN32)) with gnome support (defined(GOFFICE_WITH_GNOME)). That assumption might be presumptuous. Next patch will correct this.







Comment 4 Hib Eris 2008-09-11 11:55:16 UTC
Created attachment 118516 [details] [review]
New patch for libgoffice

This new patch corrects the presumptuous assumption of my previous patch that you cannot have libgoffice with gnome support compiled in on win32.
Comment 5 Jean Bréfort 2008-09-11 12:55:50 UTC
WITH_GNOME and WIN32 are not compatible. Your first patch is better. Go for it.
Comment 6 Hib Eris 2008-09-11 13:18:17 UTC
(In reply to comment #5)
> WITH_GNOME and WIN32 are not compatible. Your first patch is better. 

Theoretically they could be made compatible in the future I guess. But as it is probably better in the future to remove all gnome use in libgoffice all together, I think it is not worthwhile to patch this with WITH_GNOME and WIN32 compatibility.

So I agree with you that the first patch is better.
 
> Go for it.

Can you (or someone else) commit this for me, I have no SVN commit access.

As this bug causes crashes and data loss in gnumeric and is not very invasive, you might want to commit the patch to the stable branch(es) as well.

Comment 7 Jean Bréfort 2008-09-14 05:49:20 UTC
First patch commited to both branches. Thanks for the report and the fix.