Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Issue 10035012: Added compile-time define to add "initial-exec" attribute. (Closed)

Created:
8 years, 8 months ago by asharif1
Modified:
8 years, 8 months ago
CC:
chromium-reviews, bjanakiraman1, willchan no longer on Chromium
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Added compile-time define to gate "initial-exec" attribute. The "initial-exec" attribute is added to the ThreadCache::threadlocal_heap_ variable under normal compilation. This causes the linker to emit a R_X86_64_TPOFF64 relocation in the _pyautolib.so shared object. This relocation can cause python to error with: cannot allocate memory in static TLS block when it calls dlopen() on _pyautolib.so (when the import statement is interpreted). This only happens when the TLS section is large enough. Building Chrome with -fprofile-generate to add some instrumentation-related data to the TLS is enough to trigger this condition. This CL encloses the function attribute in #if ! defined(PGO_GENERATE). When Chrome is built with -fprofile-generate, we will also pass in -DPGO_GENERATE and -ftls-model=global-dynamic so profile data can be collected without any errors. BUG=none TEST=Rebuilt chromeos-chrome in the chroot with -fprofile-generate -ftls-model=global-dynamic -DPGO_GENERATE && ran pyautoperf autotests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=133810

Patch Set 1 #

Patch Set 2 : Added same check in header file. #

Patch Set 3 : Moved sources to chromium's tcmalloc. #

Patch Set 4 : Added comments. #

Total comments: 5

Patch Set 5 : Fixed nits. #

Patch Set 6 : Made the comments better. #

Total comments: 2

Patch Set 7 : Switched header and cc file comments. #

Patch Set 8 : Fixed .h/.cc issue. #

Total comments: 2

