Commit graph

1499 commits

Author SHA1 Message Date
Rabin Vincent
a73de44b7c am 177ba8cb: Prevent deadlock when using fork
* commit '177ba8cb42ed6d232e7c8bcad5e6ee21fc51a0e8':
  Prevent deadlock when using fork
2011-12-06 13:59:56 -08:00
Rabin Vincent
177ba8cb42 Prevent deadlock when using fork
When forking of a new process in bionic, it is critical that it
does not allocate any memory according to the comment in
java_lang_ProcessManager.c:
"Note: We cannot malloc() or free() after this point!
A no-longer-running thread may be holding on to the heap lock, and
an attempt to malloc() or free() would result in deadlock."
However, as fork is using standard lib calls when tracing it a bit,
they might allocate memory, and thus causing the deadlock.
This is a rewrite so that the function cpuacct_add, that fork calls,
will use system calls instead of standard lib calls.

Signed-off-by: christian bejram <christian.bejram@stericsson.com>

Change-Id: Iff22ea6b424ce9f9bf0ac8e9c76593f689e0cc86
2011-12-06 08:39:18 -08:00
Bruce Beare
35765066b9 am e4a21c89: signal: Align the sigset_t size passed to from user space to kernel.
* commit 'e4a21c89a8b24b32f7a2637b45522dfa59f2aaa4':
  signal: Align the sigset_t size passed to from user space to kernel.
2011-12-05 22:12:08 -08:00
Bruce Beare
cb835cd77c am cb1df916: string: Fix wrong comparison semantics
* commit 'cb1df9161666db2a312814752de67fc623149a9b':
  string: Fix wrong comparison semantics
2011-12-05 22:12:07 -08:00
Bruce Beare
e4a21c89a8 signal: Align the sigset_t size passed to from user space to kernel.
Pass kernel space sigset_t size to __rt_sigprocmask to workaround
the miss-match of NSIG/sigset_t definition between kernel and bionic.

Note: Patch originally from Google...
Change-Id: I4840fdc56d0b90d7ce2334250f04a84caffcba2a
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-05 18:37:33 -08:00
Bruce Beare
cb1df91616 string: Fix wrong comparison semantics
Chars are signed for x86 -- correct the comparison semantics.

Change-Id: I2049e98eb063c0b4e83ea973d3fcae49c6817dde
Author: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-05 18:37:10 -08:00
Bruce Beare
75039bafde am 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10
* commit '89d3fdcae26980bf81a4622c3c83e48ead4c1c3a':
  MALLOC_DEBUG: enable the option libc.debug.malloc = 10
2011-12-05 17:01:13 -08:00
Bruce Beare
89d3fdcae2 MALLOC_DEBUG: enable the option libc.debug.malloc = 10
Fix the compile warning to let the libc.debug.malloc=10 works well
Due to unsuitable value comparison, which cause compiler optimize the
code of comparing two digits.

Change-Id: I0bedd596c9ca2ba308fb008da20ecb328d8548f5
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Author: liu chuansheng <chuansheng.liu@intel.com>
2011-12-05 14:58:55 -08:00
Jack Ren
0c3d21e63c am e480fc83: bionic: fix pthread_{create, exit}/signal race condition
* commit 'e480fc83b2887388d469eb3bf58c86c610f5b082':
  bionic: fix pthread_{create, exit}/signal race condition
2011-11-29 22:42:32 -08:00
Jack Ren
621df52644 am 31e72bc3: bionic: fix __get_tls( ) crash issue
* commit '31e72bc3289acdd85b0b745fbf64c5949ca33432':
  bionic: fix __get_tls( ) crash issue
2011-11-29 22:42:31 -08:00
Zhenghua Wang
1ad08626a1 am 897815a1: bionic: add machine type check
* commit '897815a1feff230be3ea42655a77dcbb9a8dcca9':
  bionic: add machine type check
