New issue
Advanced search Search tips

Issue 740791 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 1
Type: Bug

Blocked on:
issue 754084
issue 754038

Blocking:
issue 734791
issue 737802
issue 749792



Sign in to add a comment

Port //mojo to fuchsia

Project Member Reported by sergeyu@chromium.org, Jul 11 2017

Issue description

Currently mojo unittests fail to compile
 
Blocking: 737802
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/50fb6a87199997a56b1662e71bc39861320de31a

commit 50fb6a87199997a56b1662e71bc39861320de31a
Author: Sergey Ulanov <sergeyu@google.com>
Date: Wed Jul 12 01:22:52 2017

Update StackUtil.cpp for Fuchsia

Fuchsia implements pthread_getattr_np(), so the GNU version of StackUtil
internals can be used there as well.

Bug:  740791 
Change-Id: I3bbc7de2d5ebf1124452ed6bb6901a0dcc142457
Reviewed-on: https://chromium-review.googlesource.com/566140
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485762}
[modify] https://crrev.com/50fb6a87199997a56b1662e71bc39861320de31a/third_party/WebKit/Source/platform/wtf/StackUtil.cpp

Project Member

Comment 3 by bugdroid1@chromium.org, Jul 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ebeefaf32a8376146145d0ec9a227de7475b025a

commit ebeefaf32a8376146145d0ec9a227de7475b025a
Author: Sergey Ulanov <sergeyu@google.com>
Date: Wed Jul 12 22:07:59 2017

Compile mojo unittests on Fuchsia

With these changes it's possible to compile mojo unittests on Fuchsia

Bug:  740791 
Change-Id: I6b558a5415d7a11b3fbd3b2711125da14bc5719f
Reviewed-on: https://chromium-review.googlesource.com/566259
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486126}
[modify] https://crrev.com/ebeefaf32a8376146145d0ec9a227de7475b025a/mojo/edk/embedder/platform_shared_buffer.cc
[modify] https://crrev.com/ebeefaf32a8376146145d0ec9a227de7475b025a/mojo/edk/system/platform_wrapper_unittest.cc

Comment 4 by w...@chromium.org, Jul 15 2017

Components: Internals>PlatformIntegration

Comment 6 by w...@chromium.org, Aug 3 2017

Blocking: 734791
Owner: w...@chromium.org

Comment 7 by w...@chromium.org, Aug 3 2017

Labels: -Pri-3 M-61 Pri-2

Comment 8 by w...@chromium.org, Aug 3 2017

Labels: -M-61 M-62

Comment 9 by w...@chromium.org, Aug 3 2017

Blocking: 749792
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/78b733135719f3a6784eb6f0c2ae902dd12a792b

commit 78b733135719f3a6784eb6f0c2ae902dd12a792b
Author: Wez <wez@chromium.org>
Date: Wed Aug 09 18:41:59 2017

Provide base::ScopedMxHandle helper for use in Fuchsia implementations.

base::ScopedMxHandle uses ScopedGeneric to manage an mx_handle_t.

ScopedGeneric is updated to provide a receive() API, allowing its use as
a direct out-parameter, since most Magenta APIs return handles that way.

Bug:  740791 , 706592
Change-Id: I1491fe3a3eba354e4dd4ebf2d3feae6759e3f87b
Reviewed-on: https://chromium-review.googlesource.com/602394
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493073}
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/BUILD.gn
[add] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/fuchsia/scoped_mx_handle.h
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/memory/shared_memory_fuchsia.cc
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/memory/shared_memory_unittest.cc
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/message_loop/message_pump_fuchsia.cc
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/message_loop/message_pump_fuchsia.h
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/process/process.h
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/process/process_fuchsia.cc
[modify] https://crrev.com/78b733135719f3a6784eb6f0c2ae902dd12a792b/base/scoped_generic.h

Comment 11 by w...@chromium.org, Aug 9 2017

Labels: -Pri-2 Pri-1

Comment 12 by w...@chromium.org, Aug 9 2017

Blockedon: 754038

Comment 13 by w...@chromium.org, Aug 10 2017

Blockedon: 754084
Project Member

Comment 14 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1603c32c3ba7564dae9dd1055c58c4a0dad6c775

