Commit Graph

17376 Commits

Author SHA1 Message Date
Elliott Hughes 6566df1e05 am bffa8906: am e73a8a23: Merge "win32: adb start-server shows stdout/stderr output from actual server"
* commit 'bffa890641de614668d3dafd8236e940f9ea6af7':
  win32: adb start-server shows stdout/stderr output from actual server
2015-08-28 20:33:18 +00:00
Elliott Hughes bffa890641 am e73a8a23: Merge "win32: adb start-server shows stdout/stderr output from actual server"
* commit 'e73a8a2388f019b0f7a6e468af27056edbb02521':
  win32: adb start-server shows stdout/stderr output from actual server
2015-08-28 20:23:49 +00:00
Elliott Hughes 2ea57042b8 am 4417c38a: am a54f14eb: Merge "adb unittest: get test_unicode_paths passing on win32"
* commit '4417c38a1eb64fb7cfffa75a5f705a79484ed3d5':
  adb unittest: get test_unicode_paths passing on win32
2015-08-28 20:17:59 +00:00
Elliott Hughes e73a8a2388 Merge "win32: adb start-server shows stdout/stderr output from actual server" 2015-08-28 20:13:40 +00:00
Elliott Hughes 4417c38a1e am a54f14eb: Merge "adb unittest: get test_unicode_paths passing on win32"
* commit 'a54f14eb95d73c91aaa2a4387a79d897a4731060':
  adb unittest: get test_unicode_paths passing on win32
2015-08-28 20:07:47 +00:00
Elliott Hughes 287415b4e7 am be881b65: am 1d9253f2: Merge "adb: fix adb install and adb push exit code, error handling, unittest"
* commit 'be881b65ca0dcd0f267a767eaecb61636e089399':
  adb: fix adb install and adb push exit code, error handling, unittest
2015-08-28 20:03:20 +00:00
Elliott Hughes a54f14eb95 Merge "adb unittest: get test_unicode_paths passing on win32" 2015-08-28 20:00:53 +00:00
Elliott Hughes be881b65ca am 1d9253f2: Merge "adb: fix adb install and adb push exit code, error handling, unittest"
* commit '1d9253f255c60069c4187f0c43b2b22015fd5688':
  adb: fix adb install and adb push exit code, error handling, unittest
2015-08-28 19:52:18 +00:00
Elliott Hughes 1d9253f255 Merge "adb: fix adb install and adb push exit code, error handling, unittest" 2015-08-28 19:46:46 +00:00
Yabin Cui e272f8aab3 am adab77ad: am 7b6fa7ed: Merge "adb: remove adisconnect in aremotesocket."
* commit 'adab77ad50caab89127f0ba3baecd27a99ae6fc1':
  adb: remove adisconnect in aremotesocket.
2015-08-28 19:08:05 +00:00
Yabin Cui adab77ad50 am 7b6fa7ed: Merge "adb: remove adisconnect in aremotesocket."
* commit '7b6fa7ed304cbd682e4c4cb539f2e4f8047aedc4':
  adb: remove adisconnect in aremotesocket.
2015-08-28 18:57:35 +00:00
Yabin Cui 7b6fa7ed30 Merge "adb: remove adisconnect in aremotesocket." 2015-08-28 18:50:31 +00:00
Yabin Cui 12d7f0909a adb: call run_transport_disconnects() only once.
Currently run_transport_disconnects() are called twice. One is in
handle_offline(), another is before destroying transport.
The users of disconnect callback are listener, adb_auth_client, and
remote_sockets. All of them need only to be called once. And after
handle_offline, no new listeners, adb_auth_client, or remote_sockets
can be connected to the offlined transport. So I think we can remove
the second call to run_transport_disconnects().

