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 316120 - [PATCH-UPDATED]Exception Thrown during index of .ppt's
[PATCH-UPDATED]Exception Thrown during index of .ppt's
Status: RESOLVED FIXED
Product: beagle
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Beagle Bugs
Beagle Bugs
: 316616 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-09-12 20:09 UTC by Kevin Kubasik
Modified: 2005-10-28 19:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Attachment mentioned in inital report (481.00 KB, application/vnd.ms-powerpoint)
2005-09-12 20:10 UTC, Kevin Kubasik
  Details
Patch to be applied against gsf-sharp (3.11 KB, patch)
2005-09-21 18:54 UTC, Veerapuram Varadhan
none Details | Review
Patch to be applied againt beagle-HEAD (3.18 KB, patch)
2005-09-21 18:55 UTC, Veerapuram Varadhan
none Details | Review
Patch to be applied againt beagle-HEAD (3.10 KB, patch)
2005-09-21 19:16 UTC, Veerapuram Varadhan
none Details | Review
Changes required in FilterPPT.cs (3.13 KB, patch)
2005-10-28 15:09 UTC, Veerapuram Varadhan
none Details | Review
This fixes the bug in gsf-sharp and the one in b.x.c - 76185 (7.69 KB, patch)
2005-10-28 15:11 UTC, Veerapuram Varadhan
none Details | Review

Description Kevin Kubasik 2005-09-12 20:09:15 UTC
Distribution/Version: Debian Unstable

When beagle attempted to index the attached file, the following exception was
thrown, this is from the CVS build of both Beagel and gsf-sharp at Monday the
12th of Sept

DEBUG: -file:///home/kevin/Documents/APES/Miller 0534-37697-5_Ch01a.ppt
DEBUG: +file:///home/kevin/Documents/APES/Miller 0534-37697-5_Ch01a.ppt
ERROR: Exception occurred duing DoPullProperties.
ERROR: System.NullReferenceException: Object reference not set to an instance of
an object
in <0x00000> <unknown method>
in (wrapper managed-to-native) GLib.Value:g_value_get_string (GLib.Value&)
in <0x0000e> GLib.Value:op_Explicit (Value val)
in <0x00163> Beagle.Filters.FilterPPT:ExtractMetaData (Gsf.Input sumStream,
Gsf.Input docSumStream)
in <0x0011f> Beagle.Filters.FilterPPT:DoPullProperties ()
Comment 1 Kevin Kubasik 2005-09-12 20:10:31 UTC
Created attachment 52142 [details]
Attachment mentioned in inital report
Comment 2 Veerapuram Varadhan 2005-09-20 10:01:01 UTC
Ok, my investigations have showed that this is a bug in the mono-marshaller that
tries to marshall GValue to be a managed-type.

When I use IntPtrs in gsf-sharp in place of (G)Values, it works perfectly fine.

So, I would suggest filing this in mono (or are there any bug already open in
mono/glib-sharp?)
Comment 3 Joe Shaw 2005-09-20 15:58:51 UTC
Varadhan: Can you file the bug against gtk#?  You are probably more qualified to
follow up with the mono developers than the reporter.
Comment 4 Veerapuram Varadhan 2005-09-21 18:47:57 UTC
Joe: Sure, Will do that.

Also, attaching the work-around for the PPT bug. (for the time being, people can
use it for their PPT indexing).

There are two patches, one for gsf-sharp and the other for beagle.
Comment 5 Veerapuram Varadhan 2005-09-21 18:54:24 UTC
Created attachment 52474 [details] [review]
Patch to be applied against gsf-sharp
Comment 6 Veerapuram Varadhan 2005-09-21 18:55:39 UTC
Created attachment 52475 [details] [review]
Patch to be applied againt beagle-HEAD
Comment 7 Veerapuram Varadhan 2005-09-21 19:16:41 UTC
Created attachment 52476 [details] [review]
Patch to be applied againt beagle-HEAD
Comment 8 Joe Shaw 2005-09-27 18:06:40 UTC
*** Bug 316616 has been marked as a duplicate of this bug. ***
Comment 9 Joe Shaw 2005-09-27 18:11:09 UTC
+				if (prop != null) {
+					val = prop.Val;
+					str = prop.ValAsString (val);
+				}

I don't understand why val is necessary.  It seems overly verbose.  It should
either be a static method on DocProp, ie:

   str = DocProp.ValAsString (prop.Val);

or an instance method on DocProp:

   str = prop.ValAsString ();

That'll make the code much easier to read.
Comment 10 Veerapuram Varadhan 2005-09-30 11:24:16 UTC
Ah!! I think you are right.

str = prop.ValAsString() should be fine.

However, it requires a fix in gsf-sharp.  Also, are we going to use IntPtr or
GValue, in gsf-sharp?
Comment 11 Veerapuram Varadhan 2005-10-28 15:09:47 UTC
Created attachment 53995 [details] [review]
Changes required in FilterPPT.cs

Use this patch along with the next one (gsf-sharp).  Both the patches are
required to fix this bug.
Comment 12 Veerapuram Varadhan 2005-10-28 15:11:56 UTC
Created attachment 53996 [details] [review]
This fixes the bug in gsf-sharp and the one in b.x.c - 76185

This patch is required along with the previous one.  This patch applies against
the current SVN Head of gsf-sharp.  

Joe:  I think it would be better to bump the version of gsf-sharp, to avoid
FilterPPT getting crashed for the next beagle release.
Comment 13 Joe Shaw 2005-10-28 17:48:31 UTC
Did you test the setting codepath?  This was the code:

+void
+gsf_doc_prop_glue_set_val (GsfDocProp const* prop, GValue *value)
+{
+	GValue* prop_val;
+	GType type;
+	
+	if (prop == NULL)
+	  return;
+	
+	if (value == NULL || !G_IS_VALUE (value))
+	  return;
+	
+	g_value_init (prop_val, G_VALUE_TYPE (value));
+	g_value_copy (value, prop_val);
+	
+	gsf_doc_prop_set_val (prop, prop_val);
+}

This accesses uninitialized memory, because prop_val points to a random memory
address.  I changed this to do the GValue stuff on the stack instead.  This was
visible in the warning:

gsf-doc-prop-glue.c:63: warning: 'prop_val' is used uninitialized in this function

I've fixed this (and the other warnings) up and committed.
Comment 14 Joe Shaw 2005-10-28 19:33:12 UTC
This is all checked in now.