Patch Set 9 : Removed extraneous "the" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -2 lines) Patch
M third_party/tcmalloc/chromium/src/thread_cache.h View 1 2 3 4 5 6 1 chunk +10 lines, -1 line 0 comments Download
M third_party/tcmalloc/chromium/src/thread_cache.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 30 (0 generated)
asharif1
PTAL.
8 years, 8 months ago (2012-04-17 23:03:32 UTC) #1
asharif1
-skg +sgk
8 years, 8 months ago (2012-04-17 23:04:22 UTC) #2
sgk
I've been away from the project for some time now. Best that you find another ...
8 years, 8 months ago (2012-04-18 00:04:09 UTC) #3
asharif1
-sgk +gpike
8 years, 8 months ago (2012-04-18 02:26:38 UTC) #4
asharif1
+dennisjeffrey. Dennis, do you know if _pyautolib.so really needs to link against tcmalloc? This whole ...
8 years, 8 months ago (2012-04-18 03:02:32 UTC) #5
Alexander Potapenko
Is PGO_GENERATE a standard define? If not, it's better to add an appropriate line to ...
8 years, 8 months ago (2012-04-18 08:07:20 UTC) #6
Alexander Potapenko
And, yes, it might be better not to depend on tcmalloc in pyautolib.
8 years, 8 months ago (2012-04-18 08:08:18 UTC) #7
dennisjeffrey
I don't know about this - I'm cc'ing Nirnimesh who is the most likely to ...
8 years, 8 months ago (2012-04-18 15:39:17 UTC) #8
asharif1
On 2012/04/18 08:07:20, Alexander Potapenko wrote: > Is PGO_GENERATE a standard define? If not, it's ...
8 years, 8 months ago (2012-04-18 18:38:41 UTC) #9
Nirnimesh
8 years, 8 months ago (2012-04-18 18:49:06 UTC) #10
Nirnimesh
_pyautolib.so uses chrome's base & ipc libs. If they don't need tcmalloc, I don't see ...
8 years, 8 months ago (2012-04-18 18:49:58 UTC) #11
asharif1
On 2012/04/18 18:49:58, Nirnimesh wrote: > _pyautolib.so uses chrome's base & ipc libs. If they ...
8 years, 8 months ago (2012-04-18 21:25:59 UTC) #12
asharif1
On 2012/04/18 21:25:59, asharif1 wrote: > On 2012/04/18 18:49:58, Nirnimesh wrote: > > _pyautolib.so uses ...
8 years, 8 months ago (2012-04-18 22:55:13 UTC) #13
Alexander Potapenko
I think I'm ok with this #ifdef in the Chromium branch of tcmalloc (please add ...
8 years, 8 months ago (2012-04-19 11:49:26 UTC) #14
asharif1
On 2012/04/19 11:49:26, Alexander Potapenko wrote: > I think I'm ok with this #ifdef in ...
8 years, 8 months ago (2012-04-19 17:50:54 UTC) #15
Alexander Potapenko
According to http://src.chromium.org/viewvc/chrome/trunk/src/base/base.gypi?view=markup, the target named "base" does not depend on tcmalloc (that's "allocator"). IIRC ...
8 years, 8 months ago (2012-04-19 19:15:10 UTC) #16
asharif1
On 2012/04/19 19:15:10, Alexander Potapenko wrote: > According to > http://src.chromium.org/viewvc/chrome/trunk/src/base/base.gypi?view=markup, the > target named ...
8 years, 8 months ago (2012-04-19 19:39:17 UTC) #17
Alexander Potapenko
I don't know of any such tool. Maybe hacking the gyp interpreter to print intermediate ...
8 years, 8 months ago (2012-04-19 19:59:19 UTC) #18
asharif1
glider, please take a look at the issue again. We need this fix to go ...
8 years, 8 months ago (2012-04-24 00:02:16 UTC) #19
Alexander Potapenko
LGTM with a nit. http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.cc File third_party/tcmalloc/chromium/src/thread_cache.cc (right): http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.cc#newcode70 third_party/tcmalloc/chromium/src/thread_cache.cc:70: #if defined(HAVE___ATTRIBUTE__) && ! defined(PGO_GENERATE) ...
8 years, 8 months ago (2012-04-24 10:38:15 UTC) #20
asharif1
http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.cc File third_party/tcmalloc/chromium/src/thread_cache.cc (right): http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.cc#newcode70 third_party/tcmalloc/chromium/src/thread_cache.cc:70: #if defined(HAVE___ATTRIBUTE__) && ! defined(PGO_GENERATE) On 2012/04/24 10:38:15, Alexander ...
8 years, 8 months ago (2012-04-24 17:50:12 UTC) #21
gpike
LGTM http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.h File third_party/tcmalloc/chromium/src/thread_cache.h (right): http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.h#newcode267 third_party/tcmalloc/chromium/src/thread_cache.h:267: // workaround is to pass in -DPGO_GENERATE. Please ...
8 years, 8 months ago (2012-04-24 18:38:21 UTC) #22
asharif1
On 2012/04/24 18:38:21, gpike wrote: > LGTM > > http://codereview.chromium.org/10035012/diff/15001/third_party/tcmalloc/chromium/src/thread_cache.h > File third_party/tcmalloc/chromium/src/thread_cache.h (right): > ...
8 years, 8 months ago (2012-04-24 20:41:48 UTC) #23
gpike
LGTM http://codereview.chromium.org/10035012/diff/31001/third_party/tcmalloc/chromium/src/thread_cache.h File third_party/tcmalloc/chromium/src/thread_cache.h (right): http://codereview.chromium.org/10035012/diff/31001/third_party/tcmalloc/chromium/src/thread_cache.h#newcode262 third_party/tcmalloc/chromium/src/thread_cache.h:262: // See comments in the header file about ...
8 years, 8 months ago (2012-04-24 20:49:29 UTC) #24
asharif1
PTAL. http://codereview.chromium.org/10035012/diff/31001/third_party/tcmalloc/chromium/src/thread_cache.h File third_party/tcmalloc/chromium/src/thread_cache.h (right): http://codereview.chromium.org/10035012/diff/31001/third_party/tcmalloc/chromium/src/thread_cache.h#newcode262 third_party/tcmalloc/chromium/src/thread_cache.h:262: // See comments in the header file about ...
8 years, 8 months ago (2012-04-24 21:02:33 UTC) #25
gpike
LGTM http://codereview.chromium.org/10035012/diff/25007/third_party/tcmalloc/chromium/src/thread_cache.cc File third_party/tcmalloc/chromium/src/thread_cache.cc (right): http://codereview.chromium.org/10035012/diff/25007/third_party/tcmalloc/chromium/src/thread_cache.cc#newcode67 third_party/tcmalloc/chromium/src/thread_cache.cc:67: // See comments in the thread_cache.h about this. ...
8 years, 8 months ago (2012-04-24 21:05:13 UTC) #26
asharif1
http://codereview.chromium.org/10035012/diff/25007/third_party/tcmalloc/chromium/src/thread_cache.cc File third_party/tcmalloc/chromium/src/thread_cache.cc (right): http://codereview.chromium.org/10035012/diff/25007/third_party/tcmalloc/chromium/src/thread_cache.cc#newcode67 third_party/tcmalloc/chromium/src/thread_cache.cc:67: // See comments in the thread_cache.h about this. Bug ...
8 years, 8 months ago (2012-04-24 21:11:43 UTC) #27
gpike
lgtm
8 years, 8 months ago (2012-04-24 21:59:09 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asharif@chromium.org/10035012/24004
8 years, 8 months ago (2012-04-24 22:01:11 UTC) #29
commit-bot: I haz the power
8 years, 8 months ago (2012-04-24 23:56:08 UTC) #30
Change committed as 133810

Powered by Google App Engine
This is Rietveld 408576698