commit 1603c32c3ba7564dae9dd1055c58c4a0dad6c775
Author: Wez <wez@chromium.org>
Date: Thu Aug 10 05:24:54 2017

Support passing native platform handles via LaunchProcess.

Since some types of Fuchsia handle (e.g. channels) cannot be duplicated,
LaunchProcess transfers the supplied handles, requiring the caller to
provide copies of any handles it wishes to retain.

Callers must provide a unique identifier for each handle which is
to be transferred, which the client process can use to retrieve the
handle via mx_get_startup_handle().

This will be used to pass the initial Mojo channel to child processes.

Bug:  740791 , 706592
Change-Id: I4f9028db730533605142b4911607efb1e0e3c33a
Reviewed-on: https://chromium-review.googlesource.com/602089
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493265}
[modify] https://crrev.com/1603c32c3ba7564dae9dd1055c58c4a0dad6c775/base/metrics/field_trial.cc
[modify] https://crrev.com/1603c32c3ba7564dae9dd1055c58c4a0dad6c775/base/metrics/field_trial.h
[modify] https://crrev.com/1603c32c3ba7564dae9dd1055c58c4a0dad6c775/base/process/launch.h
[modify] https://crrev.com/1603c32c3ba7564dae9dd1055c58c4a0dad6c775/base/process/launch_fuchsia.cc
[modify] https://crrev.com/1603c32c3ba7564dae9dd1055c58c4a0dad6c775/base/process/process_util_unittest.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a7c7272fa05de95cf66d9a7b615458846185d67

commit 9a7c7272fa05de95cf66d9a7b615458846185d67
Author: Wez <wez@chromium.org>
Date: Thu Aug 10 06:29:27 2017

Implement a MessageLoopForIO::WatchMxHandle API under Fuchsia.

WatchMxHandle() follows the design of the WatchFileDescriptor() API
provided by MessageLoopForIO across the POSIX platforms, and now serves
as the underlying implementation for watching file-descriptors under
Fuchsia.

This will be used for asynchronous I/O on native Fuchsia primitives,
e.g. in the Mojo IPC implementation, which will use Fuchsia "channels".

This CL also fixes the behaviour of StopWatchingFileDescriptor() from
within an event callback, and an mxio leak arising from use of that
API, and pulls in sergeyu's test for StopWatchingFileDescriptor(), from
https://chromium-review.googlesource.com/c/608983

Bug: 706592,  740791 
Change-Id: I675c5cfe8a443d48863361028c0f9222fdde8182
Reviewed-on: https://chromium-review.googlesource.com/602396
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493307}
[modify] https://crrev.com/9a7c7272fa05de95cf66d9a7b615458846185d67/base/message_loop/message_loop.cc
[modify] https://crrev.com/9a7c7272fa05de95cf66d9a7b615458846185d67/base/message_loop/message_loop.h
[modify] https://crrev.com/9a7c7272fa05de95cf66d9a7b615458846185d67/base/message_loop/message_loop_io_posix_unittest.cc
[modify] https://crrev.com/9a7c7272fa05de95cf66d9a7b615458846185d67/base/message_loop/message_pump_fuchsia.cc
[modify] https://crrev.com/9a7c7272fa05de95cf66d9a7b615458846185d67/base/message_loop/message_pump_fuchsia.h

Project Member

Comment 16 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d

commit 9736ba78d6c5e04dbbdd993546e0bfd655e2a06d
Author: Wez <wez@chromium.org>
Date: Thu Aug 10 16:35:36 2017

Implement minimal set of Mojo platform IPC primitives for Fuchsia.

Previously we were building Mojo IPC against Fuchsia's POSIX emulation
layer, in which key APIs (e.g. sendmsg/resvmsg) are not-implemented.

To implement Mojo IPC natively for Fuchsia this CL:
- Switches Mojo HandlePassingInformation to map to the Fuchsia-specific
  base::HandlesToTransferVector (see base/launch_process.h).
- Implements the embedder PlatformChannel[Handle|Pair] classes.
- Implements the Mojo system Channel class.
- Updates the Mojo system core APIs to be aware of Fuchsia handles.
- Updates the MultiprocessTestHelper to be aware of Fuchsia.

