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 108574 - PATCH: using xmlDocDump is unreliable
PATCH: using xmlDocDump is unreliable
Status: RESOLVED FIXED
Product: GConf
Classification: Deprecated
Component: XML backend
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-03-17 04:05 UTC by Jeffrey Stedfast
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xml-backend.patch (2.11 KB, patch)
2003-03-17 04:05 UTC, Jeffrey Stedfast
none Details | Review

Description Jeffrey Stedfast 2003-03-17 04:05:07 UTC
I had this problem with bonobo-conf in Evolution (thank god we are not
using that anymore) but I just checked GConf and it suffers from the same
problem. libxml's file saving routines are not sufficiently reliable for
user data.

see http://bugzilla.gnome.org/show_bug.cgi?id=108329 for further details
(finally got around to digging into libxml2's src to see if it was still a
problem, and it is...)

attached is a simple patch that works around the bug in libxml
Comment 1 Jeffrey Stedfast 2003-03-17 04:05:37 UTC
Created attachment 15064 [details] [review]
xml-backend.patch
Comment 2 Jeffrey Stedfast 2003-07-25 19:12:05 UTC
*poke* 

users on evolution@ximian.com are starting to rally with their tar and
feathers. we need this reviewed/applied ASAP :-)
Comment 3 Havoc Pennington 2003-07-28 00:20:14 UTC
It looks fine to commit, thanks. My only complaint is this code which 
could at least use a comment justifying it, it looks like "try
everything because we aren't sure how the API really works":

+  if (fflush (fp) != 0)
+    return -1;
+  
+  if ((fd = fileno (fp)) == -1)
+    return -1;
+  
+  if (fsync (fd) == -1)
+    return -1;
Comment 4 Jeffrey Stedfast 2003-07-28 17:28:19 UTC
sure thing. added the following comment:

  /* From the fflush(3) man page:
   *
   * Note that fflush() only flushes the user space buffers provided
by the
   * C library. To ensure that the data is physically stored on disk the
   * kernel buffers must be flushed too, e.g. with sync(2) or fsync(2).
   */

committed to both gnome-2-2 branch and trunk (if we need this to go
into any other branches, lemme know)