2011-11-29 22:42:30 -08:00
Jack Ren
e480fc83b2 bionic: fix pthread_{create, exit}/signal race condition
(1) in pthread_create:
    If the one signal is received before esp is subtracted by 16 and
    __thread_entry( ) is called, the stack will be cleared by kernel
    when it tries to contruct the signal stack frame. That will cause
    that __thread_entry will get a wrong tls pointer from the stack
    which leads to the segment fault when trying to access tls content.

(2) in pthread_exit
    After pthread_exit called system call unmap(), its stack will be
    freed.  If one signal is received at that time, there is no stack
    available for it.

Fixed by subtracting the child's esp by 16 before the clone system
call and by blocking signal handling before pthread_exit is started.

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:09:51 -08:00
Jack Ren
31e72bc328 bionic: fix __get_tls( ) crash issue
When running the stress test of pthread create/destroy, a crash may
oocur in __get_tls(). That is caused by the race condition with __set_tls( ):

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:09:15 -08:00
Zhenghua Wang
897815a1fe bionic: add machine type check
android linker doesn't check machine type, it may load some
libraries which it doesn't support sometimes.

Author: Zhenghua Wang <zhenghua.wang@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:01:08 -08:00
Eino-Ville Talvala
0d9f87a3b7 Add auto-exposure/auto-white balance lock support to soc2030 image
sensor.

Bug: 4980604
Change-Id: I1be07a23573b70eeddd9ecb2370605713aea3d03
2011-10-31 11:42:18 -07:00
Jesse Wilson
b0641d4a44 Merge "Use ENTRY and EXIT macros for strcmp, memcpy, atexit." 2011-10-12 07:51:53 -07:00
Evgeniy Stepanov
487b613e57 Use ENTRY and EXIT macros for strcmp, memcpy, atexit.
Without this change strcmp size is zero (not set), and it gets
ignored by Valgrind. Changes to memcpy and atexit don't affect the
generated binary in any way.

Change-Id: I05818cb5951f75901dc8c0eef02807a2e83a9231
2011-10-11 12:12:05 +04:00
Elliott Hughes
faa7c1d29f Update to tzdata2011l.
This affects Asia/Hebron and Pacific/Fiji (and historical data for
America/Sitka).

Change-Id: I111a34038e44416f1900f774bdb78750e815eb5f
2011-10-10 14:05:53 -07:00
David 'Digit' Turner
0a1b306fe1 am 32ca348e: am ce0d646c: resolved conflicts for merge of 6cda7b62 to gingerbread-plus-aosp
* commit '32ca348eecb114b9b2a9393f178c82310f590ddb':
  Bionic: x86: Fix libm macro definitions
2011-09-29 21:09:08 -07:00
David 'Digit' Turner
32ca348eec am ce0d646c: resolved conflicts for merge of 6cda7b62 to gingerbread-plus-aosp
* commit 'ce0d646cc0beb6b44d5429d01e51d00005264f44':
  Bionic: x86: Fix libm macro definitions
2011-09-29 21:03:00 -07:00
David 'Digit' Turner
ce0d646cc0 resolved conflicts for merge of 6cda7b62 to gingerbread-plus-aosp
Change-Id: I85bd5291c2a9cd29bff538b6d5a4dcd73f85a1fd
2011-09-30 05:56:51 +02:00
Lorenzo Colitti
229ab1a33e Merge "Send both A and AAAA queries if all probes fail." 2011-09-29 10:52:23 -07:00
Lorenzo Colitti
4638822fc0 Merge "Revert "Use framework hints to determine dns query type."" 2011-09-29 10:52:16 -07:00
Bruce Beare
6cda7b6249 Bionic: x86: Fix libm macro definitions
http://code.google.com/p/android/issues/detail?id=19276

GCC would remove inline asm due to lack of knowledge
of FPU register changes.

Change-Id: I9f9e8623fa6580843b7cd8178439ace8c2db2d51
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Author: Jingwei Zhang <jingwei.zhang@intel.com>
2011-09-29 17:35:33 +02:00
Lorenzo Colitti
f432de2de7 Send both A and AAAA queries if all probes fail.
AI_ADDRCONFIG is currently implemented by trying to connect
to well-known addresses in order to see if IPv4 and/or IPv6
connectivity is available.