The newly-passing tests are removed from the Fuchsia test filters.

Some functionality is notably missing:
- We do not yet support passing of POSIX file-descriptors.
- Stubs out NamedPlatformHandle APIs with NOTREACHED().
- We do not yet cope with SHOULD_WAIT on write attempts, because the
  OS doesn't ever actually return that yet
  (see https://fuchsia.atlassian.net/browse/MG-894).

Bug:  740791 ,  749792 
Change-Id: If5d8f7d7962e89f8cb2008aa55deac276b309a00
Reviewed-on: https://chromium-review.googlesource.com/604008
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493422}
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/BUILD.gn
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/embedder_unittest.cc
[add] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/named_platform_handle_utils_fuchsia.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_channel_pair.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_channel_pair.h
[add] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_channel_pair_fuchsia.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_handle.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_handle.h
[add] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_handle_utils_fuchsia.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/embedder/platform_shared_buffer.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/BUILD.gn
[add] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/channel_fuchsia.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/core.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/node_controller.h
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/system/platform_wrapper_unittest.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/test/BUILD.gn
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/test/multiprocess_test_helper.cc
[add] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/mojo/edk/test/test_utils_fuchsia.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/services/service_manager/runner/host/service_process_launcher.cc
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/testing/buildbot/chromium.fyi.json
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/testing/buildbot/filters/fuchsia.ipc_tests.filter
[add] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/testing/buildbot/filters/fuchsia.mojo_common_unittests.filter
[modify] https://crrev.com/9736ba78d6c5e04dbbdd993546e0bfd655e2a06d/testing/buildbot/filters/fuchsia.mojo_system_unittests.filter

Project Member

Comment 17 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a429a5fd6a7c25ca3e9eb218cadc904ceed62ee

commit 6a429a5fd6a7c25ca3e9eb218cadc904ceed62ee
Author: Kevin Marshall <kmarshall@chromium.org>
Date: Mon Aug 14 23:59:36 2017

Fuchsia: Add channel binding logic to InitializeMojoIPCChannel().


Bug:  740791 
Change-Id: I521bbfbfb8302db8dd412e55cacc18be1eb22a2b
Reviewed-on: https://chromium-review.googlesource.com/611422
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494255}
[modify] https://crrev.com/6a429a5fd6a7c25ca3e9eb218cadc904ceed62ee/content/child/child_thread_impl.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/12ae119ee59019aea0a834ce41e41afbf7fc9767

commit 12ae119ee59019aea0a834ce41e41afbf7fc9767
Author: Wez <wez@chromium.org>
Date: Fri Aug 18 02:38:38 2017

Reduce maximum number of handles per Channel::Message.

Maximum number of handles that may be passed per-message was previously
set to 128, to be well under the per-sendmsg() limit imposed on Linux.

Fuchsia's mx_channel_write() can handle 64 handles at a time, and we
don't currently have a need for more than that, so reduce the general
limit for all Mojo messages, for now.

Bug:  740791 
Change-Id: Ib9bb96716e89b56bdb180c225b879b997540c25d
Reviewed-on: https://chromium-review.googlesource.com/619815
Commit-Queue: Wez <wez@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495434}
[modify] https://crrev.com/12ae119ee59019aea0a834ce41e41afbf7fc9767/mojo/edk/system/channel.cc
[modify] https://crrev.com/12ae119ee59019aea0a834ce41e41afbf7fc9767/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/12ae119ee59019aea0a834ce41e41afbf7fc9767/testing/buildbot/filters/fuchsia.mojo_system_unittests.filter

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f8498b3987d2036fb8f7e578c1d24e4a046e163

commit 8f8498b3987d2036fb8f7e578c1d24e4a046e163
Author: Wez <wez@chromium.org>
Date: Fri Aug 18 04:26:34 2017

Fix SysInfo::AmountOfVirtualMemory and PlatformSharedBuffer::Map().

The meaning of base::SysInfo::AmountOfVirtualMemory() isn't well-
specified (e.g. under Windows it returns the calling process' maximum
address-space size, while under POSIX it returns the maximum memory
available via brk()-based malloc()). Under Fuchsia the Virtual Memory
Address Range is practically unlimited, so rather than return the size
of e.g. the root VMAR object of the calling process, we just return
zero (meaning "unlimited").

