Bug#312382: marked as done (libglib2.0-0: gthread shouldn't abort when stacksize cannot be set)

Debian Bug Tracking System owner@bugs.debian.org
Fri, 10 Jun 2005 13:18:30 -0700


Your message dated Fri, 10 Jun 2005 16:02:29 -0400
with message-id <E1Dgpi1-0008TY-00@newraff.debian.org>
and subject line Bug#312382: fixed in glib2.0 2.6.5-1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 7 Jun 2005 20:05:07 +0000
>From mbanck@gmx.net Tue Jun 07 13:05:07 2005
Return-path: <mbanck@gmx.net>
Received: from mail.gmx.net [213.165.64.20] 
	by spohr.debian.org with smtp (Exim 3.35 1 (Debian))
	id 1DfkJv-00063e-00; Tue, 07 Jun 2005 13:05:07 -0700
Received: (qmail invoked by alias); 07 Jun 2005 20:04:35 -0000
Received: from ppp-82-135-11-27.mnet-online.de (EHLO localhost.localdomain) [82.135.11.27]
  by mail.gmx.net (mp008) with SMTP; 07 Jun 2005 22:04:35 +0200
X-Authenticated: #686195
Received: from mbanck by localhost.localdomain with local (Exim 4.34)
	id 1DfkJT-0006t1-7w
	for submit@bugs.debian.org; Tue, 07 Jun 2005 22:04:39 +0200
Date: Tue, 7 Jun 2005 22:04:38 +0200
From: Michael Banck <mbanck@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libglib2.0-0: gthread shouldn't abort when stacksize cannot be set
Message-ID: <20050607200438.GA26420@chemicalconnection.dyndns.org>
Reply-To: Michael Banck <mbanck@debian.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L"
Content-Disposition: inline
X-Reportbug-Version: 3.5ubuntu5
User-Agent: Mutt/1.5.6+20040907i
X-Y-GMX-Trusted: 0
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: libglib2.0-0
Severity: normal
Tags: patch

Hi,

I filed this upstream as #304790, but it is a major issue, so I
duplicate it here:

Although GNU/Hurd's libpthread includes a pthread_attr_setstacksize()
function, it is mostly a stub and returns EINVAL except if the caller
specifies a stack
size of 2MB.

However, gthread just bails out if pthread_attr_setstacksize() fails,
resulting in e.g. gnome-display-properties and nautilus to abort upon
startup:

GThread-ERROR **: file gthread-posix.c: line 310 (): error 'Invalid
argument' during 'pthread_attr_setstacksize (&attr, stack_size)'
aborting...

Instead, we believe it should not fail if this optional feature cannot
be met and simply continue.

Neal Walfield has written some more on this at
http://lists.debian.org/debian-hurd/2005/05/msg00117.html:

-begin quote--
Our current libpthread doesn't support floating stacks.  To get at the
thread specific data (TSD), we look at the base of the stack.  To find
the base of the stack, we take the current stack point and bitwise and
it with ~(2MB - 1).  This mode of operation makes supporting user
stacks very difficult as we have no mechanism to express these
constraints to the user.

Currently, pthread_attr_setstacksize is essentially a stub (if the
caller specifies 2MB it succeeds all other values return EINVAL).
glib thinks that since it is present (it checks for it using autoconf,
apparently), it must work.  Arguably, we are not not POSIX compliant:

  The pthread_attr_setstacksize() function shall fail if:

  [EINVAL]
      The value of stacksize is less than {PTHREAD_STACK_MIN} or
      exceeds a system-imposed limit.

Thus for our implementation PTHREAD_STACK_MIN would be 2MB and the
system imposed limit would be 2MB. [...]

Since glib just ignores the stack size parameter if
pthread_attr_setstacksize is not found, it should just ignore any
failure.
--end quote--

Patch from the bug attached.


cheers,

Michael

--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pthread_attr_setstacksize_no_abort.patch"

--- glib2.0-2.6.4/gthread/gthread-posix.c.orig	2005-05-19 20:29:47.000000000 +0200
+++ glib2.0-2.6.4/gthread/gthread-posix.c	2005-05-19 20:34:06.376783904 +0200
@@ -307,7 +307,9 @@
   if (stack_size)
     {
       stack_size = MAX (g_thread_min_stack_size, stack_size);
-      posix_check_cmd (pthread_attr_setstacksize (&attr, stack_size));
+      /* No error check here, because some systems can't do it and
+       * we simply don't want threads to fail because of that. */
+      pthread_attr_setstacksize (&attr, stack_size);
     }
 #endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */
 

--FCuugMFkClbJLl1L--

