Use VmInteropHandler for invoking sub commands instead of running them
in an isolate. Running sub commands in an isolate causes an increased footprint.
Changing this to use VmInteropHandler avoids the additional memory footprint.
Commands that need to use an AOT runtime for execution now exec the AOT
runtime and run the command.
TEST=ci
Change-Id: Ic96845b19951170effea3dd3619f798e2c72968a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Use VmInteropHandler for invoking sub commands instead of running them
in an isolate. Running sub commands in an isolate causes an increased footprint.
Changing this to use VmInteropHandler avoids the additional memory footprint.
Commands that need to use an AOT runtime for execution now exec the AOT
runtime and run the command.
TEST=ci
Change-Id: If7aed1cab2fec9d9940bd562ad5aa9c4e9a6ac7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398604
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
If current RSS is queried after max RSS, it may grow between calls
and might be larger than max. So max RSS should be queried before
the current RSS.
This is a possible fix for the following errors on vm-kernel-win-debug-ia32:
Expected: a value greater than or equal to <177020928>
Actual: <177016832>
Which: is not a value greater than or equal to <177020928>
package:test_api/src/frontend/expect.dart 155:31 fail
package:test_api/src/frontend/expect.dart 150:3 _expect
package:test_api/src/frontend/expect.dart 59:3 expect
runtime\observatory_2\tests\service_2\vm_test.dart 21:5 tests.<fn>
TEST=runtime/observatory_2/tests/service_2/vm_test.dart
Change-Id: I29148562ecc0ab9de3e5af19e6e6ad1390d04bb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181420
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Instead of just giving up try to give as much information as possible
including error code, error returned by Dart_StringFromUtf8 and
ascii portion of the OS error message.
We are making this change because we are getting reports of
ProcessException being thrown with "OS error message was a
not a utf8 string." message. There is no way to reproduce
these situations so instead we are going to add additional
information into the fallback message to aid the investigation.
TEST=tested manually by simulating fallback to the newly added code
Bug: b/178383611
Change-Id: Idf528dc762723694145a15aa07320220e8af9bfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181200
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Crashes come from assertion in ReturnTokens() and new_mask() in Eventhandler.
Another issue is when multiple serversockets bind to the same address, Socket will be reused to all Dart_Ports. But Socket didn't keep track of corresponding Dart Port.
When one of isolates is killed, finalizer wakes up and close most recent Dart Port that sends data.
After this cl, Socket may not be reused by different Dart Sockets. All Dart socket will has its own Socket object. But Sockets can have same fd.
This will guarantee finalizer will close right Dart Port.
Bug: https://github.com/dart-lang/sdk/issues/36106
Change-Id: Ib4620ada5f120ffda719052297009280c73b4315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122490
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change some static_libraries to source_sets to make ODR violations link-time errors.
This is needed to enable (stop suppressing) -fvisibility=hidden in Fuchsia product builds.
Change-Id: I699cec8d4b516beab9cebf9db0a522a7ff99e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99822
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The "vm" test suite is cauing the kernel bytecode compiler to
OOM on the bot, so this CL removes it from the test matrix for
dartkb. This CL also protects against non-utf8 data coming in
on the error message pipe during process spawning.
Change-Id: Iab110a49a49ea12d21037719716a228776343602
Reviewed-on: https://dart-review.googlesource.com/74490
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Reland 1d6c1020c9 with the fix for ASAN
bots.
* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
integers.
* This update revealed that certain dart:io native methods do not handle
out-of-memory properly when I/O buffers are allocated.
This CL fixes this bug.
* Updated test point is extracted to a separate test
standalone_2/file_error2_test as it needs custom ASAN options.
Change-Id: Ifb1fa59828f36dc03d45c18a41d45da6b989d70a
Reviewed-on: https://dart-review.googlesource.com/20908
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
integers.
* This update revealed that certain dart:io native methods do not handle
out-of-memory properly when I/O buffers are allocated.
This CL fixes this bug.
Change-Id: I6a9018ab86da7b163d9797d745544835dfb0f15c
Reviewed-on: https://dart-review.googlesource.com/20582
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
fexecve overwrites argv[0] for cases in which the exec'd binary should
close the fd itself rather than the calling process. This makes it
inappropriate for use in the VM. Instead the VM should use
execveat, however it hasn't been added to the C Library everywhere,
yet.
fixes#30971
Change-Id: I82085f24ded2f0b846d9193ca55903686e1f3585
Reviewed-on: https://dart-review.googlesource.com/10205
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.
We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.
This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:
sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart
The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.
Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:
runtime/bin/namespace.h
Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().
related US-313
R=asiva@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/3007703002 .
If an Isolate touches the 'stdio' getter, a _NativeSocket with
attached finalizer is created for it. Previously, when such an
Isolate exited, the finalizer would close the underlying
file descriptor. This CL changes the finalizer for stdin such
that the native objects will be cleaned up, but the underlying
file descriptor will not be closed. The underlying file
descriptor will now only be closed if the stdin stream
subscription is explicitly canceled.
Accessing the stdin getter after the stream is explicitly
canceled will result in a FileSystemException.
See also: https://github.com/dart-lang/test/issues/583fixes#29229R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2791423002 .
The finalizer sends the "close" message to the EventHandler for the
file descriptor in the _NativeSocket's native field. To avoid races and
spurious messages, this CL stores a pointer to a wrapper object in the
native field instead of the file descriptor. All messsages about the
_NativeSocket sent to the EventHandler use the wrapper object instead of
the file descriptor. When the EventHandler closes the file, the file
descriptor in the wrapper object is set to -1 so that the finalizer will
instead do nothing.
On Windows, there is another level of indirection since the OS HANDLEs
were already wrapped in various kinds of Handle objects. As an additional
complication, ClientSocket close on Windows is asynchronous, so the
EventHandler may shutdown before all of the ClientSocket Handles can be
destroyed.
related #27898, #28081R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2760293002 .
Previously we would compile in implementaitions of native calls for
IO functions that would never be used. This CL provides implementations
that throw a Dart exception if they're called by mistake. It also uses
a DART_IO_DISABLED preprocessor define to clean up the build files and
check that we're not including code we shouldn't.
R=iposva@google.com, johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1839463002 .
Also some style cleanups.
Decided to fix these leaks by using Dart_ScopeAllocate
instead of malloc and new. Leaks are noted in the CL.
I haven't finished looking over all the code in
//runtime/bin yet, but this CL was getting big.
Review URL: https://codereview.chromium.org/1781883002 .
The EventHandler can't be stopped until Dart_Cleanup shuts down all isolates and cleans up all VM thread pool threads.
TBR
BUG=
Review URL: https://codereview.chromium.org//1325963002 .