In some cases (e.g., walled gardens with no global
connectivity) both probes can fail. If this happens,
query for both IPv4 and IPv6 addresses instead of doing
nothing and failing the query.

Bug: 5284168
Change-Id: I4e3a69ea86fb6d839a6bd31236b98da81e5cbf45
2011-09-28 22:38:08 -07:00
Lorenzo Colitti
b82532d11a Revert "Use framework hints to determine dns query type."
Change Ife82a8d8 broke IPv6 on wifi. Change I4e3a69ea is
an alternate approach that does not require any framework
changes.

Bug: 5284168
Change-Id: Ib52614be3875a2ae2eaedd1be265f90e506eda41
2011-09-28 22:37:41 -07:00
Mathias Agopian
bda5da074e fix prototype of dladdr
this breaks C++ source code in particular.

Change-Id: Ie06b5d31d23b5455e6950c470adc64dd5e7784df
2011-09-28 12:17:34 -07:00
Elliott Hughes
0096491274 Update to tzdata2011k.
Affects Palestine, Gaza, Hebron, Belarus, Ukraine, and "Russia".

Change-Id: Ib17f848c3b0e86d0bfcf289c4c4a3ae53dd2f8c4
2011-09-26 10:53:50 -07:00
Robert Greenwalt
924c8785f0 am 8af58f0f: Use framework hints to determine dns query type.
* commit '8af58f0fd4ff3fb11cb8a3c61e4654e3633906a4':
  Use framework hints to determine dns query type.
2011-09-22 23:39:54 -07:00
Robert Greenwalt
8af58f0fd4 Use framework hints to determine dns query type.
Instead of checking for IPv4 or IPv6 connectivity, try using pid-specific
hints the framework has left for us.

bug:5284168
Change-Id: Id64d48db3900865a7d58ada8309870c63d6eab12
2011-09-22 11:43:06 -07:00
JP Abgrall
771600415f am 3884bfe9: libc: popen: work around data corruption
* commit '3884bfe9661955543ce203c60f9225bbdf33f6bb':
  libc: popen: work around data corruption
2011-09-17 16:32:00 -07:00
JP Abgrall
3884bfe966 libc: popen: work around data corruption
vfork() would not save the registers that the parent would expect
to have restored after execl() completed.
Specially that execl() would call execve() underneath, further messing
up the stack of the parent.
To avoid that, we fork() for now. Later we will revisit and cleanup
vfork()+execve() to actually have vfork() store all the register
that the parent expects to see, and not those left by execve().

In the original code, looking at the registers just before the call to
popen(), and after the call showed that r7 would get clobbered.
This would leave the caller with an invalid pointer, leading to all
kinds of data corruptions.
execve() is simpler that execl() in this case.


Bug: 5336252
Change-Id: I3bf718c0bb4c0439f6f2753f153cdea14175be9c
2011-09-17 15:22:21 -07:00
Glenn Kasten
d53cae0e45 Add non-NDK internal API __pthread_gettid
Tracking bugs 5267571 and 5090073 (for deadlock detection logs).

Change-Id: Icb90f91ec1525607551c2234ef921bf88296484f
2011-09-16 12:38:28 -07:00
Erik Gilling
b8ef90d679 update linux/fb.h
Change-Id: Ib00343e3b6f95eaf3d347d4b8b9df950d0686e70
Signed-off-by: Erik Gilling <konkers@android.com>
2011-09-14 11:20:23 -07:00
Elliott Hughes
5da3ed177c Merge "Update to tzdata2011j." 2011-09-12 11:19:51 -07:00
Elliott Hughes
6ea19d7815 Update to tzdata2011j.
Affects Samoa, Kenya, Uganda, and Tanzania.

