DragonFly BSD
DragonFly bugs List (threaded) for 2013-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[DragonFlyBSD - Bug #2566] No space available for static Thread Local Storage


From: John Marino via Redmine <bugtracker-admin@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Jun 2013 03:18:59 -0700

Issue #2566 has been updated by marino.


It appears to me that nmalloc is ultimately the culprit here.
It sets the thr_mags structure as TLS data.  Right now NZONES equals 72 since ZALLOC_ZONE_LIMIT is 16K.  That means on x86-64, the thr_mags structure size is 2*8*72 + 8 + 4 = 1164 bytes.  Together will a couple of other TLS variables, the TLS section size of libc is 1172 bytes.  (For i386 it's "only" 588 bytes)

In comparison, FreeBSD libc TLS section is 17 bytes.

The dmalloc implementation also sets a structure as TLS storage, but it seems to be more modest (depends on size of slab_zone + 42 bytes) 

The immediate solution is to increase the value of RTLD_STATIC_TLS_EXTRA from 256 to likely 1280 on x86-64 and 640 on i386.

The mallocs should be reviewed to see if setting these structures to TLS was the right thing to do.  In any case, I think we're stuck with increased *TLS_EXTRA space until we don't need to support libc's with such big TLS sections.  (FreeBSD *TLS_EXTRA section is 128 bytes).  This is per library I believe, so an executable with 20 linked libraries needs to allocate, for example, 1280x20 bytes = 25kb of TLS space during dynamic linking.
----------------------------------------
Bug #2566: No space available for static Thread Local Storage
http://bugs.dragonflybsd.org/issues/2566

Author: eric.j.christeson
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 


I noticed some of my cron jobs not running and upon investigation I found this in /var/log/messages:

cron: in try_dlopen(): /usr/lib/security/pam_opie.so.2: /usr/lib/libc.so.7: No space available for static Thread Local Storage

su seems to have a similar problem:

su: in try_dlopen(): /usr/lib/security/pam_opie.so.2: /usr/lib/libc.so.7: No space available for static Thread Local Storage

As a work-around I edited /etc/pam.d/system and commented out the first two auth lines that include pam_opie.so and pam_opieaccess.so
obviously if you're not using opie, this won't affect much.

I first noticed it after building a quickworld from master on Monday, June 3.  The previous known good was Thursday, May 30.



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



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