Commit Graph

6431 Commits

Author SHA1 Message Date
Elliott Hughes
0e309c87ab am 0df47ece: am d5a59aa7: am 1b2d214b: Merge "Clean up forking and cloning."
* commit '0df47ece78b2e596dde3a2369b44917842bbbd4b':
  Clean up forking and cloning.
2013-11-21 08:12:58 -08:00
Narayan Kamath
241776e21e am 6e5fda6b: am 22b8c53e: am 9d70ddc4: Merge "Add test case for 1^NaN"
* commit '6e5fda6b6d2b15155d8ca1ef586cf8ce6e04a067':
  Add test case for 1^NaN
2013-11-21 08:12:57 -08:00
Elliott Hughes
7a7429b4f7 am 67026112: am 8154f010: am 318e86ed: Merge "bionic: call stdio cleanup on exit"
* commit '67026112a00b94f9d13c3adea2ffbb4fb83d55c5':
  bionic: call stdio cleanup on exit
2013-11-21 08:12:57 -08:00
Elliott Hughes
9280a859a6 am 86ae0ff1: am 044d4655: am 303fe0cb: Merge "Fix pthread_join."
* commit '86ae0ff135456b2b695f49cf40ccc4e8ebc60f51':
  Fix pthread_join.
2013-11-21 08:12:56 -08:00
Christopher Ferris
54b98c638a am 37e5c6ba: am 750668f5: am 862faa12: Merge "Pull in cleaned version.h header."
* commit '37e5c6ba89b9daca67b1c09e2b73b4c6eac805a5':
  Pull in cleaned version.h header.
2013-11-21 08:12:55 -08:00
Christopher Ferris
7dd95f4fc5 am e4bc301a: am da12e64f: am be8344bb: Merge "Modify tests for another glibc difference."
* commit 'e4bc301aa50071d09d268f661be72647a491a8c0':
  Modify tests for another glibc difference.
2013-11-21 08:12:55 -08:00
Elliott Hughes
0a0fb39e8a am a8276f64: am 18368fc8: am f246c589: Merge "Clean up the pthread_create trampoline."
* commit 'a8276f64b203a01d1b393a11dc9c492d1a6557e3':
  Clean up the pthread_create trampoline.
2013-11-21 08:12:54 -08:00
Christopher Ferris
7bbc82d620 am b343d221: am 862c32b4: am e39e3a77: Merge "Add new tests for memory/string routines."
* commit 'b343d221103432f67df366a95c06a69d23ddbd1b':
  Add new tests for memory/string routines.
2013-11-21 08:12:53 -08:00
Elliott Hughes
6442706d42 am 00f25edc: am 5b524852: am 645d4269: Merge "Switch pthread_create over to __bionic_clone."
* commit '00f25edccace521bc4cbc3cfe3d05e8e1a9b6652':
  Switch pthread_create over to __bionic_clone.
2013-11-21 08:12:53 -08:00
Elliott Hughes
0df47ece78 am d5a59aa7: am 1b2d214b: Merge "Clean up forking and cloning."
* commit 'd5a59aa767d4d87738b53995d73461be2778b9ee':
  Clean up forking and cloning.
2013-11-21 08:10:07 -08:00
Narayan Kamath
6e5fda6b6d am 22b8c53e: am 9d70ddc4: Merge "Add test case for 1^NaN"
* commit '22b8c53ef6fffdc83bd730563c30eb8ce93e46df':
  Add test case for 1^NaN
2013-11-21 08:10:04 -08:00
Elliott Hughes
67026112a0 am 8154f010: am 318e86ed: Merge "bionic: call stdio cleanup on exit"
* commit '8154f010a1c017b56ec7de3014e3ddf958f92536':
  bionic: call stdio cleanup on exit