Change-Id: I1ef8b6b7b5ab7ae1bad109be107c85973d65a2e3
2015-08-28 11:39:37 -07:00
Spencer Low d8cce1817b adb: fix adb install and adb push exit code, error handling, unittest
adb push was not returning a bad exit code when write_data_file() or
write_data_link() failed. I encountered this when running the unittest
on Windows which can get into situations where stat() succeeds, but
open() fails due to pre-existing exclusive file access (which typically
doesn't exist on unix).

The same code is used by adb install, so this also fixes its error
handling.

Fixed some fd leaks and propagation of errors when reading a file.

Fixed a unittest to close temp files before reading them.

Change-Id: Ieba0026fa4c79eb0484676e4f2faaac9603ef584
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-28 11:38:28 -07:00
Nick Kralevich 6b86f3fe30 am 5e44f5cc: am 2c58af52: Merge "VectorImpl.cpp: fix benign multiplication overflow"
* commit '5e44f5cc0c2824827c9e87daff83e9722c549345':
  VectorImpl.cpp: fix benign multiplication overflow
2015-08-28 17:38:06 +00:00
Nick Kralevich 5e44f5cc0c am 2c58af52: Merge "VectorImpl.cpp: fix benign multiplication overflow"
* commit '2c58af52232f0c8b4ab09d75eba66d1283805cab':
  VectorImpl.cpp: fix benign multiplication overflow
2015-08-28 17:28:37 +00:00
Nick Kralevich 2c58af5223 Merge "VectorImpl.cpp: fix benign multiplication overflow" 2015-08-28 16:54:02 +00:00
Nick Kralevich c76698f24e VectorImpl.cpp: fix benign multiplication overflow
j is a ssize_t, which can go negative. If it goes negative,
the resulting multiplication of mItemSize*j doesn't make
any sense. Since the value is never used, just don't perform
the calculation if j < 0.

Bug: 23607865
Change-Id: I14f6f6506645d582f7d67a2e2d60ead3cb18b957
2015-08-28 06:40:23 -07:00
Spencer Low de4505f819 adb unittest: get test_unicode_paths passing on win32
The Python 2 subprocess class doesn't use Unicode, so as a work-around
write the command line to a UTF-8 batch file and run that.

I modified the test to use u'blah' without .encode('utf-8') because the
Python docs recommend dealing with string variables like that. When
formatting a string with a unicode parameter, use u'foo' on the constant
string to make it unicode.

I also tested this on Linux and it seems to work fine (I did ls in the
middle of the test to make sure the filenames came out right, etc.).

I had to close the temporary files before adb tries to read/write them
because filesystem semantics are different on Windows (technically I
might be able to modify adb to try to open files with more permissive
share flags, but then I'm not sure if Python uses the right share flags.
Basically, I'd be opening another can of worms.).

Fixed the test to delete a temp file on the device once it is done.

Change-Id: Id0c34e26d7697fbbb47a44ae45298bed5e8c59d6
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-28 01:20:03 -07:00
Yabin Cui fd28f327ee adb: remove adisconnect in aremotesocket.
The function of remote_socket_disconnect() is to make sure
the local_sockets and remote_sockets are closed when the binded
transport is disconnected. However, as we call close_all_sockets()
in handle_offline(), we don't need remote_socket_disconnect() any more.

Change-Id: I575f632d9f8703149f34e0210eb698a56e2516a9
2015-08-27 19:35:47 -07:00
Bill Yi 1be03a2207 am 35cee267: Merge commit \'f4ba463105646df0c4d65c368fbd201cfe62d08f\' into HEAD
* commit '35cee267338c5b290dff99365cc734aa60e0f773':
2015-08-27 23:37:44 +00:00
Nick Kralevich b622e63c3d am eb458905: am f4355868: Merge "android_memset.c: Use sanitized shifts"
* commit 'eb458905797166ac6385dd5fcc8ed7083c0906fa':
  android_memset.c: Use sanitized shifts
2015-08-27 23:33:00 +00:00
Bill Yi 35cee26733 Merge commit 'f4ba463105646df0c4d65c368fbd201cfe62d08f' into HEAD 2015-08-27 16:30:48 -07:00
Nick Kralevich eb45890579 am f4355868: Merge "android_memset.c: Use sanitized shifts"
* commit 'f4355868cbce0713331bbb04b063515d6de4c795':
  android_memset.c: Use sanitized shifts
2015-08-27 23:24:35 +00:00
Nick Kralevich f4355868cb Merge "android_memset.c: Use sanitized shifts" 2015-08-27 23:17:22 +00:00
Yabin Cui 13c1e5bf59 am a483eae5: am 4f8d5b01: Merge "adb: disconnect: fix write-after-free memory corruption and crash."
* commit 'a483eae5b169571185731791dd70310cfd9e9290':
  adb: disconnect: fix write-after-free memory corruption and crash.
2015-08-27 23:13:45 +00:00
Yabin Cui a483eae5b1 am 4f8d5b01: Merge "adb: disconnect: fix write-after-free memory corruption and crash."
* commit '4f8d5b01281e751168718c7b0a74db34352aaf1e':
  adb: disconnect: fix write-after-free memory corruption and crash.
2015-08-27 23:05:43 +00:00
Yabin Cui 4f8d5b0128 Merge "adb: disconnect: fix write-after-free memory corruption and crash." 2015-08-27 22:58:03 +00:00
Yabin Cui f4b9928563 adb: disconnect: fix write-after-free memory corruption and crash.
Transport atransport objects are semi-reference counted: the input and
output threads each hold a reference. The adb disconnect command was
calling transport_unref to release a reference that it never had in the
first place. This meant that the refcount dropped to zero and the object
was deleted before either the input or output thread released its
reference. When that last thread released its reference, it wrote to
freed memory and also sometimes crashed.

This fix is to not release any unheld reference, instead it just kicks
the transport to break remote_read in output_thread. So all transport
close flow goes the following way:
output_thread (exit) -> main thread (offline the transport) ->
input thread (exit) -> main thread (destroy the transport)

Change-Id: Iad1fe718acc8716f3a79c8c22b426a1b2450452c
2015-08-27 14:41:07 -07:00
Duane Sand c348a88376 android_memset.c: Use sanitized shifts
Avoid checks and traps on msb=1 unsigned shifts.

Change-Id: I5203a4290296b5557c0420ce0debad3b60d48233
2015-08-27 14:32:17 -07:00
Nick Kralevich 7815c47ade am b7699c65: am e6d3cf39: Merge "android_memset.c: Use __attribute__((no_sanitize("integer")))"
* commit 'b7699c65508e1e0e98fef946d42214faee740bd4':
  android_memset.c: Use __attribute__((no_sanitize("integer")))
2015-08-27 21:02:12 +00:00
Nick Kralevich b7699c6550 am e6d3cf39: Merge "android_memset.c: Use __attribute__((no_sanitize("integer")))"
* commit 'e6d3cf393749556d6bb6b8ea51bb1252cfb061f3':
  android_memset.c: Use __attribute__((no_sanitize("integer")))
2015-08-27 20:44:40 +00:00
Nick Kralevich e6d3cf3937 Merge "android_memset.c: Use __attribute__((no_sanitize("integer")))" 2015-08-27 20:36:08 +00:00
Nick Kralevich d9eda62875 android_memset.c: Use __attribute__((no_sanitize("integer")))
Turn off integer sanitization on android_memset. memset()ing is
expected to be a fast operation.

Avoid the use of the "while (size--) { }" construct, which harmlessly
underflows.

Change-Id: Ia61ff2323c759bf52df7e70b8be2fae0b0366dda
2015-08-27 13:14:36 -07:00
Yabin Cui f6cee89b63 am 9f91681d: am f3068123: Merge "adb: fix a fake data race on transport:kick reported by tsan."
* commit '9f91681d5025a22851d7f666bc574a0a9d445281':
  adb: fix a fake data race on transport:kick reported by tsan.
2015-08-27 18:34:50 +00:00
Yabin Cui 9f91681d50 am f3068123: Merge "adb: fix a fake data race on transport:kick reported by tsan."
* commit 'f3068123039e81cee85ce9103d01b5b2aceb2ba3':
  adb: fix a fake data race on transport:kick reported by tsan.
2015-08-27 18:29:50 +00:00
Yabin Cui f306812303 Merge "adb: fix a fake data race on transport:kick reported by tsan." 2015-08-27 18:25:02 +00:00
Bertrand Simonnet 03e770e9d4 am 414f6226: am c3f866f6: Merge "metricsd: Use system properties to store build time metadata."
* commit '414f6226fc2d5ce8537b696ef0dfa72f7f245db6':
  metricsd: Use system properties to store build time metadata.
2015-08-27 18:11:22 +00:00
Nick Kralevich a2a83a4f4b am 212e4f1f: am d34f4198: Merge "strdup16to8.c: fix benign integer underflow."
* commit '212e4f1fe1c4f8390c3cada607e00bc9d9717eba':
  strdup16to8.c: fix benign integer underflow.
2015-08-27 18:11:21 +00:00
Bertrand Simonnet 414f6226fc am c3f866f6: Merge "metricsd: Use system properties to store build time metadata."
* commit 'c3f866f60cedc7eade674a7a8eec740dd938264f':
  metricsd: Use system properties to store build time metadata.
2015-08-27 18:01:45 +00:00
Nick Kralevich 212e4f1fe1 am d34f4198: Merge "strdup16to8.c: fix benign integer underflow."
* commit 'd34f419826e74640dfe88c50d171a0cd8580eeda':
  strdup16to8.c: fix benign integer underflow.
2015-08-27 18:01:44 +00:00
Bertrand Simonnet c3f866f60c Merge "metricsd: Use system properties to store build time metadata." 2015-08-27 17:58:23 +00:00
Nick Kralevich d34f419826 Merge "strdup16to8.c: fix benign integer underflow." 2015-08-27 17:54:32 +00:00
Nick Kralevich 2b98a9eec0 strdup16to8.c: fix benign integer underflow.
A size_t value is not allowed to go below zero.

Change-Id: Ic888c6605d911e0b5dbee1a2fe1daf41e616e106
2015-08-27 10:30:50 -07:00
Mark Salyzyn cb19b08dac logd: refine is_prio
(cherry pick from commit 618d0dec50)

- Heuristics associated with translation of kernel messages to
  Android user space logs.
- Limit is_prio to 4 characters, we got false positives on hex
  values like <register contents> with no alpha chars.
- x11 and other register definitions are not valid tags, en0 is
- fix some Android coding standard issues

Change-Id: Idc3dcc53a2cb75ac38628c8ef7a5d5b53f12587a
2015-08-27 10:12:49 -07:00
William Luh 3680dc30f8 am a03c55c7: am 001c87c3: Merge "Add macro to call event logger for errors."
* commit 'a03c55c7e4960d6b29d0c6dddc2c1bf3eca11c86':
  Add macro to call event logger for errors.
2015-08-27 16:34:58 +00:00
William Luh a03c55c7e4 am 001c87c3: Merge "Add macro to call event logger for errors."
* commit '001c87c3cd4676ef14f7c08ade380fbb7870eda6':
  Add macro to call event logger for errors.
2015-08-27 16:26:24 +00:00
William Luh 001c87c3cd Merge "Add macro to call event logger for errors." 2015-08-27 16:22:02 +00:00
Mark Salyzyn e8e51ecd94 am 928c6124: am 96ac40af: Merge "logd: klogd and Mediatek"
* commit '928c6124ee8d3d0f0a9612607a45a01df2299fb8':
  logd: klogd and Mediatek
2015-08-27 14:29:21 +00:00
Mark Salyzyn 928c6124ee am 96ac40af: Merge "logd: klogd and Mediatek"
* commit '96ac40afbf9671e3feaaeb09735fcbb65b0ef733':
  logd: klogd and Mediatek
2015-08-27 14:23:18 +00:00