OSDN Git Service
The Android Automerger [Sun, 3 Jun 2012 12:59:30 +0000 (05:59 -0700)]
merge in jb-release history after reset to jb-dev
Iliyan Malchev [Tue, 29 May 2012 21:22:42 +0000 (14:22 -0700)]
bionic: import heaptracker as chk_malloc
This patch is a rewrite of libc.debug.malloc = 10 (chk_malloc). It provides
the same features as the original (poison freed memory, detect heap overruns
and underruns), except that it provides more debugging information whenever it
detects a problem.
In addition to the original features, the new chk_malloc() implementation
detects multiple frees within a given range of the last N allocations, N being
configurable via the system property libc.debug.malloc.backlog.
Finally, this patch keeps track of all outstanding memory allocations. On
program exit, we walk that list and report each outstanding allocation.
(There is support (not enabled) for a scanner thread periodically walks over
the list of outstanding allocations as well as the backlog of recently-freed
allocations, checking for heap-usage errors.)
Feature overview:
1) memory leaks
2) multiple frees
3) use after free
4) overrun
Implementation:
-- for each allocation, there is a:
1) stack trace at the time the allocation is made
2) if the memory is freed, there is also a stack trace at the point
3) a front and rear guard (fence)
4) the stack traces are kept together with the allocation
-- the following lists and maintained
1) all outstanding memory allocations
3) a backlog of allocations what are freed; when you call free(), instead of
actually freed, the allocation is moved to this backlog;
4) when the backlog of allocations gets full, the oldest entry gets evicted
from it; at that point, the allocation is checked for overruns or
use-after-free errors, and then actually freed.
5) when the program exits, the list of outstanding allocations and the
backlog are inspected for errors, then freed;
To use this, set the following system properties before running the process or
processes you want to inspect:
libc.malloc.debug.backlog # defaults to 100
libc.malloc.debug 10
When a problem is detected, you will see the following on logcat for a multiple
free:
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 BYTES MULTIPLY FREED!
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc
4009647c /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 FIRST FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c7d2 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc
40096490 /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 NOW BEING FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c6ac /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc
400964a0 /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
The following for a heap overrun and underrun:
E/libc ( 7233): +++ REAR GUARD MISMATCH [10, 11)
E/libc ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 HAS A CORRUPTED REAR GUARD
E/libc ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc
40096438 /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c7d2 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc
40096462 /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 HAS A CORRUPTED FRONT GUARD
E/libc ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc
400964ba /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
E/libc ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 FREED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c7d2 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d94 /system/lib/libc.so
E/libc ( 7233): #03 pc
400964e4 /system/bin/malloctest
E/libc ( 7233): #04 pc
00016f24 /system/lib/libc.so
The following for a memory leak:
E/libc ( 7233): +++ THERE ARE 1 LEAKED ALLOCATIONS
E/libc ( 7233): +++ DELETING 4096 BYTES OF LEAKED MEMORY AT 0x404b95e8 (1 REMAINING)
E/libc ( 7233): +++ ALLOCATION 0x404b95e8 SIZE 4096 ALLOCATED HERE:
E/libc ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc ( 7233): #00 pc
0000c35a /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #01 pc
0000c658 /system/lib/libc_malloc_debug_leak.so
E/libc ( 7233): #02 pc
00016d80 /system/lib/libc.so
E/libc ( 7233): #03 pc
0001bc94 /system/lib/libc.so
E/libc ( 7233): #04 pc
0001edf6 /system/lib/libc.so
E/libc ( 7233): #05 pc
0001b80a /system/lib/libc.so
E/libc ( 7233): #06 pc
0001c086 /system/lib/libc.so
E/libc ( 7233): #07 pc
40096402 /system/bin/malloctest
E/libc ( 7233): #08 pc
00016f24 /system/lib/libc.so
Change-Id: Ic440e9d05a01e2ea86b25e8998714e88bc2d16e0
Signed-off-by: Iliyan Malchev <malchev@google.com>
The Android Automerger [Thu, 31 May 2012 13:59:25 +0000 (06:59 -0700)]
merge in jb-release history after reset to jb-dev
Iliyan Malchev [Tue, 29 May 2012 23:46:17 +0000 (16:46 -0700)]
bionic: introduce libc.debug.malloc.program
libc.debug.malloc.program provides an additional level of control over which
processes to enable libc.debug.malloc functionality for. The string value of
libc.debug.malloc.program is matched against the program name; if the value of
libc.debug.malloc.program is a substring of the program name, then malloc debug
is applied to that program at whatever level libc.debug.malloc specifies.
If lib.debug.malloc.program is not specified, then libc.debug.malloc has the
same effect as before.
For example, to enable libc.deubug.malloc = 10 only to the mediaserver, do the
following:
adb root # necessary for setprop
adb setprop libc.debug.malloc.program mediaserver
adb setprop libc.debug.malloc 10
adb kill -9 $(pid mediaserver)
Change-Id: I6f01c12f033c8e2e015d73025369d7f1685ba200
Signed-off-by: Iliyan Malchev <malchev@google.com>
Geremy Condra [Wed, 30 May 2012 18:06:54 +0000 (11:06 -0700)]
Merge "Ensure that the port number and TXID are properly randomized." into jb-dev
Ben Cheng [Thu, 24 May 2012 23:56:53 +0000 (16:56 -0700)]
Print the corrupted address passed to free().
For example:
@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942
The addr=0x5c3bfbd0 part is new.
Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
Ben Cheng [Thu, 24 May 2012 23:56:53 +0000 (16:56 -0700)]
Print the corrupted address passed to free().
For example:
@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942
The addr=0x5c3bfbd0 part is new.
Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
Geremy Condra [Mon, 21 May 2012 21:20:59 +0000 (14:20 -0700)]
Ensure that the port number and TXID are properly randomized.
This fix reads from /dev/urandom to get the required entropy.
Bug:
6535492
Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
The Android Automerger [Thu, 10 May 2012 13:59:27 +0000 (06:59 -0700)]
merge in jb-release history after reset to jb-dev
Prajakta Gudadhe [Mon, 7 May 2012 21:17:44 +0000 (14:17 -0700)]
bionic: add support for non-NEON memcpy() on NEON SoCs
Some SoCs that support NEON nevertheless perform better with a non-NEON than a
NEON memcpy(). This patch adds build variable ARCH_ARM_USE_NON_NEON_MEMCPY,
which can be set in BoardConfig.mk. When ARCH_ARM_USE_NON_NEON_MEMCPY is
defined, we compile in the non-NEON optimized memcpy() even if the SoC supports
NEON.
Change-Id: Ia0e5bee6bad5880ffc5ff8f34a1382d567546cf9
The Android Automerger [Wed, 9 May 2012 14:46:07 +0000 (07:46 -0700)]
merge in jb-release history after reset to jb-dev
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-picked from master]
BUG:
6455193
Change-Id: I0102355f5bf20e636d3feab9d1424495f38e39e2
The Android Automerger [Mon, 30 Apr 2012 13:59:25 +0000 (06:59 -0700)]
merge in jb-release history after reset to jb-dev
Mike Lockwood [Thu, 26 Apr 2012 20:10:25 +0000 (13:10 -0700)]
Merge "Update f_accessory.h kernel header" into jb-dev
Nick Kralevich [Thu, 26 Apr 2012 16:54:48 +0000 (09:54 -0700)]
libc: continue to use Android's custom linker script
By default, Android no longer compiles code using it's custom
linker script /build/core/armelf.xsc. However, this causes
problems for libc. Certain programs linked using older versions
of GOLD expect libc.so to export __exidx_start and __exidx_end.
Removing the custom linker script causes libc.so not to export
those symbols.
For now, continue using the old linker script, until we can
figure out a better solution.
Change-Id: Iaf002afd63a58b848818da24e5a4525620dc4d74
Mike Lockwood [Tue, 17 Apr 2012 17:41:34 +0000 (10:41 -0700)]
Update f_accessory.h kernel header
Change-Id: I29ec4aa4843b9308cbfa412df88e026e8475b715
Signed-off-by: Mike Lockwood <lockwood@google.com>
The Android Automerger [Wed, 25 Apr 2012 14:47:06 +0000 (07:47 -0700)]
merge in jb-release history after reset to jb-dev
Nick Kralevich [Mon, 23 Apr 2012 23:50:00 +0000 (16:50 -0700)]
linker: remove STB_LOCAL hack
The ARM static linker wasn't properly handling __exidx_start
and __exidx_end symbols. Now that the static linker has been fixed,
we don't need the dynamic linker to work around this problem.
Change-Id: I041b94903609fafab33663a7d441a5e70b7ffcdd
The Android Automerger [Thu, 19 Apr 2012 13:59:25 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Erik Gilling [Wed, 18 Apr 2012 22:37:01 +0000 (15:37 -0700)]
add linux/sw_sync.h
Change-Id: I79de18d04b950c21b985d5ebc01cd3306a43d318
Signed-off-by: Erik Gilling <konkers@android.com>
Erik Gilling [Wed, 18 Apr 2012 21:23:04 +0000 (14:23 -0700)]
add linux/sync.h
Change-Id: I38bb9498e18cb2b2e84a97487d4ad1e15fabd9d4
Signed-off-by: Erik Gilling <konkers@android.com>
The Android Automerger [Wed, 18 Apr 2012 13:59:34 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Evgeniy Stepanov [Wed, 18 Apr 2012 08:57:40 +0000 (12:57 +0400)]
Fix segv when unwinding stack past __libc_init.
This change mirrors
cd15bac for statically-linked binaries.
Change-Id: Id870832a50b37f0ef3e79e1ed03ed31390bfc9ef
The Android Automerger [Tue, 17 Apr 2012 13:59:17 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Elliott Hughes [Mon, 16 Apr 2012 21:40:26 +0000 (14:40 -0700)]
resolved conflicts for merge of
35d592cc to master
Change-Id: I8184302daf61814d26c837f9920b4e68d96d7f65
Elliott Hughes [Mon, 16 Apr 2012 21:26:43 +0000 (14:26 -0700)]
resolved conflicts for merge of
ef987656 to master
Change-Id: I3854de8f4cddaf344444efa6f9da027642a237d9
Elliott Hughes [Mon, 16 Apr 2012 21:16:42 +0000 (14:16 -0700)]
resolved conflicts for merge of
6b8fd054 to master
Change-Id: Ifc5a10d9c2f7764ad80d64cc552aad81d5fbf5eb
Elliott Hughes [Mon, 16 Apr 2012 20:15:13 +0000 (13:15 -0700)]
am
ff219e57: am
6435d27f: Merge "bionic: fix NULL parameter failure in getcwd()"
* commit '
ff219e57c0ffe5ac2816f79677ce4f1afa677277':
bionic: fix NULL parameter failure in getcwd()
Elliott Hughes [Mon, 16 Apr 2012 20:12:47 +0000 (13:12 -0700)]
am
418e647a: Merge "libstdc++: Fix x86 thread-safe one-time-construction implementation."
* commit '
418e647a8300bb8e62b6b73814a5211152cbaacd':
libstdc++: Fix x86 thread-safe one-time-construction implementation.
Elliott Hughes [Mon, 16 Apr 2012 20:12:46 +0000 (13:12 -0700)]
am
4994deae: Merge "Bionic: Fix wrong prototype of system call clock_nanosleep"
* commit '
4994deaef51d5fa1ac12e6160b47d9cbe3b2bc43':
Bionic: Fix wrong prototype of system call clock_nanosleep
Elliott Hughes [Mon, 16 Apr 2012 20:12:46 +0000 (13:12 -0700)]
am
7b8666e6: Merge "bionic: Fix wrong prototype of system call getresuid/getresgid"
* commit '
7b8666e683e56549091b86fd7b9c421fd0124dbc':
bionic: Fix wrong prototype of system call getresuid/getresgid
Elliott Hughes [Mon, 16 Apr 2012 20:12:45 +0000 (13:12 -0700)]
am
6435d27f: Merge "bionic: fix NULL parameter failure in getcwd()"
* commit '
6435d27f9d45d01fbd15bcc3dcd9617b86b825bb':
bionic: fix NULL parameter failure in getcwd()
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>
The Android Automerger [Mon, 16 Apr 2012 13:59:27 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
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 [Sat, 14 Apr 2012 00:10:06 +0000 (17:10 -0700)]
am
cebc8fb0: am
6bc18fa5: Merge "libm: fix invalid result of function remquo/remquof"
* commit '
cebc8fb0862a8e1ecd86f9d09b0a3fca0f0781fa':
libm: fix invalid result of function remquo/remquof
Elliott Hughes [Sat, 14 Apr 2012 00:07:43 +0000 (17:07 -0700)]
am
6bc18fa5: Merge "libm: fix invalid result of function remquo/remquof"
* commit '
6bc18fa58849a4307cf6ddcfd526d9258e8175fc':
libm: fix invalid result of function remquo/remquof
Kenny Root [Fri, 13 Apr 2012 23:03:51 +0000 (16:03 -0700)]
Merge changes I427a1881,I959b6428
* changes:
Add faccessat to syscall list
Update unistd.h for new syscalls
Kenny Root [Fri, 13 Apr 2012 21:56:25 +0000 (14:56 -0700)]
Add faccessat to syscall list
Change-Id: I427a18811089cb280769ac8da3ed8adc00a65a10
Elliott Hughes [Fri, 13 Apr 2012 21:57:59 +0000 (14:57 -0700)]
Merge "libm: fix invalid result of function remquo/remquof"
Kenny Root [Fri, 13 Apr 2012 21:50:14 +0000 (14:50 -0700)]
Update unistd.h for new syscalls
gensyscalls.py run from external/kernel-headers at commit
efab8f3e49f7f36ef0354b0996ecd5f3fa031e52
Change-Id: I959b64280e184655ef8c713aa79f9e23cb1f7df4
Travis Geiselbrecht [Thu, 12 Apr 2012 23:09:29 +0000 (16:09 -0700)]
am
0613dce0: regenerate linux/fb.h
* commit '
0613dce0a7b806d48758cabfb2d638d0ba4dd2bc':
regenerate linux/fb.h
Travis Geiselbrecht [Thu, 12 Apr 2012 21:51:43 +0000 (14:51 -0700)]
regenerate linux/fb.h
Change-Id: Icd8c0f53306a48ffd513378abdf387af21e886a3
Evgeniy Stepanov [Thu, 22 Mar 2012 14:01:53 +0000 (18:01 +0400)]
Initialize TLS before any application code is run.
Since
e19d702b8e33, dlsym and friends use recursive mutexes that
require the current thread id, which is not available before the libc
constructor. This prevents us from using dlsym() in .preinit_array.
This change moves TLS initialization from libc constructor to the earliest
possible point - immediately after linker itself is relocated. As a result,
pthread_internal_t for the initial thread is available from the start.
As a bonus, values stored in TLS in .preinit_array are not lost when libc is
initialized.
Change-Id: Iee5a710ee000173bff63e924adeb4a4c600c1e2d
Elliott Hughes [Thu, 12 Apr 2012 18:52:44 +0000 (11:52 -0700)]
Merge "Fix segv when unwinding stack past __libc_init."
The Android Automerger [Thu, 12 Apr 2012 13:59:24 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Kenny Root [Wed, 11 Apr 2012 21:16:04 +0000 (14:16 -0700)]
Move end of __on_dlclose up
The END macro was put too far down which made the linker complain about
it. Move up to the end of the code.
Change-Id: Ica71a9c6083b437d2213c7cefe34b0083c78f16b
The Android Automerger [Wed, 11 Apr 2012 13:59:29 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Kenny Root [Wed, 11 Apr 2012 00:24:24 +0000 (17:24 -0700)]
__on_dlclose should be aligned
Marking segments read-only was pushing the alignment of __on_dlclose by
2 bytes making it unaligned. This change makes sure the ARM code is
aligned to the 4 byte boundary.
Bug:
6313309
Change-Id: Ic2bf475e120dd61225ec19e5d8a9a8b1d0b7f081
Nick Kralevich [Tue, 10 Apr 2012 20:42:06 +0000 (13:42 -0700)]
Revert "linker: remove STB_LOCAL hack"
This reverts commit
61ff83475c6f3a3bb05a01ac89d668a331bfe9e9.
This code is harmless, and only applies to the linker, so
there's no harm in keeping it in the tree a little bit longer.
Let's roll this back while we try to figure out the root cause
of bug
6314858.
Bug:
6314858
Change-Id: I9f5ed81d23a7abe273baf792aa8a0a2839ef094c
Nick Kralevich [Tue, 10 Apr 2012 20:42:06 +0000 (13:42 -0700)]
Revert "linker: remove STB_LOCAL hack"
This reverts commit
61ff83475c6f3a3bb05a01ac89d668a331bfe9e9.
This code is harmless, and only applies to the linker, so
there's no harm in keeping it in the tree a little bit longer.
Let's roll this back while we try to figure out the root cause
of bug
6314858.
Bug:
6314858
Change-Id: I9f5ed81d23a7abe273baf792aa8a0a2839ef094c
The Android Automerger [Tue, 10 Apr 2012 13:59:26 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Evgeniy Stepanov [Tue, 10 Apr 2012 10:10:11 +0000 (14:10 +0400)]
Fix segv when unwinding stack past __libc_init.
This change fixes a segmentation fault in the libc unwinder when it goes
past __libc_init.
Unwind instructions for __libc_init direct it to grab the return address from
the stack frame. Without this change, the unwinder gets a wild address and
looks up further unwind instructions for the routine at that address. If it's
unlucky enough to hit an existing function, it will try to unwind it. Bad
things happen then.
With this change, the return address always points to the _start function,
which does not have unwind instructions associated with it. This stop the
unwind process.
__libc_init never returns, so this does not affect program execution, other
than adding 4 bytes on the main thread stack.
Change-Id: Id58612172e8825c8729cccd081541a13bff96bd0
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>
Nick Kralevich [Mon, 9 Apr 2012 20:41:14 +0000 (13:41 -0700)]
Merge "linker: remove STB_LOCAL hack"
Nick Kralevich [Mon, 9 Apr 2012 19:50:17 +0000 (12:50 -0700)]
linker: remove STB_LOCAL hack
The ARM static linker wasn't properly handling __exidx_start
and __exidx_end symbols. Now that the static linker has been fixed,
we don't need the dynamic linker to work around this problem.
Change-Id: Ic567122b6c7746cc016795e2befba2c6bd7c0478
Jeff Brown [Mon, 9 Apr 2012 18:24:27 +0000 (11:24 -0700)]
Merge "Update linux/input.h to version 3.4."
The Android Automerger [Mon, 9 Apr 2012 13:59:24 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Jeff Brown [Sat, 7 Apr 2012 02:24:35 +0000 (19:24 -0700)]
Update linux/input.h to version 3.4.
Bug:
6292993
Change-Id: Ic7628068df6c8de9cb3711a4540d51365b96ebdb
Dima Zavin [Mon, 2 Apr 2012 19:57:03 +0000 (12:57 -0700)]
libc/kernel: update cleaned v4l2 header
Change-Id: Ib3747b45eb1e4095cca3de6d7692387953e8c4a7
Signed-off-by: Dima Zavin <dima@android.com>
JP Abgrall [Fri, 6 Apr 2012 03:36:36 +0000 (20:36 -0700)]
Merge "libc/kernel-headers: Auto generated files for netfilter/xt_IDLETIMER"
Ashish Sharma [Fri, 6 Apr 2012 02:50:42 +0000 (19:50 -0700)]
libc/kernel-headers: Auto generated files for netfilter/xt_IDLETIMER
From Change I526b5fce: Add NETLINK_IDLETIMER msg type and include the corresponding header file.
Change-Id: I24bffc11394c8664e4d7d7f439b0600545f07536
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
The Android Automerger [Thu, 5 Apr 2012 13:59:23 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Nick Kralevich [Wed, 4 Apr 2012 19:43:32 +0000 (12:43 -0700)]
linker: surround "debug_verbosity" by "#if LINKER_DEBUG"
Avoid executing useless code when we're not compiled
with debugging support.
Change-Id: Iea1821b241acacdf65d1a91d743356058dfef273
Nick Kralevich [Wed, 4 Apr 2012 17:18:27 +0000 (10:18 -0700)]
linker: enable -fvisibility=hidden
Compile the linker with -fvisibility=hidden. This reduces the number
of symbols that show up in the .dynsym section of the linker.
These symbols are never exported to other applications.
In particular, this fixes a problem with setting -DLINKER_DEBUG=1
introduced in
468319ce4f3f7383d788b76c09cda2a405311f36.
Because the symbols "debug_verbosity" and "format_log" have not been
resolved before the linker links itself, any attempt to call
PRINT / INFO / TRACE / WARN / ERROR will result in a segfault.
This change allows the static linker to produce a relative reference
to these symbols rather than relying on relocation.
This also has a nice side effect of making the linker slightly smaller
and slightly more optimized.
The following symbols no longer in the .dynsym section of the linker
after this change:
-addr_to_name
-call_constructors_recursi
-calloc
-debugger_init
-debugger_signal_handler
-debug_verbosity
-dladdr
-dlclose
-dlerror
-dl_lock
-dlopen
-dlsym
-dl_unwind_find_exidx
-find_containing_library
-find_containing_symbol
-find_library
-format_buffer
-free
-libdl_info
-linker_env_get
-linker_env_init
-linker_env_secure
-linker_env_unset
-linker_get_error
-__linker_init
-lookup
-lookup_in_library
-malloc
-notify_gdb_of_libraries
-notify_gdb_of_load
-notify_gdb_of_unload
-realloc
-rtld_db_dlactivity
-unload_library
-vsnprintf
Bug:
5827809
Change-Id: I5e8cd7dcf48c1d6831a970a67f63f24916c5e437
Mike Lockwood [Tue, 3 Apr 2012 18:35:33 +0000 (11:35 -0700)]
Merge remote-tracking branch 'goog/ics-aah'
The Android Automerger [Tue, 3 Apr 2012 10:27:58 +0000 (03:27 -0700)]
merge in jb-release history after reset to master
Elliott Hughes [Mon, 2 Apr 2012 23:09:36 +0000 (16:09 -0700)]
am
fdb11929: am
b88f810d: Merge "Update to tzdata2012c."
* commit '
fdb119297ac421e2fc2ec096a6d5370b81938de8':
Update to tzdata2012c.
Elliott Hughes [Mon, 2 Apr 2012 23:07:46 +0000 (16:07 -0700)]
am
b88f810d: Merge "Update to tzdata2012c."
* commit '
b88f810d585a1736a1759c2c22e9f4999441ae00':
Update to tzdata2012c.
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
The Android Automerger [Mon, 2 Apr 2012 13:59:31 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Elliott Hughes [Sat, 31 Mar 2012 05:16:02 +0000 (22:16 -0700)]
am
cd834618: am
63b14755: Merge "libc/x86: ensure the stack 16-byte aligned when tasks created"
* commit '
cd834618c4752b61d54ff4005a8baa8219b822e4':
libc/x86: ensure the stack 16-byte aligned when tasks created
Elliott Hughes [Fri, 30 Mar 2012 22:53:19 +0000 (15:53 -0700)]
am
63b14755: Merge "libc/x86: ensure the stack 16-byte aligned when tasks created"
* commit '
63b14755512d515762cbe3ad8544c561a576f32e':
libc/x86: ensure the stack 16-byte aligned when tasks created
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"
Dima Zavin [Fri, 30 Mar 2012 17:21:16 +0000 (10:21 -0700)]
Revert "libc/kernel: Add rules to autogenerate device specific kernel headers"
This reverts commit
884147c7d0b1b6571256feb11e12d893432625b2.
Change-Id: I09723858ac961f3e1155791aa5c54d5d3abfbd36
Signed-off-by: Dima Zavin <dima@android.com>
The Android Automerger [Wed, 28 Mar 2012 13:59:31 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Elliott Hughes [Wed, 28 Mar 2012 00:58:57 +0000 (17:58 -0700)]
am
ea76f414: am
d509f9cc: 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 '
ea76f4147825cc39d9aa91230cd863ed29f28e27':
[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 [Wed, 28 Mar 2012 00:57:41 +0000 (17:57 -0700)]
am
d509f9cc: 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 '
d509f9ccbba6e1dd53acfd7425bfc06d6b3f8693':
[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 [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 17:10:50 +0000 (10:10 -0700)]
am
b52c941e: am
d7c6147e: am
56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit '
b52c941ed4f24134b78a73daee84bdc328f969da':
bionic: fix atfork hanlder_mutex deadlock
The Android Automerger [Tue, 27 Mar 2012 13:59:30 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Jean-Baptiste Queru [Tue, 27 Mar 2012 01:29:23 +0000 (18:29 -0700)]
am
d7c6147e: am
56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit '
d7c6147eff65572762d55950b965db949ccd0281':
bionic: fix atfork hanlder_mutex deadlock
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
Benoit Goby [Tue, 27 Mar 2012 00:14:24 +0000 (17:14 -0700)]
Merge "Add auto-generated headers for USB FunctionFS"
Jean-Baptiste Queru [Mon, 26 Mar 2012 23:19:35 +0000 (16:19 -0700)]
Merge "bionic: fix atfork hanlder_mutex deadlock"
Jean-Baptiste Queru [Mon, 26 Mar 2012 22:25:19 +0000 (15:25 -0700)]
Handle pthread-related changes (mutex/atfork)
First commit:
Revert "Revert "am
be741d47: am
2f460fbe: am
73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"""
This reverts commit
06823da2f0c8b4a4ce4c45113032f03df85c94b8.
Second commit:
bionic: fix atfork hanlder_mutex deadlock
This cherry-picks commit
34e89c232dd5645fe3b5f9b40856d8e3e4cae57a
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>
Change-Id: Ic8072f366a877443a60fe215f3c00b3df5a259c8
Benoit Goby [Tue, 6 Mar 2012 00:10:41 +0000 (16:10 -0800)]
Add auto-generated headers for USB FunctionFS
linux/usb/ch9.h and linux/usb/functionfs.h
Change-Id: I2907081aba63b32740eb9916315759692a96ab42
The Android Automerger [Mon, 26 Mar 2012 13:59:35 +0000 (06:59 -0700)]
merge in jb-release history after reset to master
Andrew Hsieh [Fri, 23 Mar 2012 15:07:36 +0000 (23:07 +0800)]
Fixed to #include correct 32-bit headers; Refreshed libc/kernel headers
This patch fixes an issue where 64-bit hreaders are incorrectly included
in kernel headers. For example, file "libc/kernel/arch-x86/asm/io.h"
incorreclty includes "io_64.h" (missing, BTW) instead of "io_32.h".
The reason is because CONFIG_X86_32 isn't considered pre-defined in
"kernel_default_arch_macros" for x86, and clean_header.py doesn't
look at it at all anyway (ie. __i386__ is also ignored, but it's
okay since x86 cross compiler defines it back)
Fixed 2 tools/*py, README.TXT, and refreshed libc/kernel headers
Change-Id: Iac834cc8b3548f055d3f2a214af36072dd679fe8
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>
Ben Cheng [Wed, 21 Mar 2012 22:47:12 +0000 (15:47 -0700)]
Initialize mspace->least_addr properly in the mmap path.
BUG:
6206963
Change-Id: Id2ab580246de50a4511b56a734a7bece98fb945c