Change-Id: Ibee638d415d4f0389ff27ea1c9c481543e181f1f
2011-09-12 10:28:11 -07:00
Erik Gilling
763230ae55 update kernel video/dsscomp.h
Change-Id: Ifc4f96e3a9c3435c0b0ee80ac9da295b4e9463a1
Signed-off-by: Erik Gilling <konkers@android.com>
2011-09-07 12:53:22 -07:00
Robert Greenwalt
7f84da69f8 Add some logging of dns cache operations
Added info about what entries are getting flushed due to ttl or size limits.

Change-Id: I69fb70ce23b5b820f5f1a5738c0f1aa57b6a1127
2011-09-02 07:44:36 -07:00
David 'Digit' Turner
96e5faccdc am 91966c30: am 0acdbe08: am 89ea107d: Merge "linker: allow debugging of constructors"
* commit '91966c30efbdc7feecd6c45a46ab488e715c0a35':
  linker: allow debugging of constructors
2011-08-30 09:50:54 -07:00
David 'Digit' Turner
09b36dc7a9 am 35aebd36: am c7f5c8e2: am 0f7d9df1: Merge "libc: fix typo in kernel helper script"
* commit '35aebd36c771f32656996b02595fad8953f29916':
  libc: fix typo in kernel helper script
2011-08-30 09:50:52 -07:00
David 'Digit' Turner
91966c30ef am 0acdbe08: am 89ea107d: Merge "linker: allow debugging of constructors"
* commit '0acdbe0892105d01a38de9baf4e34eef22b8259c':
  linker: allow debugging of constructors
2011-08-29 18:01:05 -07:00
David 'Digit' Turner
35aebd36c7 am c7f5c8e2: am 0f7d9df1: Merge "libc: fix typo in kernel helper script"
* commit 'c7f5c8e2703c1dbeabe54d408b8819f97ef623f3':
  libc: fix typo in kernel helper script
2011-08-29 18:01:04 -07:00
David 'Digit' Turner
0acdbe0892 am 89ea107d: Merge "linker: allow debugging of constructors"
* commit '89ea107de51baaccb7ada150d1192b80c6faa642':
  linker: allow debugging of constructors
2011-08-29 17:57:59 -07:00
David 'Digit' Turner
c7f5c8e270 am 0f7d9df1: Merge "libc: fix typo in kernel helper script"
* commit '0f7d9df17f2f5a355b1b799a70219c18587482a6':
  libc: fix typo in kernel helper script
2011-08-29 17:57:57 -07:00
Nick Kralevich
38bccb271f linker.h: don't change the soinfo structure
In 48527c3f74, we modified the soinfo
structure to remove an unnecessary variable. However, third party
programs seem to be relying on the structure not changing.
Add a dummy variable back into place to preserve structure.

Bug: 5064106

Change-Id: I3014dda1a46e624644b09e156c3e9381ba3729bd
2011-08-29 13:52:18 -07:00
Elliott Hughes
b0bbbff606 Update to tzdata2011i.
Affects South Sudan (Africa/Juba), Samoa, Europe/Kalingrad, Newfoundland,
America/Resolute, Metlakatla, America/Honolulu, America/Goose_Bay and
America/St_Johns.

Change-Id: I8e60a7c7ba5ab71eedcc66937443a9e6993accd6
2011-08-29 08:58:09 -07:00
David 'Digit' Turner
89ea107de5 Merge "linker: allow debugging of constructors" 2011-08-29 04:33:07 -07:00
David 'Digit' Turner
0f7d9df17f Merge "libc: fix typo in kernel helper script" 2011-08-28 00:33:42 -07:00
David 'Digit' Turner
669c823f05 libc: fix typo in kernel helper script
Change-Id: I3b75b1323cf7a48cb839dede1552f24711847335
2011-08-27 18:32:19 +02:00
David 'Digit' Turner
e5ea45547e linker: allow debugging of constructors
This patch allows the debugging of constructors in shared
libraries and executables. It does so by ensuring that the
corresponding binary is visible to gdb before running the
constructors.

Change-Id: I0a3df726a04ad109944c834dcbba672b85d3991e
2011-08-27 10:21:01 +02:00