Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed)

Created:
7 years ago by Mark Mentovai
Modified:
7 years ago
CC:
chromium-reviews, sadrul, weitaosu+watch_chromium.org, amit, gavinp+memory_chromium.org, stevenjb+watch_chromium.org, frankf+watch_chromium.org, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, jam, joi+watch-content_chromium.org, wez+watch_chromium.org, darin-cc_chromium.org, yfriedman+watch_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, dcaiafa+watch_chromium.org, fischman+watch_chromium.org, sanjeevr, craigdh+watch_chromium.org, feature-media-reviews_chromium.org, rmsousa+watch_chromium.org, oshima+watch_chromium.org, ilevy-cc_chromium.org, piman+watch_chromium.org, sergeyu+watch_chromium.org, klundberg+watch_chromium.org, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, agl, mcasas+watch_chromium.org, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, jln+watch_chromium.org, bulach+watch_chromium.org, alexeypa+watch_chromium.org, wjia+watch_chromium.org, mmenke, Paweł Hajdan Jr., Markus (顧孟勤), Mark Seaborn
Visibility:
Public.

Description

Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. It is incorrect to wrap close in HANDLE_EINTR on Linux. Correctness is generally undefined on Mac, but as of r223369, it is incorrect in Chrome on Mac. To avoid new offenders, a PRESUBMIT check ensures that HANDLE_EINTR is not used with close, and that IGNORE_EINTR is only used with close. Unnecessary #includes of eintr_wrapper.h are also removed. base/posix/einter_wrapper.h, PRESUBMIT.py, and ppapi/tests/test_broker.cc contain non-mechanical changes. Variable naming within the latter is updated per r178174. Missing #includes for <errno.h> in content/zygote/zygote_main_linux.cc and tools/android/common/daemon.cc were manually added. Mechanical changes were generated by running: sed -E -i '' \ -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \ -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \ -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \ $(git grep -El 'HANDLE_EINTR.*close') sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \ $(grep -EL '(HANDLE|IGNORE)_EINTR' \ $(git grep -El '#include.*eintr_wrapper\.h"')) BUG=269623 R=agl@chromium.org, jln@chromium.org TBR=OWNERS Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=238390

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -189 lines) Patch
M PRESUBMIT.py View 1 2 3 2 chunks +32 lines, -1 line 0 comments Download
M base/debug/debugger_posix.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/file_util.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M base/file_util_posix.cc View 1 2 3 7 chunks +9 lines, -9 lines 0 comments Download
M base/files/dir_reader_linux.h View 1 chunk +1 line, -1 line 0 comments Download
M base/files/file_path_watcher_kqueue.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/files/file_posix.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/files/memory_mapped_file_posix.cc View 2 chunks +1 line, -2 lines 0 comments Download
M base/memory/discardable_memory_android.cc View 1 chunk +0 lines, -1 line 0 comments Download
M base/message_loop/message_loop_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M base/message_loop/message_pump_io_ios_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/message_loop/message_pump_libevent.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/message_loop/message_pump_libevent_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/platform_file_posix.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/posix/eintr_wrapper.h View 3 chunks +16 lines, -0 lines 0 comments Download
M base/posix/file_descriptor_shuffle.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/posix/unix_domain_socket_linux_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/process/launch_posix.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/process/process_util_unittest.cc View 5 chunks +8 lines, -8 lines 0 comments Download
M base/test/multiprocess_test_android.cc View 3 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection_posix.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/process_info_snapshot_mac_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/process_singleton_linux.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/process_singleton_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/shell_integration_linux.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/multi_process_lock_linux.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/service_process_util_posix.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chromeos/dbus/debug_daemon_client.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chromeos/process_proxy/process_output_watcher.cc View 1 chunk +1 line, -1 line 0 comments Download
M chromeos/process_proxy/process_output_watcher_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chromeos/process_proxy/process_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M chromeos/process_proxy/process_proxy_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M components/breakpad/browser/crash_handler_host_linux.cc View 5 chunks +10 lines, -10 lines 0 comments Download
M components/nacl/browser/nacl_process_host.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/nacl/loader/nacl_helper_linux.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M components/nacl/zygote/nacl_fork_delegate_linux.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_sandbox_host_linux.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_widget_helper.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/common/font_config_ipc_linux.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/media/exynos_video_decode_accelerator.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/common/gpu/media/exynos_video_encode_accelerator.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/common/plugin_list_posix.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/common/sandbox_linux.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/plugin/plugin_channel.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/zygote/zygote_main_linux.cc View 1 2 3 chunks +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_socket_chromeos.cc View 1 chunk +1 line, -1 line 0 comments Download
M ipc/file_descriptor_set_posix.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ipc/file_descriptor_set_posix_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ipc/ipc_channel_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M ipc/ipc_channel_posix.cc View 8 chunks +11 lines, -11 lines 0 comments Download
M ipc/ipc_channel_posix_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ipc/ipc_send_fds_test.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M media/base/user_input_monitor_linux.cc View 1 chunk +0 lines, -1 line 0 comments Download
M net/base/address_tracker_linux.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/net_util_posix.cc View 1 chunk +0 lines, -1 line 0 comments Download
M net/dns/address_sorter_posix.cc View 1 chunk +0 lines, -1 line 0 comments Download
M net/socket/tcp_listen_socket_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/socket/tcp_socket_libevent.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/socket/unix_domain_socket_posix.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/socket/unix_domain_socket_posix_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/udp/udp_socket_libevent.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/udp/udp_socket_win.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/plugin_dispatcher.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/tests/test_broker.cc View 3 chunks +19 lines, -6 lines 0 comments Download
M printing/pdf_metafile_skia.cc View 1 chunk +1 line, -1 line 0 comments Download
M remoting/host/ipc_util_posix.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M remoting/host/local_input_monitor_linux.cc View 1 chunk +0 lines, -1 line 0 comments Download
M rlz/lib/recursive_cross_process_lock_posix.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 6 chunks +7 lines, -7 lines 0 comments Download
M sandbox/linux/seccomp-bpf/syscall_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M sandbox/linux/seccomp-bpf/trap.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sandbox/linux/services/broker_process.cc View 5 chunks +7 lines, -7 lines 0 comments Download
M sandbox/linux/services/broker_process_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M sandbox/linux/services/init_process_reaper.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M sandbox/linux/tests/unit_tests.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/leveldatabase/env_chromium.cc View 1 chunk +1 line, -1 line 0 comments Download
M tools/android/common/adb_connection.cc View 1 chunk +1 line, -1 line 0 comments Download
M tools/android/common/daemon.cc View 1 2 3 chunks +2 lines, -2 lines 0 comments Download
M tools/android/forwarder/forwarder.cc View 1 chunk +1 line, -1 line 0 comments Download
M tools/android/forwarder2/common.cc View 1 chunk +1 line, -1 line 0 comments Download
M tools/android/forwarder2/host_forwarder_main.cc View 1 chunk +0 lines, -1 line 0 comments Download
M tools/android/forwarder2/pipe_notifier.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/surface/transport_dib_posix.cc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Mark Mentovai
7 years ago (2013-12-02 22:31:59 UTC) #1
agl
lgtm
7 years ago (2013-12-02 22:46:33 UTC) #2
Mark Mentovai
+darin (tree-wide OWNER), will TBR once the try jobs are green.
7 years ago (2013-12-02 22:54:58 UTC) #3
jln (very slow on Chromium)
We had this discussion a while back when figuring out what to do for sandbox/ ...
7 years ago (2013-12-02 23:50:13 UTC) #4
jln (very slow on Chromium)
https://codereview.chromium.org/100253002/diff/30001/base/posix/eintr_wrapper.h File base/posix/eintr_wrapper.h (right): https://codereview.chromium.org/100253002/diff/30001/base/posix/eintr_wrapper.h#newcode54 base/posix/eintr_wrapper.h:54: eintr_wrapper_result = 0; \ Shouldn't you patch errno as ...
7 years ago (2013-12-02 23:50:30 UTC) #5
Mark Mentovai
https://codereview.chromium.org/100253002/diff/30001/base/posix/eintr_wrapper.h File base/posix/eintr_wrapper.h (right): https://codereview.chromium.org/100253002/diff/30001/base/posix/eintr_wrapper.h#newcode54 base/posix/eintr_wrapper.h:54: eintr_wrapper_result = 0; \ jln wrote: > Shouldn't you ...
7 years ago (2013-12-03 03:30:51 UTC) #6
jln (very slow on Chromium)
ok, lgtm
7 years ago (2013-12-03 05:46:47 UTC) #7
Mark Mentovai
Committed patchset #4 manually as r238390.
7 years ago (2013-12-03 14:11:06 UTC) #8
darin (slow to review)
7 years ago (2013-12-03 18:40:57 UTC) #9
Message was sent while issue was closed.
rubber stamp LGTM

Powered by Google App Engine
This is Rietveld 408576698