2013-11-21 08:10:03 -08:00
Elliott Hughes
86ae0ff135 am 044d4655: am 303fe0cb: Merge "Fix pthread_join."
* commit '044d4655b7c06c9d5988f7dc604e59f76e098f5d':
  Fix pthread_join.
2013-11-21 08:10:02 -08:00
Christopher Ferris
37e5c6ba89 am 750668f5: am 862faa12: Merge "Pull in cleaned version.h header."
* commit '750668f5abd9813bea6f33cb84d941ae306afea8':
  Pull in cleaned version.h header.
2013-11-21 08:09:59 -08:00
Christopher Ferris
e4bc301aa5 am da12e64f: am be8344bb: Merge "Modify tests for another glibc difference."
* commit 'da12e64f1770deee4f5d0b4c41d5530a98b21073':
  Modify tests for another glibc difference.
2013-11-21 08:09:57 -08:00
Elliott Hughes
a8276f64b2 am 18368fc8: am f246c589: Merge "Clean up the pthread_create trampoline."
* commit '18368fc8e696c54adbd1537bf2d7c5c217210957':
  Clean up the pthread_create trampoline.
2013-11-21 08:09:46 -08:00
Christopher Ferris
b343d22110 am 862c32b4: am e39e3a77: Merge "Add new tests for memory/string routines."
* commit '862c32b4bd73f2348ebd9b1267e2880afcf3be1b':
  Add new tests for memory/string routines.
2013-11-21 08:09:44 -08:00
Elliott Hughes
00f25edcca am 5b524852: am 645d4269: Merge "Switch pthread_create over to __bionic_clone."
* commit '5b5248526b0295e54f51dcc2fec6c1d8e5a3b9e2':
  Switch pthread_create over to __bionic_clone.
2013-11-21 08:09:43 -08:00
Elliott Hughes
d5a59aa767 am 1b2d214b: Merge "Clean up forking and cloning."
* commit '1b2d214b62ad7bf46f37c79442a69d930aa29027':
  Clean up forking and cloning.
2013-11-19 14:12:38 -08:00
Elliott Hughes
1b2d214b62 Merge "Clean up forking and cloning." 2013-11-19 22:09:54 +00:00
Elliott Hughes
36d6188f8c Clean up forking and cloning.
The kernel now maintains the pthread_internal_t::tid field for us,
and __clone was only used in one place so let's inline it so we don't
have to leave such a dangerous function lying around. Also rename
files to match their content and remove some useless #includes.

Change-Id: I24299fb4a940e394de75f864ee36fdabbd9438f9
2013-11-19 14:08:54 -08:00
Narayan Kamath
22b8c53ef6 am 9d70ddc4: Merge "Add test case for 1^NaN"
* commit '9d70ddc466ed0bdb36908d69b1fe849904150eb7':
  Add test case for 1^NaN
2013-11-19 01:59:28 -08:00
Narayan Kamath
9d70ddc466 Merge "Add test case for 1^NaN" 2013-11-19 09:56:53 +00:00
Elliott Hughes
8154f010a1 am 318e86ed: Merge "bionic: call stdio cleanup on exit"
* commit '318e86ed887e04e593f3db9b84b402d5501ced9b':
  bionic: call stdio cleanup on exit
2013-11-18 20:05:09 -08:00
Elliott Hughes
318e86ed88 Merge "bionic: call stdio cleanup on exit" 2013-11-19 04:01:55 +00:00
Elliott Hughes
044d4655b7 am 303fe0cb: Merge "Fix pthread_join."
* commit '303fe0cb38def66aa438b9caac32e5af298f840a':
  Fix pthread_join.
2013-11-18 19:51:34 -08:00
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
24cbf1991a am 04b4339a: am 60a67a0c: am 05ec00bf: Merge "[MIPS] Reimplement syscall to invoke the system call directly"
* commit '04b4339ad5396690329877df10fbe568bd4dd600':
  [MIPS] Reimplement syscall to invoke the system call directly
2013-11-14 17:09:48 -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