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

Bug#597231: unblock glib2.0/2.24.2-1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: freeze-exception

Please unblock glib2.0 for squeeze.

glib2.0 (2.24.2-1) unstable; urgency=low

  * Drop type-handling usage. Closes: #587863.
  * Bump standards version accordingly.
  * Ship gio-querymodules in a versioned directory.
  * Run it on installation, not only when triggered.
  * Purge the modules cache in the postrm.
  * New upstream bugfix release.
    + Works around the race condition in gtester that causes random 
      FTBFSes.

Note that I’m not sure of the last changelog entry, since the powerpc
build failed :/ 

I’m attaching the diff for source files.

Cheers,
-- 
 .''`.      Josselin Mouette
: :' :
`. `'  “If you behave this way because you are blackmailed by someone,
  `-    […] I will see what I can do for you.”  -- Jörg Schilling

--- glib-2.24.1/gio/gconverteroutputstream.c	2010-04-13 13:33:15.000000000 +0000
+++ glib-2.24.2/gio/gconverteroutputstream.c	2010-08-08 14:47:15.000000000 +0000
@@ -418,12 +418,16 @@
   converted_bytes = 0;
   while (!priv->finished && converted_bytes < to_convert_size)
     {
+      /* Ensure we have *some* target space */
+      if (buffer_tailspace (&priv->converted_buffer) == 0)
+	grow_buffer (&priv->converted_buffer);
+
       /* Try to convert to our buffer */
       my_error = NULL;
       res = g_converter_convert (priv->converter,
 				 to_convert + converted_bytes,
 				 to_convert_size - converted_bytes,
-				 buffer_data (&priv->converted_buffer),
+				 buffer_data (&priv->converted_buffer) + buffer_available (&priv->converted_buffer),
 				 buffer_tailspace (&priv->converted_buffer),
 				 0,
 				 &bytes_read,
@@ -529,12 +533,16 @@
   flushed = FALSE;
   while (!priv->finished && !flushed)
     {
+      /* Ensure we have *some* target space */
+      if (buffer_tailspace (&priv->converted_buffer) == 0)
+	grow_buffer (&priv->converted_buffer);
+
       /* Try to convert to our buffer */
       my_error = NULL;
       res = g_converter_convert (priv->converter,
 				 buffer_data (&priv->output_buffer),
 				 buffer_available (&priv->output_buffer),
-				 buffer_data (&priv->converted_buffer),
+				 buffer_data (&priv->converted_buffer) + buffer_available (&priv->converted_buffer),
 				 buffer_tailspace (&priv->converted_buffer),
 				 is_closing ? G_CONVERTER_INPUT_AT_END : G_CONVERTER_FLUSH,
 				 &bytes_read,
--- glib-2.24.1/gio/tests/converter-stream.c	2010-04-13 13:33:16.000000000 +0000
+++ glib-2.24.2/gio/tests/converter-stream.c	2010-08-08 14:47:15.000000000 +0000
@@ -558,6 +558,59 @@
   g_object_unref (compressor);
 }
 
+#define DATA_LENGTH 1000000
+
+static void
+test_corruption (void)
+{
+  GError *error = NULL;
+  guint32 *data0, *data1;
+  gsize data1_size;
+  gint i;
+  GInputStream *istream0, *istream1, *cistream1;
+  GOutputStream *ostream1, *ostream2, *costream1;
+  GConverter *compressor, *decompressor;
+
+  data0 = g_malloc (DATA_LENGTH * sizeof (guint32));
+  for (i = 0; i < DATA_LENGTH; i++)
+    data0[i] = g_random_int ();
+
+  istream0 = g_memory_input_stream_new_from_data (data0,
+    DATA_LENGTH * sizeof (guint32), NULL);
+
+  ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, NULL);
+  compressor = G_CONVERTER (g_zlib_compressor_new (
+                            G_ZLIB_COMPRESSOR_FORMAT_GZIP, -1));
+  costream1 = g_converter_output_stream_new (ostream1, compressor);
+
+  g_output_stream_splice (costream1, istream0, 0, NULL, &error);
+  g_assert_no_error (error);
+
+  g_object_unref (costream1);
+  g_object_unref (compressor);
+  data1 = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (ostream1));
+  data1_size = g_memory_output_stream_get_data_size (
+    G_MEMORY_OUTPUT_STREAM (ostream1));
+  g_object_unref (ostream1);
+  g_object_unref (istream0);
+
+  istream1 = g_memory_input_stream_new_from_data (data1, data1_size, NULL);
+  decompressor = G_CONVERTER (g_zlib_decompressor_new (
+                              G_ZLIB_COMPRESSOR_FORMAT_GZIP));
+  cistream1 = g_converter_input_stream_new (istream1, decompressor);
+
+  ostream2 = g_memory_output_stream_new (NULL, 0, g_realloc, NULL);
+
+  g_output_stream_splice (ostream2, cistream1, 0, NULL, &error);
+  g_assert_no_error (error);
+
+  g_assert_cmpuint (DATA_LENGTH * sizeof (guint32), ==,
+    g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (ostream2)));
+  g_assert (memcmp (data0, g_memory_output_stream_get_data (
+    G_MEMORY_OUTPUT_STREAM (ostream2)), DATA_LENGTH * sizeof (guint32)) == 0);
+}
+
+
 int
 main (int   argc,
       char *argv[])