PlatformSharedBuffer::Map() was previously DCHECK()ing that mapping the
underlying SharedMemory object succeeded, and then always returning
"success" to the caller. This is fixed so that callers, including the
Mojo PlatformSharedBufferTest.TooBig test, can handle the Map()
failure.

The PlatformSharedBuffer.TooBig test is fixed to actually attempt to
Create() a too-big shared buffer, rather than a zero-byte one, and the
test is removed from the Fuchsia test filters.

Bug:  740791 , 706592
Change-Id: I76d3f1e4201c8cc6c143e469e5d1f081b359aa38
Reviewed-on: https://chromium-review.googlesource.com/620293
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495459}
[modify] https://crrev.com/8f8498b3987d2036fb8f7e578c1d24e4a046e163/base/sys_info_fuchsia.cc
[modify] https://crrev.com/8f8498b3987d2036fb8f7e578c1d24e4a046e163/base/sys_info_posix.cc
[modify] https://crrev.com/8f8498b3987d2036fb8f7e578c1d24e4a046e163/mojo/edk/embedder/platform_shared_buffer.cc
[modify] https://crrev.com/8f8498b3987d2036fb8f7e578c1d24e4a046e163/mojo/edk/embedder/platform_shared_buffer_unittest.cc
[modify] https://crrev.com/8f8498b3987d2036fb8f7e578c1d24e4a046e163/testing/buildbot/filters/fuchsia.mojo_system_unittests.filter

Comment 20 by w...@chromium.org, Aug 18 2017

Status: Fixed (was: Started)
The only Mojo functionality not presently supported is NamedPlatformChannel ( issue 754038 ), which is not required for Chrome itself to run, so closing this out.
Project Member

Comment 21 by bugdroid1@chromium.org, Aug 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da4409217a419c39b18bca164e9467960595a9c5

commit da4409217a419c39b18bca164e9467960595a9c5
Author: Wez <wez@chromium.org>
Date: Tue Aug 22 22:54:31 2017

Handle multi-MX-handle file descriptors in Mojo messages on Fuchsia.

Previously the mojo::edk::ChannelFuchsia was hard-wired to cope only
with file-descriptors for simple files, which wrap a single underlying
platform handle, e.g. a virtual memory object containing the file data.

This CL extends the implementation to cope with MXIO file-descriptors
which build on multiple platform resources, notably device files such as
"/dev/zero". We make some assumptions about the contents of the |info|
returned with the unwrapped handles, so this may need revisiting in
future.

Bug:  734791 ,  740791 
Change-Id: I6aac82bb5b34995381d08bd5b0f8df44a156bc37
Reviewed-on: https://chromium-review.googlesource.com/624815
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496479}
[modify] https://crrev.com/da4409217a419c39b18bca164e9467960595a9c5/mojo/edk/system/channel.h
[modify] https://crrev.com/da4409217a419c39b18bca164e9467960595a9c5/mojo/edk/system/channel_fuchsia.cc
[modify] https://crrev.com/da4409217a419c39b18bca164e9467960595a9c5/testing/buildbot/filters/fuchsia.ipc_tests.filter

Project Member

Comment 22 by bugdroid1@chromium.org, Jun 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/676b5fae19bd233e4cce1479d631e421fec9e7b1

commit 676b5fae19bd233e4cce1479d631e421fec9e7b1
Author: Wez <wez@chromium.org>
Date: Wed Jun 20 22:34:08 2018

[mojo] Release() sent handles regardless of zx_channel_write() result.

Fuchsia recently changed the zx_channel_write() API to always consume
the supplied handles, by default, regardless of whether the call
succeeds in transferring them to the peer process.

Update the mojo::edk::Channel::Write() implementation to account for the
new semantics.

Bug:  854458 , 754084,  740791 
Change-Id: I27f78a09ff8bf2aaf94ac571678d4c2259b48b10
Reviewed-on: https://chromium-review.googlesource.com/1108970
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569053}
[modify] https://crrev.com/676b5fae19bd233e4cce1479d631e421fec9e7b1/mojo/edk/system/channel_fuchsia.cc

Sign in to add a comment