OSDN Git Service
Andrew Hsieh [Thu, 21 Jun 2012 01:37:47 +0000 (18:37 -0700)]
Merge "Define __stack_chk_fail_local.S"
Andrew Hsieh [Wed, 20 Jun 2012 06:35:51 +0000 (14:35 +0800)]
Define __stack_chk_fail_local.S
With -fstack-protector, x86 -m32 needs __stack_chk_fail_local
defined in crtbegin_*.o.
Include __stack_chk_fail_local.S in begin.S otherwise linker
(which is built w/o crt*) may not link.
Change-Id: Id242fcf3eff157264afe3b04f27288ab7991220a
Robert Greenwalt [Tue, 12 Jun 2012 22:06:23 +0000 (15:06 -0700)]
Merge "Avoid multiple dns lookups for the same query"
Elliott Hughes [Mon, 11 Jun 2012 23:49:57 +0000 (16:49 -0700)]
Merge "Remove the meaningless on Linux if_dl.h header."
Elliott Hughes [Mon, 11 Jun 2012 23:29:46 +0000 (16:29 -0700)]
Merge "Remove an obsolete jamfile."
Elliott Hughes [Mon, 11 Jun 2012 23:17:45 +0000 (16:17 -0700)]
Remove an obsolete jamfile.
Was bionic ever built with jam? Weird!
Change-Id: Iea9a7af8bf46ee8319963e642da48e3bb49f6c60
Elliott Hughes [Mon, 11 Jun 2012 22:01:10 +0000 (15:01 -0700)]
Remove the meaningless on Linux if_dl.h header.
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.
Reported to AOSP by Jun-ya Kato.
(cherry-pick of
5056f1fad1187cd67729bb04ba72397d78256f03.)
Change-Id: Ic67f674d2221497c8166994812bb5fc7f0831066
Elliott Hughes [Wed, 6 Jun 2012 20:32:19 +0000 (13:32 -0700)]
Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM."
Elliott Hughes [Wed, 6 Jun 2012 19:04:38 +0000 (12:04 -0700)]
Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
Bug: http://code.google.com/p/enh/issues/detail?id=33
Change-Id: I679b4cd888d362031042284e8edf01c5273a92aa
Elliott Hughes [Wed, 6 Jun 2012 17:44:31 +0000 (10:44 -0700)]
Merge "Give the timer_create SIGEV_THREAD helper threads sensible names."
Elliott Hughes [Wed, 6 Jun 2012 17:32:56 +0000 (10:32 -0700)]
Give the timer_create SIGEV_THREAD helper threads sensible names.
Bug:
6609676
Change-Id: I286b197c75beee4d9930b0973f2d7dd47c14e91c
Jean-Baptiste Queru [Thu, 17 May 2012 19:25:01 +0000 (12:25 -0700)]
Merge "bionic: add clean kernel header ucontext.h"
Elliott Hughes [Wed, 16 May 2012 16:56:37 +0000 (09:56 -0700)]
Merge "Remove the last references to SuperH."
Elliott Hughes [Wed, 16 May 2012 00:03:18 +0000 (17:03 -0700)]
Remove the last references to SuperH.
Change-Id: Icb44c1f94cb178d90b4c2b1e8f6d175586aec4e1
Nick Kralevich [Tue, 15 May 2012 22:10:24 +0000 (15:10 -0700)]
Merge "Make the linker relocatable."
Nick Kralevich [Tue, 15 May 2012 22:10:12 +0000 (15:10 -0700)]
Merge "linker: set LOCAL_NO_CRT := true"
Nick Kralevich [Tue, 15 May 2012 22:10:00 +0000 (15:10 -0700)]
Merge "linker: Fix the computation of si->base"
Nick Kralevich [Tue, 15 May 2012 22:09:45 +0000 (15:09 -0700)]
Merge "Add linker support for PIE"
Nick Kralevich [Fri, 11 Nov 2011 23:53:17 +0000 (15:53 -0800)]
Make the linker relocatable.
Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.
Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
Nick Kralevich [Fri, 4 Nov 2011 17:11:26 +0000 (10:11 -0700)]
linker: set LOCAL_NO_CRT := true
Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.
Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1
David 'Digit' Turner [Tue, 15 Nov 2011 16:17:28 +0000 (17:17 +0100)]
linker: Fix the computation of si->base
The computation of si->base assumed that the first entry in the
program header table is a PT_PHDR. This results in the dynamic
linker crashing with a SIGSEGV/MAPERR when trying to load some
of the NDK unit test programs, which happen to have an EXIDX
header first, followed byu a PHDR one.
This patch fixes the computation by parsing the program header
table, looking explicitely for the PHDR entry. This fixes the
load of the NDK unit test programs, and doesn't affect system
libraries.
Change-Id: Id18ea6037dbe950b5abbbce816c2960321f0b81d
Nick Kralevich [Thu, 20 Oct 2011 21:57:56 +0000 (14:57 -0700)]
Add linker support for PIE
Modify the dynamic linker so that executables can be loaded
at locations other than 0x00000000.
Modify crtbegin* so that non-PIC compilant "thumb interwork
veneers" are not created by the linker.
Bug:
5323301
Change-Id: Iece0272e2b708c79034f302c20160e1fe9029588
Kito Cheng [Sun, 13 May 2012 17:42:12 +0000 (01:42 +0800)]
bionic: add clean kernel header ucontext.h
Change-Id: I34fd0b0147fa33fd74c13480bc11827634233a41
Elliott Hughes [Thu, 10 May 2012 17:14:43 +0000 (10:14 -0700)]
Merge "bionic/x86: Optimization for memcpy"
Elliott Hughes [Wed, 9 May 2012 23:39:40 +0000 (16:39 -0700)]
Merge "Actually set the header guard in "linux-syscalls.h"."
Elliott Hughes [Wed, 9 May 2012 23:34:11 +0000 (16:34 -0700)]
Actually set the header guard in "linux-syscalls.h".
Spotted while merging a MIPS change.
Change-Id: I36fb5a07d0bba0c117e9fe9733957bd37ca4b4c0
Elliott Hughes [Wed, 9 May 2012 18:50:06 +0000 (11:50 -0700)]
Merge "[MIPS] Add support for MIPS syscalls"
Raghu Gandham [Sat, 28 Jan 2012 01:51:42 +0000 (17:51 -0800)]
[MIPS] Add support for MIPS syscalls
Change-Id: I4deba67e15c865c4c2db03064c04098a09828ea6
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
Elliott Hughes [Wed, 9 May 2012 16:52:56 +0000 (09:52 -0700)]
Merge "bionic: allow the board to customize MALLOC_ALIGNMENT"
Jack Ren [Sat, 19 Nov 2011 01:48:03 +0000 (09:48 +0800)]
bionic: allow the board to customize MALLOC_ALIGNMENT
Currently the dlmalloc allocates the memory with 8-byte alignment.
According to the com.aurorasoftworks.quadrant.ui.professional benchmark data:
We can get much better memory performance if we change it to be 16-byte aligned.
For example, On Nexus-S:
8-byte aligned :
1378 1070 1142 1665 1765 1163 1179 1263 1404 avg: 1336.
555555556
16-byte aligned:
1691 1731 1780 1691 1671 1678 1802 1758 1780 avg: 1731.
333333333
gain: 29.53%
That patch provides flexibity to customize the MALLOC_ALIGNMENT from the
board config.The macro MALLOC_ALIGNMENT defaults to 8.
To change it, please define BOARD_MALLOC_ALIGNMENT in the BoardConfig.mk:
BOARD_MALLOC_ALIGNMENT := <whatever>
Change-Id: I8da0376944a0bbcef1d0fc026bfb6d9125db9739
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Elliott Hughes [Wed, 9 May 2012 16:46:02 +0000 (09:46 -0700)]
Merge "pthread: Invalidate stale stack pointers on pthread_exit()"
Bjorn Andersson [Fri, 4 May 2012 00:12:39 +0000 (17:12 -0700)]
pthread: Invalidate stale stack pointers on pthread_exit()
A call to pthread_key_delete() after pthread_exit() have unmapped the stack of a thread
but before the ongoing pthread_join() have finished executing will result in an access
to unmapped memory.
Avoid this by invalidating the stack_base and tls pointers during pthread_exit().
This is based on the investigation and proprosed solution by
Srinavasa Nagaraju <srinavasa.x.nagaraju@sonyericsson.com>
Change-Id: I145fb5d57930e91b00f1609d7b2cd16a55d5b3a9
Elliott Hughes [Tue, 8 May 2012 21:54:56 +0000 (14:54 -0700)]
Merge "Implement the "abort" stub in assembly for ARM."
Ben Cheng [Tue, 8 May 2012 20:36:37 +0000 (13:36 -0700)]
Implement the "abort" stub in assembly for ARM.
So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().
(Cherry pick of Id264a5167e7cabbf11515fbc48f5469c527e34d4.)
Bug:
6455193
Conflicts:
libc/Android.mk
Change-Id: I568fc5303fd1d747075ca933355f914122f94dac
Jack Ren [Tue, 14 Feb 2012 08:01:52 +0000 (12:01 +0400)]
bionic/x86: Optimization for memcpy
Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Wei A Jin <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Conflicts:
libc/arch-x86/string/ssse3-memcpy5.S
Change-Id: I41e70d1d19d5457e65c89b64da452fbdaf3a00a7
Elliott Hughes [Tue, 8 May 2012 18:56:13 +0000 (11:56 -0700)]
Merge "Cherry-pick "generate PIC code"."
Nick Kralevich [Fri, 11 Nov 2011 23:47:24 +0000 (15:47 -0800)]
Cherry-pick "generate PIC code".
Change-Id: I7d5f2e5663df263493f65e364c959e663fc4d13a
Elliott Hughes [Tue, 8 May 2012 17:56:00 +0000 (10:56 -0700)]
Merge "Let pthread_create fail if schedparam can't be set"
Pierre Peiffer [Wed, 22 Feb 2012 15:40:15 +0000 (16:40 +0100)]
Let pthread_create fail if schedparam can't be set
The creation of a thread succeeds even if the requested scheduling
parameters can not be set. This is not POSIX compliant, and even
worse, it leads to a wrong behavior. Let pthread_create() fail in this
case.
Change-Id: Ice66e2a720975c6bde9fe86c2cf8f649533a169c
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
Mattias Falk [Tue, 6 Sep 2011 13:15:06 +0000 (15:15 +0200)]
Avoid multiple dns lookups for the same query
If two or more rapid dns requests for the same server are done
from different threads it turns into separate dns reques, if
the response of the request isn't found in the cache.
This patch avoid multiple request for the same server by
letting subsequents request wait until the first request
has finished.
Change-Id: Ic72ea0e7d3964a4164eddf866feb4357ec4dfe54
Elliott Hughes [Mon, 7 May 2012 17:51:28 +0000 (10:51 -0700)]
Merge "bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()"
Xi Wang [Wed, 14 Mar 2012 06:48:39 +0000 (02:48 -0400)]
bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()
The allocation size in chk_malloc(), leak_malloc(), and leak_memalign()
functions may be rounded up to a small value, leading to buffer overflows.
The code only runs in debugging mode.
This patch complements commit
6f04a0f4 (CVE-2009-0607).
Change-Id: Id899bcd2bcd2ea2205e5753c433390710032dc83
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Elliott Hughes [Mon, 7 May 2012 17:41:52 +0000 (10:41 -0700)]
Merge "Remove expired dns cache entries before removing oldest"
Elliott Hughes [Mon, 7 May 2012 16:13:34 +0000 (09:13 -0700)]
Merge "Adjust memcpy for ARM Cortex A9 cache line size"
Henrik Smiding [Wed, 15 Sep 2010 14:08:03 +0000 (16:08 +0200)]
Adjust memcpy for ARM Cortex A9 cache line size
ARM Cortex A8 use 64 bytes and ARM Cortex A9 use 32 bytes cache line
size.
The following patch:
Adds code to adjust memcpy cache line size to match A9 cache line
size.
Adds a flag to select between 32 bytes and 64 bytes cache line
size.
Copyright (C) ST-Ericsson SA 2010
Modified neon implementation to fit Cortex A9 cache line size
Author: Henrik Smiding henrik.smiding@stericsson.com for
ST-Ericsson.
Change-Id: I8a55946bfb074e6ec0a14805ed65f73fcd0984a3
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
Elliott Hughes [Fri, 4 May 2012 19:00:19 +0000 (12:00 -0700)]
Merge "MIPS support to libm, libdl and libthread_db"
Chris Dearman [Wed, 2 May 2012 00:45:53 +0000 (17:45 -0700)]
MIPS support to libm, libdl and libthread_db
Change-Id: I9106721af7fe0cd45df82976250db0d300a20117
Signed-off-by: Raghu Gandham <raghu@mips.com>
Elliott Hughes [Tue, 1 May 2012 05:35:02 +0000 (22:35 -0700)]
Merge "Update s_fabsl.c to upstream head."
Elliott Hughes [Mon, 30 Apr 2012 23:12:43 +0000 (16:12 -0700)]
Update s_fabsl.c to upstream head.
Bug: http://code.google.com/p/android/issues/detail?id=29539
Change-Id: I843dcfcbfe49e8e9f43c49aae6ade1edb57a3053
Ken Sumrall [Thu, 15 Dec 2011 04:50:01 +0000 (20:50 -0800)]
Add the posix_memalign(3) function to bionic
The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed. In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).
Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
Andrew Hsieh [Wed, 25 Apr 2012 06:44:17 +0000 (23:44 -0700)]
Merge "[MIPS] Fix the warning originating from the kernel header signal.h. This is a clean header generated from the corresponding change in external/kernel-headers repository. (CL 35760)"
Raghu Gandham [Tue, 24 Apr 2012 01:59:41 +0000 (18:59 -0700)]
[MIPS] Fix the warning originating from the kernel header signal.h.
This is a clean header generated from the corresponding change in
external/kernel-headers repository. (CL 35760)
Elliott Hughes [Mon, 16 Apr 2012 16:13:13 +0000 (09:13 -0700)]
Merge "libstdc++: Fix x86 thread-safe one-time-construction implementation."
Elliott Hughes [Mon, 16 Apr 2012 16:09:04 +0000 (09:09 -0700)]
Merge "Bionic: Fix wrong prototype of system call clock_nanosleep"
Elliott Hughes [Mon, 16 Apr 2012 16:06:22 +0000 (09:06 -0700)]
Merge "bionic: Fix wrong prototype of system call getresuid/getresgid"
Jack Ren [Tue, 17 Apr 2012 03:20:15 +0000 (11:20 +0800)]
Bionic: Fix wrong prototype of system call clock_nanosleep
In bionic/libc/SYSCALLS.TXT, the prototype of system call
clock_nanosleep is incorrect.
According to man page:
int clock_nanosleep(clockid_t clock_id, int flags,
const struct timespec *request,
struct timespec *remain);
Change-Id: Ic44c6db3d632293aa17998035554eacd664c2d57
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Elliott Hughes [Mon, 16 Apr 2012 15:48:19 +0000 (08:48 -0700)]
Merge "bionic: fix NULL parameter failure in getcwd()"
Jack Ren [Tue, 17 Apr 2012 03:16:18 +0000 (11:16 +0800)]
bionic: Fix wrong prototype of system call getresuid/getresgid
In bionic/libc/SYSCALLS.TXT, the prototypes of system call
getresuid/getresgid are incorrect.
According to man page, they should be:
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
Change-Id: I676098868bb05a9e1fe45419b234cf397626fdad
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Jack Ren [Tue, 13 Mar 2012 10:26:28 +0000 (18:26 +0800)]
bionic: fix NULL parameter failure in getcwd()
LTP: getcwd01 failed in LTP
Need to check getcwd parameters, otherwise it will lead to
posix test case to fail.
Change-Id: Ieb673b6dd4ca6481da81c5339dbf7ec0a463f263
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Fengwei Yin [Wed, 28 Mar 2012 09:25:17 +0000 (17:25 +0800)]
libstdc++: Fix x86 thread-safe one-time-construction implementation.
The root of the problem is that the existing implementation is based on the
ARM C++ ABI, which mandates a different guard variable layout than the
Itanium/x86 C++ one.
This patch modifies the implementation in a way that satisfies both ABIs (and
doesn't require changing the toolchains).
Change-Id: I885e9adc7f088b9c0a78355bd752f1e6aeec9f07
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Elliott Hughes [Fri, 13 Apr 2012 21:57:59 +0000 (14:57 -0700)]
Merge "libm: fix invalid result of function remquo/remquof"
Jack Ren [Sat, 19 Nov 2011 07:52:08 +0000 (15:52 +0800)]
libm: fix invalid result of function remquo/remquof
Currently we will get the wrong result as follows:
remquof(0x7bb33336, 0x63000000) = -
671088640, 0x00000000
remquo(0xbff0000000000003, 0x3ff0000000000003) = 1, 0x8000000000000000
remquo(0x9120000000000001, 0x0000000000000005) = -
1288490188, 0x0000000000000004
while the correct one should be:
remquof(0x7bb33336, 0x63000000) =
1476395008, 0x00000000
remquo(0xbff0000000000003, 0x3ff0000000000003) = -1, 0x8000000000000000
remquo(0x9120000000000001, 0x0000000000000005) = -
1288490189, 0x0000000000000001
Fixed in this patch.
Change-Id: I540b348cd10a539f3b39b1753945c893c4c7ec46
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Elliott Hughes [Mon, 2 Apr 2012 17:25:43 +0000 (10:25 -0700)]
Merge "Update to tzdata2012c."
Elliott Hughes [Mon, 2 Apr 2012 14:35:13 +0000 (07:35 -0700)]
Update to tzdata2012c.
From the release notes:
africa
Summer time changes for Morocco (to start late April 2012)
asia
Changes for 2012 for Gaza & the West Bank (Hebron) and Syria
northamerica
Haiti following US/Canada rules for 2012 (and we're assuming,
for now anyway, for the future).
Also include a change made internally to the 'generate' script as part of
the tzdata2011m update that apparently never made it to AOSP; the original
checkin comment for which was:
Update to tzdata2011m.
Fixes for Europe/Tiraspol (Moldova) and all four Ukrainian zones.
Also show the MD5 of the downloaded data, for comparison against the MD5
given in the announcement mails. (There's a plan to move to proper signing,
but that's not implemented on their end yet.)
(I'm repeating the tzdata change for the convenience of anyone grepping the
log, since the 2012 tzdata releases also contain the 2011m changes; 2011m
is the only missing release I noticed.)
Change-Id: I9a2e530b3a8ea88e3375334a12376e3d8526f267
Elliott Hughes [Fri, 30 Mar 2012 20:42:42 +0000 (13:42 -0700)]
Merge "libc/x86: ensure the stack 16-byte aligned when tasks created"
Elliott Hughes [Wed, 28 Mar 2012 00:53:35 +0000 (17:53 -0700)]
am
09ce7749: Merge "[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture."
* commit '
09ce7749d74733b28d4fa7a1d36457cb366cc5da':
[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture.
Elliott Hughes [Tue, 27 Mar 2012 23:49:28 +0000 (16:49 -0700)]
Merge "[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture."
Raghu Gandham [Tue, 27 Mar 2012 18:37:17 +0000 (11:37 -0700)]
[MIPS] Clean Kernel headers are generated by running
libc/kernel/tools/update_all.py script. This patch ignores
any changes to libc/kernel directory not related to MIPS
architecture.
Change-Id: I2c9e461dccb7c33eb4420be2db1a562f45137c8d
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
Jean-Baptiste Queru [Tue, 27 Mar 2012 01:25:43 +0000 (18:25 -0700)]
am
56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit '
56731351de7230180fc99a1a4b0afd12f881b0f7':
bionic: fix atfork hanlder_mutex deadlock
Jean-Baptiste Queru [Mon, 26 Mar 2012 23:19:35 +0000 (16:19 -0700)]
Merge "bionic: fix atfork hanlder_mutex deadlock"
Jack Ren [Wed, 21 Mar 2012 09:48:13 +0000 (17:48 +0800)]
libc/x86: ensure the stack 16-byte aligned when tasks created
Currently Renderscript sample code RsBalls crashed on x86 when SSE2
enabled. The root cause is that the stack was not 16-byte aligned
from the beginning when the processes/threads were created, so the
RsBalls crashed when SSE2 instructions tried to access the variables
on the stack.
- For the thread created by fork():
Its stack alignment is determined by crtbegin_{dynamic, static}.S
- For the thread created by pthread_create():
Its stack alignment is determined by clone.S. __thread_entry( ) is
a standard C function. In order to have its stack be aligned with
16 byte properly, __thread_entry() needs the stack with following
layout when it is called:
layout #1 (correct)
--------------
| |
-------------- <--ESP (ECX - 20)
| ret EIP |
-------------- <--ECX - 16
| arg0 |
-------------- <--ECX - 12
| arg1 |
-------------- <--ECX - 8
| arg2 |
-------------- <--ECX - 4
| unused |
-------------- <--ECX (16-byte boundary)
But it has following layout for now:
layout #2: (incorrect)
--------------
| |
-------------- <--ESP (ECX - 16)
| unused |
-------------- <--ECX - 12
| arg0 |
-------------- <--ECX - 8
| arg1 |
-------------- <--ECX - 4
| arg2 |
-------------- <--ECX (16-byte boundary)
Fixed in this patch.
Change-Id: Ibe01f64db14be14033c505d854c73033556ddaa8
Signed-off-by: Michael Liao <michael.liao@intel.com>
Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Jack Ren [Fri, 16 Mar 2012 08:37:35 +0000 (16:37 +0800)]
bionic: fix atfork hanlder_mutex deadlock
After applying the kernel_id fix, the system refused to boot up and we
got following crash log:
I/DEBUG ( 113): pid: 618, tid: 618 >>> org.simalliance.openmobileapi.service:remote <<<
I/DEBUG ( 113): signal 16 (SIGSTKFLT), code -6 (?), fault addr --------
I/DEBUG ( 113): eax
fffffe00 ebx
b77de994 ecx
00000080 edx
00724002
I/DEBUG ( 113): esi
00000000 edi
00004000
I/DEBUG ( 113): xcs
00000073 xds
0000007b xes
0000007b xfs
00000000 xss
0000007b
I/DEBUG ( 113): eip
b7761351 ebp
bfdf3de8 esp
bfdf3dc4 flags
00000202
I/DEBUG ( 113): #00 eip:
00015351 /system/lib/libc.so
I/DEBUG ( 113): #01 eip:
0000d13c /system/lib/libc.so (pthread_mutex_lock)
I/DEBUG ( 113): #02 eip:
00077b48 /system/lib/libc.so (__bionic_atfork_run_prepare)
I/DEBUG ( 113): #03 eip:
00052cdb /system/lib/libc.so (fork)
I/DEBUG ( 113): #04 eip:
0009ae91 /system/lib/libdvm.so (_Z18dvmOptimizeDexFileillPKcjjb)
I/DEBUG ( 113): #05 eip:
000819d6 /system/lib/libdvm.so (_Z14dvmJarFileOpenPKcS0_PP7JarFileb)
I/DEBUG ( 113): #06 eip:
000b175e /system/lib/libdvm.so (_ZL40Dalvik_dalvik_system_DexFile_openDexFilePKjP6JValue)
I/DEBUG ( 113): #07 eip:
0011fb94 /system/lib/libdvm.so
Root cause:
The atfork uses the mutex handler_mutex to protect the atfork_head. The
parent will call __bionic_atfork_run_prepare() to lock the handler_mutex,
and need both the parent and child to unlock their own copy of handler_mutex
after fork. At that time, the owner of hanlder_mutex is set as the parent.
If we apply the kernel_id fix, then the child's kernel_id will be set as
child's tid.
The handler_mutex is a recursive lock, and pthread_mutex_unlock(&hander_mutex)
will fail because the mutex owner is the parent, while the current tid
(__get_thread()->kernel_id) is child, not matched with the mutex owner.
At that time, the handler_mutex is left in lock state.If the child wants to
fork other process after than, then it will try to lock handler_mutex, and
then be deadlocked.
Fix:
Since the child has its own copy of vm space from the the parent, the
child space's handler_mutex should be reset to the initialized state.
Change-Id: I3907dd9a153418fb78862f2aa6d0302c375d9e27
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Elliott Hughes [Tue, 13 Mar 2012 00:06:09 +0000 (17:06 -0700)]
am
73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"
* commit '
73b5cad989da317cc8089b57ee25f502b1cac71f':
bionic: Fix wrong kernel_id in pthread descriptor after fork()
Elliott Hughes [Mon, 12 Mar 2012 17:32:02 +0000 (10:32 -0700)]
Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"
Jack Ren [Tue, 17 Jan 2012 08:27:42 +0000 (16:27 +0800)]
bionic: Fix wrong kernel_id in pthread descriptor after fork()
After forking, the kernel_id field in the phtread_internal_t returned by pthread_self()
is incorrect --- it's the tid from the parent, not the new tid of the
child.
The root cause is that: currently the kernel_id is set by
_init_thread(), which is called in 2 cases:
(1) called by __libc_init_common(). That happens when the execv( ) is
called after fork( ). But when the zygote tries to fork the android
application, the child application doesn't call execv( ), instread, it
tries to call the Java main method directly.
(2) called by pthread_create(). That happens when a new thread is
created.
For the lead thread which is the thread created by fork(), it should
call execv() but it doesn't, as described in (1) above. So its kernel_id
will inherit the parent's kernel_id.
Fixed it in this patch.
Change-Id: I63513e82af40ec5fe51fbb69456b1843e4bc0fc7
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Elliott Hughes [Fri, 2 Mar 2012 19:07:03 +0000 (11:07 -0800)]
am
a58c88c2: Merge "Upgrade to tzdata2012b."
* commit '
a58c88c235bfeeb17ac495991e66f7b906935852':
Upgrade to tzdata2012b.
Elliott Hughes [Fri, 2 Mar 2012 18:11:18 +0000 (10:11 -0800)]
resolved conflicts for merge of
cfe535ef to stage-aosp-master
Change-Id: I21a1dd41503518e75892180c14f1ce79102772ad
Elliott Hughes [Fri, 2 Mar 2012 08:09:03 +0000 (00:09 -0800)]
Merge "Upgrade to tzdata2012b."
Elliott Hughes [Fri, 2 Mar 2012 07:34:11 +0000 (23:34 -0800)]
Upgrade to tzdata2012b.
Summer time in Cuba has been delayed 3 weeks (now starts April 1 rather
than March 11). Since March 11 (the old start date, as listed in 2012a)
is just a little over a week away, this change is urgent.
Change-Id: Iadf4dc30072bdac0bcd0ad4b9e076a9ca071efbe
Elliott Hughes [Fri, 2 Mar 2012 07:32:14 +0000 (23:32 -0800)]
Merge "Upgrade to tzdata2011a."
Elliott Hughes [Thu, 1 Mar 2012 17:38:31 +0000 (09:38 -0800)]
Upgrade to tzdata2011a.
From the notes:
Chile 2011/2012 and 2012/2013 summer time date adjustments.
Falkland Islands onto permanent summer time (we're assuming for the
foreseeable future, though 2012 is all we're fairly certain of.)
Armenia has abolished Summer Time.
Tokelau jumped the International Date Line back last December
(just the same as their near neighbour, Samoa).
America/Creston is a new zone for a small area of British Columbia
There will be a leapsecod 2012-06-30 23:59:60 UTC.
Change-Id: I1d66edf8d33fd1dbcf21178def91844025fd9047
Jean-Baptiste Queru [Thu, 1 Mar 2012 03:08:50 +0000 (19:08 -0800)]
am
25f2d1f0: Merge "update stddef.h"
* commit '
25f2d1f0c3c7802af0d4d1e2bbd3bf95a7e0970b':
update stddef.h
Jean-Baptiste Queru [Thu, 1 Mar 2012 03:08:49 +0000 (19:08 -0800)]
am
afab5a70: Merge "Eliminate duplicate constants"
* commit '
afab5a703d30df613848cb30ab3ecceafd76102b':
Eliminate duplicate constants
Jean-Baptiste Queru [Thu, 1 Mar 2012 02:59:15 +0000 (18:59 -0800)]
Merge "update stddef.h"
Jean-Baptiste Queru [Thu, 1 Mar 2012 02:58:52 +0000 (18:58 -0800)]
Merge "Eliminate duplicate constants"
Nick Kralevich [Tue, 28 Feb 2012 21:36:31 +0000 (13:36 -0800)]
update stddef.h
Pull in an updated version of stddef.h from the linux kernel.
Pulled from upstream kernel at
891003abb0db6bfffd61b76ad0ed39bb7c3db8e1
This file was generated using the following command:
cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/stddef.h
Change-Id: I6c29f3fa100c5368da41d0f0da39bc50fa668e9d
Nick Kralevich [Tue, 28 Feb 2012 19:49:41 +0000 (11:49 -0800)]
Eliminate duplicate constants
include/elf.h contains basically the same values as
linux/auxvec.h. Eliminate dups.
include/sys/exec_elf.h contains basically the same
values as linux/elf.h. Eliminate dups.
Change-Id: I66b8358161bb52223bb657f8f73ba28b324f4fa3
Jean-Baptiste Queru [Wed, 29 Feb 2012 23:38:55 +0000 (15:38 -0800)]
am
7f28e0b4: Merge "Clean up the remnants of SuperH support"
* commit '
7f28e0b4501de7c4f8f627fd3e4be323d737ae82':
Clean up the remnants of SuperH support
Jean-Baptiste Queru [Wed, 29 Feb 2012 22:39:41 +0000 (14:39 -0800)]
Merge "Clean up the remnants of SuperH support"
Jean-Baptiste Queru [Tue, 28 Feb 2012 21:28:30 +0000 (13:28 -0800)]
am
9c9b0fc7: Merge "libm: cherry-pick one patch from freebsd to fix logb() denormals issue"
* commit '
9c9b0fc7e1dff39baa8cdf2536be9776aa4af766':
libm: cherry-pick one patch from freebsd to fix logb() denormals issue
Jean-Baptiste Queru [Tue, 28 Feb 2012 17:44:40 +0000 (09:44 -0800)]
Merge "libm: cherry-pick one patch from freebsd to fix logb() denormals issue"
Jack Ren [Tue, 28 Feb 2012 04:02:21 +0000 (12:02 +0800)]
libm: cherry-pick one patch from freebsd to fix logb() denormals issue
from http://svnweb.freebsd.org/base?view=revision&revision=176101
"
Oops, fix the fix in rev.1.10. logb() and logbf() were broken on
denormals, and logb() remained broken after 1.10 because the fix for
logbf() was incompletely translated.
Convert to __FBSDID().
"
Change-Id: I54f33648db7c421b06eee1ea8e63c57a179fae0d
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Jean-Baptiste Queru [Thu, 23 Feb 2012 20:29:10 +0000 (12:29 -0800)]
am
d041bf20: Merge "bionic/x86: fix one potential deadlock in __set_tls()"
* commit '
d041bf2095f5f133c87f7ba632a8dfb39537a437':
bionic/x86: fix one potential deadlock in __set_tls()
Jean-Baptiste Queru [Thu, 23 Feb 2012 16:43:29 +0000 (08:43 -0800)]
Merge "bionic/x86: fix one potential deadlock in __set_tls()"
Jin Wei [Thu, 15 Dec 2011 07:49:25 +0000 (15:49 +0800)]
bionic/x86: fix one potential deadlock in __set_tls()
Fix bug:
Currently the mutex lock _tls_desc_lock is not released
when __set_thread_area() fails. That will leads to the deadlock
when __set_tls( ) is called later on.
Change-Id: Iea3267cb0659971cba7766cbc3346f6924274f86
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Jean-Baptiste Queru [Wed, 22 Feb 2012 17:54:52 +0000 (09:54 -0800)]
am
f9c5afb1: Merge "Redesign dlopen() locks to be recursive per thread."
* commit '
f9c5afb1f9d8e615ab98774a10bbf117962db66d':
Redesign dlopen() locks to be recursive per thread.
Jean-Baptiste Queru [Wed, 22 Feb 2012 17:30:52 +0000 (09:30 -0800)]
Merge "Redesign dlopen() locks to be recursive per thread."
Pavel Chupin [Mon, 20 Feb 2012 06:49:13 +0000 (10:49 +0400)]
Redesign dlopen() locks to be recursive per thread.
That is to fix the bug:
dlxxx functions can't be called recursively.
For example, if we use dlopen() to use open one library whose constructor
also calls dlopen() in order to open another library, then the thread is
dead-blocked.
By changing the dl_lock from a non-recursive lock to a recursive lock, we can
prevent the thread from dead-blocked by recursive dlxxx calls in the same
thread context.
Change-Id: I1018b41c82f4641cc009c0a2eda31f5a47a534f9
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Jean-Baptiste Queru [Mon, 13 Feb 2012 22:25:53 +0000 (14:25 -0800)]
am
a60ff6c5: Merge "libc: Define new symbol visibility macros"
* commit '
a60ff6c5b2ca76181b387d8c10aee22a2cbcf840':
libc: Define new symbol visibility macros
Jean-Baptiste Queru [Mon, 13 Feb 2012 22:23:11 +0000 (14:23 -0800)]
Merge "libc: Define new symbol visibility macros"