@@ -567,6 +620,7 @@
 
   g_test_add_func ("/converter-input-stream/expander", test_expander);
   g_test_add_func ("/converter-input-stream/compressor", test_compressor);
+  g_test_add_func ("/converter-output-stream/corruption", test_corruption);
 
   return g_test_run();
 }
--- glib-2.24.1/glib/gtester.c	2010-04-13 13:33:16.000000000 +0000
+++ glib-2.24.2/glib/gtester.c	2010-08-08 16:13:52.000000000 +0000
@@ -620,12 +620,21 @@
   *argc_p = e;
 }
 
+static gboolean
+do_nothing (gpointer data)
+{
+  return TRUE;
+}
+
 int
 main (int    argc,
       char **argv)
 {
   guint ui;
 
+  /* See #578295 */
+  g_timeout_add_seconds (5, do_nothing, NULL);
+
   /* some unices need SA_RESTART for SIGCHLD to return -EAGAIN for io.
    * we must fiddle with sigaction() *before* glib is used, otherwise
    * we could revoke signal hanmdler setups from glib initialization code.
--- glib-2.24.1/glib/gutils.c	2010-04-13 13:33:16.000000000 +0000
+++ glib-2.24.2/glib/gutils.c	2010-08-08 14:47:15.000000000 +0000
@@ -3086,9 +3086,12 @@
    * by Windows and the Microsoft C runtime (in the "English_United
    * States" format) translated into the Unixish format.
    */
-  retval = g_win32_getlocale ();
-  if ((retval != NULL) && (retval[0] != '\0'))
+  {
+    char *locale = g_win32_getlocale ();
+    retval = g_intern_string (locale);
+    g_free (locale);
     return retval;
+  }
 #endif  
 
   return NULL;
--- glib-2.24.1/glib/gvariant.c	2010-05-03 00:42:45.000000000 +0000
+++ glib-2.24.2/glib/gvariant.c	2010-08-08 14:47:15.000000000 +0000
@@ -2619,14 +2619,10 @@
  *
  * Ends the builder process and returns the constructed value.
  *
- * This call automatically reduces the reference count on @builder by
- * one, unless it has previously had g_variant_builder_no_autofree()
- * called on it.  Unless you've taken other actions, this is usually
- * sufficient to free @builder.
- *
- * Even if additional references are held, it is not permissible to use
- * @builder in any way after this call except for further reference
- * counting operations.
+ * It is not permissible to use @builder in any way after this call
+ * except for reference counting operations (in the case of a
+ * heap-allocated #GVariantBuilder) or by reinitialising it with
+ * g_variant_builder_init() (in the case of stack-allocated).
  *
  * It is an error to call this function in any way that would create an
  * inconsistent value to be constructed (ie: insufficient number of

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: