Commit Graph

6257 Commits

Author SHA1 Message Date
Elliott Hughes
303fe0cb38 Merge "Fix pthread_join." 2013-11-19 03:49:00 +00:00
Elliott Hughes
877ec6d904 Fix pthread_join.
Let the kernel keep pthread_internal_t::tid updated, including
across forks and for the main thread. This then lets us fix
pthread_join to only return after the thread has really exited.

Also fix the thread attributes of the main thread so we don't
unmap the main thread's stack (which is really owned by the
dynamic linker and contains things like environment variables),
which fixes crashes when joining with an exited main thread
and also fixes problems reported publicly with accessing environment
variables after the main thread exits (for which I've added a new
unit test).

In passing I also fixed a bug where if the clone(2) inside
pthread_create(3) fails, we'd unmap the child's stack and TLS (which
contains the mutex) and then try to unlock the mutex. Boom! It wasn't
until after I'd uploaded the fix for this that I came across a new
public bug reporting this exact failure.

Bug: 8206355
Bug: 11693195
Bug: https://code.google.com/p/android/issues/detail?id=57421
Bug: https://code.google.com/p/android/issues/detail?id=62392
Change-Id: I2af9cf6e8ae510a67256ad93cad891794ed0580b
2013-11-18 19:48:11 -08:00
Pawit Pornkitprasan
652289942d bionic: call stdio cleanup on exit
As of 61e699a133, stdio clean up
functions are no longer registered in atexit and must be called
manually via __cleanup.

The issue this fixes is some static binaries linked against bionic
cannot output properly when piped or redirected because the buffer
is not flushed before closing.

This is done by pulling in exit.c (and other dependencies) from
netbsd.

Change-Id: I193e54a6d08900f291550029fe75ce76394d9e22
2013-11-19 09:49:17 +07:00
Christopher Ferris
750668f5ab am 862faa12: Merge "Pull in cleaned version.h header."
* commit '862faa12928038759e1bbdbc394a7d58b560f128':
  Pull in cleaned version.h header.
2013-11-18 15:29:38 -08:00
Christopher Ferris
862faa1292 Merge "Pull in cleaned version.h header." 2013-11-18 23:26:59 +00:00
Christopher Ferris
da12e64f17 am be8344bb: Merge "Modify tests for another glibc difference."
* commit 'be8344bb068183715f808768341bce7fb69d5a70':
  Modify tests for another glibc difference.
2013-11-18 13:38:12 -08:00
Christopher Ferris
be8344bb06 Merge "Modify tests for another glibc difference." 2013-11-18 21:35:21 +00:00
Narayan Kamath
af64dad479 Add test case for 1^NaN
Should be 1.

Change-Id: I6cf723a419f51d3bda58286a538774b71276c7b5
2013-11-18 19:00:59 +00:00
Christopher Ferris
e372ec8cf9 Pull in cleaned version.h header.
Change-Id: Ia917af9336b63ed5a10147770a8110134cb274cb
2013-11-15 16:29:28 -08:00
Christopher Ferris
cbd85b9cc1 Modify tests for another glibc difference.
It turns out that when passing a closed file to getdelim or getline, the
functions in glibc will properly return a failure, but errno might not be
set. Skip the errno check except on bionic.

Change-Id: I8d625f15303d4c2d42e8d28491ea8a368aea4d32
2013-11-15 16:09:44 -08:00
Elliott Hughes
18368fc8e6 am f246c589: Merge "Clean up the pthread_create trampoline."
* commit 'f246c589d66e5dc0e3cddc3c37261fb0e3fc67e9':
  Clean up the pthread_create trampoline.
2013-11-15 15:31:28 -08:00
Elliott Hughes
f246c589d6 Merge "Clean up the pthread_create trampoline." 2013-11-15 23:27:36 +00:00
Elliott Hughes
e48b68570d Clean up the pthread_create trampoline.
Bug: 8206355
Bug: 11693195
Change-Id: I35cc024d5b6ebd19d1d2e45610db185addaf45df
2013-11-15 14:57:45 -08:00
Christopher Ferris
862c32b4bd am e39e3a77: Merge "Add new tests for memory/string routines."
* commit 'e39e3a77d6e8cf681718a572bc754fd64dfc87ff':
  Add new tests for memory/string routines.
2013-11-15 14:51:02 -08:00
Elliott Hughes
5b5248526b am 645d4269: Merge "Switch pthread_create over to __bionic_clone."
* commit '645d4269d323acdcb20d1c31c15dbb4afbb9f46a':
  Switch pthread_create over to __bionic_clone.
2013-11-15 14:47:32 -08:00
Christopher Ferris
e39e3a77d6 Merge "Add new tests for memory/string routines." 2013-11-15 22:47:07 +00:00
Elliott Hughes
645d4269d3 Merge "Switch pthread_create over to __bionic_clone." 2013-11-15 22:42:57 +00:00
Elliott Hughes
70b24b1cc2 Switch pthread_create over to __bionic_clone.
Bug: 8206355
Bug: 11693195
Change-Id: I04aadbc36c87e1b7e33324b9a930a1e441fbfed6
2013-11-15 14:41:19 -08:00
Christopher Ferris
b687ad3c34 Add new tests for memory/string routines.
Create a few generic testing functions to allow any memory/string tests
to be created.

Add alignment tests for memcpy/memset/strcat/strcpy/strlen.

Add an overread test for memcpy/strcat/strcpy/strlen. This test attempts
to verify that the functions do not read past the end of their buffers
(src buffer in the case of src/dst functions).

Bug: 9797008

Change-Id: Ib3223ca1b99e729ae8229adc2d03f4dc3103d97c
2013-11-15 10:36:21 -08:00
Elliott Hughes
04b4339ad5 am 60a67a0c: am 05ec00bf: Merge "[MIPS] Reimplement syscall to invoke the system call directly"
* commit '60a67a0c7e44dfc47b9b4271ea4ae2dbf336849a':
  [MIPS] Reimplement syscall to invoke the system call directly
2013-11-14 17:07:13 -08:00
Elliott Hughes
60a67a0c7e am 05ec00bf: Merge "[MIPS] Reimplement syscall to invoke the system call directly"
* commit '05ec00bf62ac168c9787a3d0640879ab3e502fe5':
  [MIPS] Reimplement syscall to invoke the system call directly
2013-11-14 17:05:10 -08:00
Elliott Hughes
05ec00bf62 Merge "[MIPS] Reimplement syscall to invoke the system call directly" 2013-11-15 01:01:06 +00:00
Chris Dearman
effaa7824d [MIPS] Reimplement syscall to invoke the system call directly
Some MIPS kernels do not correctly restart interrupted system calls that
have been invoked using the indirect syscall (NR_syscall).

The simplest workaround is to handle the indirection in userland and then
call the required system call directly.

Change-Id: I8385399621529db9a52b463c96925f6decaaca30
2013-11-14 16:53:15 -08:00
Elliott Hughes
1b782289f4 am 5a70acd1: am ae5c3dd7: Merge "Remove the mips regdef.h and fpregdef.h old kernel headers."
* commit '5a70acd176a792868a61c94169d5e6c0679202f2':
  Remove the mips regdef.h and fpregdef.h old kernel headers.
2013-11-13 16:28:37 -08:00
Elliott Hughes
5a70acd176 am ae5c3dd7: Merge "Remove the mips regdef.h and fpregdef.h old kernel headers."
* commit 'ae5c3dd73844e6a9e1a14dbf893eab5142902f18':
  Remove the mips regdef.h and fpregdef.h old kernel headers.
2013-11-13 16:24:33 -08:00
Elliott Hughes
ae5c3dd738 Merge "Remove the mips regdef.h and fpregdef.h old kernel headers." 2013-11-14 00:18:58 +00:00
Elliott Hughes
007eced93b Remove the mips regdef.h and fpregdef.h old kernel headers.
Bug: 11559337
Change-Id: I6352cac9c4ef425cb21e34d0299223711ec079af
2013-11-13 16:13:01 -08:00
Elliott Hughes
ab894977da am 3cc7da48: am c4250430: Merge "Add unit tests for pow\'s behavior with NaNs."
* commit '3cc7da4838ea5896ff142f447ecb03f62d3e70e6':
  Add unit tests for pow's behavior with NaNs.
2013-11-13 15:05:43 -08:00
Elliott Hughes
3cc7da4838 am c4250430: Merge "Add unit tests for pow\'s behavior with NaNs."
* commit 'c425043063eae2fa3e8622bf77ef1ab3a805f156':
  Add unit tests for pow's behavior with NaNs.
2013-11-13 15:01:31 -08:00
Elliott Hughes
c425043063 Merge "Add unit tests for pow's behavior with NaNs." 2013-11-13 22:57:36 +00:00
Elliott Hughes
6010196355 am e77538d5: am 44cbe94b: Merge "Add a unit test for syscall(2)."
* commit 'e77538d570e8a811b09bdcd3c746471d8f74b3de':
  Add a unit test for syscall(2).
2013-11-13 13:37:18 -08:00
Elliott Hughes
e77538d570 am 44cbe94b: Merge "Add a unit test for syscall(2)."
* commit '44cbe94bba2e7e4b1369c86b11d66d6b60f0e333':
  Add a unit test for syscall(2).
2013-11-13 13:33:12 -08:00
Elliott Hughes
6a8f00d49c Add unit tests for pow's behavior with NaNs.
Bug: 11669804
Change-Id: Idfa6527640c8d0c2cf3e5343bf7afe013e237545
2013-11-13 13:29:23 -08:00
Elliott Hughes
44cbe94bba Merge "Add a unit test for syscall(2)." 2013-11-13 21:29:07 +00:00
Elliott Hughes
e61dc71efc Add a unit test for syscall(2).
Change-Id: Ic7d9735d46711af93c3a1747de7b2eb8cebea094
2013-11-13 13:14:31 -08:00
Elliott Hughes
3cf6d9983c am 6a7e539c: am 22ba86ee: Merge "Add extra regression tests for an already-fixed dynamic linker bug."
* commit '6a7e539cf1d8ee49fc2b6a11d043ce7962aa2de4':
  Add extra regression tests for an already-fixed dynamic linker bug.
2013-11-11 17:06:27 -08:00
Elliott Hughes
6a7e539cf1 am 22ba86ee: Merge "Add extra regression tests for an already-fixed dynamic linker bug."
* commit '22ba86ee44867c2d16973fc2f8da3b0f5b58cc5e':
  Add extra regression tests for an already-fixed dynamic linker bug.
2013-11-11 17:04:28 -08:00
Elliott Hughes
22ba86ee44 Merge "Add extra regression tests for an already-fixed dynamic linker bug." 2013-11-12 01:01:24 +00:00
Elliott Hughes
2ed710976c Add extra regression tests for an already-fixed dynamic linker bug.
Bug: https://code.google.com/p/android/issues/detail?id=61799
Change-Id: I84af68f8430a06e999297c2e57e06ecb45adf81e
2013-11-11 15:48:06 -08:00
Elliott Hughes
5c56512eeb am cdd6fdec: am 6768c1ee: Merge "Add a temporary uapi/linux/compiler.h until upstream has one."
* commit 'cdd6fdec6c8175b4b9f132a2b11c1fc5f20e8869':
  Add a temporary uapi/linux/compiler.h until upstream has one.
2013-11-08 15:25:38 -08:00
Elliott Hughes
cdd6fdec6c am 6768c1ee: Merge "Add a temporary uapi/linux/compiler.h until upstream has one."
* commit '6768c1ee510a8e93175b54e93cb583f009766eed':
  Add a temporary uapi/linux/compiler.h until upstream has one.
2013-11-08 15:22:43 -08:00
Elliott Hughes
6768c1ee51 Merge "Add a temporary uapi/linux/compiler.h until upstream has one." 2013-11-08 23:20:18 +00:00
Elliott Hughes
e9664fea54 am 5b6290bc: am ff5b0fc8: Merge "Remove the dependency on the non-uapi __kernel_nlink_t."
* commit '5b6290bcfb47ffb27a66450c9cc3258021e259fa':
  Remove the dependency on the non-uapi __kernel_nlink_t.
2013-11-08 15:17:19 -08:00
Elliott Hughes
5b6290bcfb am ff5b0fc8: Merge "Remove the dependency on the non-uapi __kernel_nlink_t."
* commit 'ff5b0fc8f3406c98561e17bd2a6c5433e192f5be':
  Remove the dependency on the non-uapi __kernel_nlink_t.
2013-11-08 15:15:18 -08:00
Elliott Hughes
740531354e Add a temporary uapi/linux/compiler.h until upstream has one.
Bug: 11559337
Change-Id: I205974b1a26e4f85d0e11503afa80669195d211c
2013-11-08 15:13:54 -08:00
Elliott Hughes
ff5b0fc8f3 Merge "Remove the dependency on the non-uapi __kernel_nlink_t." 2013-11-08 23:12:36 +00:00
Elliott Hughes
2ecc164ae9 Remove the dependency on the non-uapi __kernel_nlink_t.
The kernel doesn't have an nlink_t; it just uses the equivalent of
uint32_t. We already had a usable __nlink_t in the C library, so
let's just define our nlink_t in terms of __nlink_t, which is what
__nlink_t was meant for anyway.

Note that our struct stat just follows the kernel, and doesn't refer
to nlink_t anyway.

Change-Id: I2a56e418e42404b1741b08c50554b03c11caebae
2013-11-08 14:38:12 -08:00
Elliott Hughes
26d8853ab5 am cac7eec5: am 68723453: Merge "Generate the uapi headers for mips and x86/x86_64."
* commit 'cac7eec55a4853abfcd5b8d7bce35d79ab330132':
  Generate the uapi headers for mips and x86/x86_64.
2013-11-08 14:23:38 -08:00
Elliott Hughes
cac7eec55a am 68723453: Merge "Generate the uapi headers for mips and x86/x86_64."
* commit '68723453ac920004fcba2a820c2d56919a5b7081':
  Generate the uapi headers for mips and x86/x86_64.
2013-11-08 14:20:59 -08:00
Elliott Hughes
68723453ac Merge "Generate the uapi headers for mips and x86/x86_64." 2013-11-08 22:18:46 +00:00