---------------------------------------
Received: (at 312382-close) by bugs.debian.org; 10 Jun 2005 20:08:04 +0000
>From katie@ftp-master.debian.org Fri Jun 10 13:08:03 2005
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DgpnP-0000rn-00; Fri, 10 Jun 2005 13:08:03 -0700
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1Dgpi1-0008TY-00; Fri, 10 Jun 2005 16:02:29 -0400
From: jdassen@debian.org (J.H.M. Dassen (Ray))
To: 312382-close@bugs.debian.org
X-Katie: $Revision: 1.56 $
Subject: Bug#312382: fixed in glib2.0 2.6.5-1
Message-Id: <E1Dgpi1-0008TY-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Fri, 10 Jun 2005 16:02:29 -0400
Delivered-To: 312382-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Source: glib2.0
Source-Version: 2.6.5-1

We believe that the bug you reported is fixed in the latest version of
glib2.0, which is due to be installed in the Debian FTP archive:

glib2.0_2.6.5-1.diff.gz
  to pool/main/g/glib2.0/glib2.0_2.6.5-1.diff.gz
glib2.0_2.6.5-1.dsc
  to pool/main/g/glib2.0/glib2.0_2.6.5-1.dsc
glib2.0_2.6.5.orig.tar.gz
  to pool/main/g/glib2.0/glib2.0_2.6.5.orig.tar.gz
libglib2.0-0-dbg_2.6.5-1_i386.deb
  to pool/main/g/glib2.0/libglib2.0-0-dbg_2.6.5-1_i386.deb
libglib2.0-0_2.6.5-1_i386.deb
  to pool/main/g/glib2.0/libglib2.0-0_2.6.5-1_i386.deb
libglib2.0-data_2.6.5-1_all.deb
  to pool/main/g/glib2.0/libglib2.0-data_2.6.5-1_all.deb
libglib2.0-dev_2.6.5-1_i386.deb
  to pool/main/g/glib2.0/libglib2.0-dev_2.6.5-1_i386.deb
libglib2.0-doc_2.6.5-1_all.deb
  to pool/main/g/glib2.0/libglib2.0-doc_2.6.5-1_all.deb
libglib2.0-udeb_2.6.5-1_i386.udeb
  to pool/main/g/glib2.0/libglib2.0-udeb_2.6.5-1_i386.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 312382@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
J.H.M. Dassen (Ray) <jdassen@debian.org> (supplier of updated glib2.0 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri, 10 Jun 2005 21:14:42 +0200
Source: glib2.0
Binary: libglib2.0-0-dbg libglib2.0-udeb libglib2.0-data libglib2.0-dev libglib2.0-doc libglib2.0-0
Architecture: source i386 all
Version: 2.6.5-1
Distribution: unstable
Urgency: low
Maintainer: J.H.M. Dassen (Ray) <jdassen@debian.org>
Changed-By: J.H.M. Dassen (Ray) <jdassen@debian.org>
Description: 
 libglib2.0-0 - The GLib library of C routines
 libglib2.0-0-dbg - The GLib libraries and debugging symbols
 libglib2.0-data - Common files for GLib library
 libglib2.0-dev - Development files for the GLib library
 libglib2.0-doc - Documentation files for the GLib library
 libglib2.0-udeb - The GLib library of C routines (udeb)
Closes: 312382
Changes: 
 glib2.0 (2.6.5-1) unstable; urgency=low
 .
   * New upstream release again bringing a number of bugfixes, improved
     documentation and updated translations, including
     gthread-posix.c (g_thread_create_posix_impl): Allow setstacksize to
     fail.  (GNOME #304790, Michael Banck) (Closes: #312382)
   * [debian/patches/000_glib-link.patch] Updated.
Files: 
 9785934c63be376736f98ab69ca9051a 1599 libs optional glib2.0_2.6.5-1.dsc
 5f834488f33af83915287589d26b9205 3102170 libs optional glib2.0_2.6.5.orig.tar.gz
 7553524f492d214fde1bbacdde2c5c83 13951 libs optional glib2.0_2.6.5-1.diff.gz
 518d7e2b5f38a2747228b784806fcaf5 209114 misc optional libglib2.0-data_2.6.5-1_all.deb
 83e597c523e2fd8a45d20088cb50b5fc 523216 doc optional libglib2.0-doc_2.6.5-1_all.deb
 303607dd76a8867b3594b20e13cb5de6 496304 debian-installer optional libglib2.0-udeb_2.6.5-1_i386.udeb
 d0e79da4571f9f7ad627034f97778dc5 451270 libs optional libglib2.0-0_2.6.5-1_i386.deb
 2e96ea906a930fa89511320b67e392c8 468674 libdevel optional libglib2.0-dev_2.6.5-1_i386.deb
 12550dfd3379bd155edc5cd7b93cc99f 721312 libdevel extra libglib2.0-0-dbg_2.6.5-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCqewBA+HB2Re6Rc4RAsUpAJ9FZ7b6IoDsSiEAo3X/frRWO2NvaACcCsH9
EKgVzzANYReFKybLLXVj7JQ=
=KlAB
-----END PGP SIGNATURE-----