Commit Graph

45 Commits

Author SHA1 Message Date
Vyacheslav Egorov 040ef6aabb [gardening] Lower core rlimit to 0 if test is expected to crash.
We do not archive core dumps generated by tests that are expected
to crash - so there is no need to generate those dumps.

It seems that generating core dumps is very slow on Mac and causes
timeouts.

Fixes #35275

Remove Timeout expectations from Crashing tests

Change-Id: I36c89fd583a6a94521560544163f02414cbbf41a
Reviewed-on: https://dart-review.googlesource.com/c/85680
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-11-30 11:15:06 +00:00
Ryan Macnak 2048137583 Fix crash dump message not to claim the process was the standlone VM. This code is shared by other users of dart:io such as Flutter.
Change-Id: I0612670ad74fcfc2103ba93ac531c6f44ac44dc0
Reviewed-on: https://dart-review.googlesource.com/51804
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-19 18:16:59 +00:00
Ben Konyi 52afcba357 [ VM ] Fixed issue where process was suspended at exit when backgrounded.
Restoring console state when backgrounded causes SIGTTOU to be raised by
tcsetattr, which has the affect of suspending the process instead of
allowing it to complete. Blocking SIGTTOU results in tcsetattr failing
gracefully and the process running to completion.

Change-Id: I605dccbdbf311697881e5729e4fd64f1d60ed6b1
Reviewed-on: https://dart-review.googlesource.com/48823
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-03-30 20:33:12 +00:00
Ben Konyi 3c8d3b6870 [VM] Refactored console configuration out of platform_*.cc into console_config.h and reapplied c9700040c3 for POSIX platforms (Windows needs more work). We may also want to move code in bin/stdio.h.
Change-Id: Ic7cbc690f490e0127387d9a23866ea7eddbc84cf
Reviewed-on: https://dart-review.googlesource.com/45746
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-03-12 20:31:09 +00:00
Ryan Macnak 47ba426b62 [vm] Dump stack on SIGILL; print exception codes.
Bug: https://github.com/dart-lang/sdk/issues/32391
Change-Id: Ie75511fa17a4ef7a4794a52c34fef7bcb8b4ba81
Reviewed-on: https://dart-review.googlesource.com/44802
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-03-02 21:54:59 +00:00
Zach Anderson fe96de2858 Revert "Restore console to original state on VM exit. Fixes issue #30318."
This reverts commit c9700040c3.

Revert "[vm] Fix Fuchsia's Platform::Save/RestoreConsoleConfiguration."

This reverts commit 365f7b5a8b.

Reason for revert: newlines not printed correctly on Windows after
spawning a Dart VM process.

fixes #32172

Change-Id: I155752370bed7798fe91defdc61ccfe9f666b725
Reviewed-on: https://dart-review.googlesource.com/41840
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-15 16:33:41 +00:00
Ben Konyi c9700040c3 Restore console to original state on VM exit. Fixes issue #30318.
Change-Id: I31b5da600ed5091cd788cde42b72e2fb910fe03a
Reviewed-on: https://dart-review.googlesource.com/39843
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-08 21:56:57 +00:00
Zachary Anderson e2bce948ed [dart:io] Adds Platform.operatingSystemVersion
fixes #30018

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3006873002 .
2017-09-01 22:08:48 -07:00
Zachary Anderson d0295c873c [dart:io] Namespaces for file IO
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 .
2017-08-30 09:34:36 -07:00
Ryan Macnak a86bc67d9b [standalone] Register a segfault handler on Android as already done on Linux.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2985963002 .
2017-07-27 09:47:24 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Zachary Anderson 07725f3dfa [Fuchsia] Fix Platform.executable and Platform.resolvedExecutable
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2941873002 .
2017-06-15 09:05:54 -07:00
Zachary Anderson be9c9f2237 [dart:io] Make Platform.localeName fall back on en_US if LANG is not defined
LANG is not defined on Fuchsia buildbots, causing some build-breakage.

R=pylaligand@google.com

Review URL: https://codereview.chromium.org/2843343002 .
2017-04-26 23:22:15 -07:00
Zach Anderson bc923bed16 [dart:io] Reland: Adds Platform.localeName
The Mac OS build broke because a typedef wasn't added until 10.12.

related #29126

Review-Url: https://codereview.chromium.org/2786183003 .
2017-03-30 13:51:46 -07:00
Zachary Anderson e75df3cce3 Revert "[dart:io] Adds Platform.localeName"
This reverts commit ae6d854ec6.

The build failed on the mac build bots. Need to investigate.

Review-Url: https://codereview.chromium.org/2791453002 .
2017-03-30 13:35:02 -07:00
Zachary Anderson ae6d854ec6 [dart:io] Adds Platform.localeName
related #29126

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2785073002 .
2017-03-30 13:31:11 -07:00
Zach Anderson b3093ecee6 [dart:io] Move Platform.ansiSupported to {Stdin,Stdout}.supportsAnsiEscapes
On Windows, some Windows 10 builds support only ANSI output, but not
input, so these need to be separated.

I'm also improving the detection on Mac and Linux to avoid hardcoding
the result. Instead, supportsAnsiEscapes will be true if isatty() and
the TERM environment variable contains the string 'xterm'.

related #28614

R=lrn@google.com

Review-Url: https://codereview.chromium.org/2753233002 .
2017-03-17 12:35:36 -07:00
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Zach Anderson a8bf498e56 [dart:io] Adds Platform.ansiSupported
This is so that flutter_tool can determine whether it can print
ANSI codes to the terminal on windows.

fixes #28614,#28984

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2739683005 .
2017-03-15 08:51:50 -07:00
Ryan Macnak dfd471eea2 Make the segfault handler attempt to symbolize Dart frames.
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2668443004 .
2017-01-30 16:38:50 -08:00
Florian Schneider 6cfce40fab Fix product and Mac build.
BUG=

Review URL: https://codereview.chromium.org/2518063008 .
2016-11-23 10:47:44 -08:00
Florian Schneider 6cd141def5 Dump stack trace on segfault in the VM.
Install a signal handler in the standalone VM that dumps a backtrace
similar to what we already do on assertion failures.

For now only Linux and MacOS are supported.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2514113002 .
2016-11-23 10:29:07 -08:00
Zachary Anderson 479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07:00
Zachary Anderson 1336e6149f Search for a native extension for the host architecture
R=iposva@google.com

Review URL: https://codereview.chromium.org/1896203002 .
2016-04-20 08:02:16 -07:00
Zachary Anderson 7308e58c3f Really remove io support when dart:io is unsupported.
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 .
2016-03-29 11:22:03 -07:00
Zachary Anderson c75a817ee0 Fixes some memory leaks in //runtime/bin
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 .
2016-03-14 11:08:52 -07:00
Zachary Anderson 3563dc0fb0 Use ExitProcess on Windows.
Even after joining threads, it is still possible for the exit code to be
polluted. NaCL uses ExitProcess to avoid this problem:

https://code.google.com/p/chromium/codesearch#chromium/src/native_client/src/shared/platform/win/nacl_exit.c

This change also cleans up thread local storage for the last Thread.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1410293006 .
2015-10-29 23:35:46 -07:00
Søren Gjesse e03ab17437 Make Platform.executable return the fully qualified path of the executable
BUG=http://dartbug.com/16994
R=kustermann@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1145053002
2015-05-20 13:14:51 +02:00
johnmccutchan@google.com 172baa03ff Service isolate rework take 2
Review URL: https://codereview.chromium.org//889443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43306 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 18:31:27 +00:00
johnmccutchan@google.com db271b0477 Revert r43217, r43215, r43208, r43207, and r43202.
Reverting because of some isolate spawn issues (on Windows, and pub bots).

Review URL: https://codereview.chromium.org//867113003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43219 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:56:18 +00:00
johnmccutchan@google.com 66aa470fc6 * Create vm-service isolate at Dart_Initialize time.
* Remove Service create callback.
* Simplify creation of service isolate.
* Creation is done on thread pool.
* Use vm-service isolate for loading in standalone embedder.
* Remove import of dart:io from builtin library.

performance changes:

no service isolate:

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

always start service isolate (as a thread pool task):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:45 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:44 | 100% | +12363 | -    0]

service does I/O (calls to Dart_LoadScript block until service is running):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

R=asiva@google.com

Review URL: https://codereview.chromium.org//584023004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43202 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:45:48 +00:00
ajohnsen@google.com 0f52be7f63 Make std* blocking file-descriptors.
This will most likely be a performance regression when piping, that
we'll have to look into in the future (copying data through
    message-passing).

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//154273003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32715 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 10:06:35 +00:00
ajohnsen@google.com b71e57617e Always mark stdout and stderr as blocking on exit.
This is required by some shell systems, such as Emacs.

BUG=https://code.google.com/p/dart/issues/detail?id=14301
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//59393003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29895 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 11:57:52 +00:00
ajohnsen@google.com db94aeca89 Always mark stdout as blocking when using 'print'.
BUG=http://code.google.com/p/dart/issues/detail?id=13712
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//25465002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28081 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 09:05:54 +00:00
ajohnsen@google.com 6949a7bd08 Simplify process exit-code handling on Posix, take 2.
As in https://codereview.chromium.org/24024007, except the monitor->Wait
is now called in a loop with a guard, to ensure we actually do get notified.

Also, now correctly exiting the thread if we have no more child
processes, using the initialize/terminate mutex as guard.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23717038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27380 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 13:05:13 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into '::dart::bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
iposva@google.com 9046a44a37 Prepare for removal of source_filter.gypi:
- Guard OS-dependent source files with #if TARGET_OS_* in a similar
  fashion to the architecture dependent sources.
Review URL: https://codereview.chromium.org//12282051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18786 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:17:38 +00:00
ager@google.com 8a14c1c319 Use FormatMessageW for Windows error messages to handle internationalized messages correctly.
R=sgjesse@google.com
BUG=dartbug.com/6986

Review URL: https://codereview.chromium.org//11558012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16041 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 14:39:21 +00:00
ager@google.com 28b43144e5 Update dart:io to convert strings between UTF8 and current code page
when interacting with the system.

What we get from and need to hand to the VM is utf8. What we
get from and need to hand to the system is in the current
code page.

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11275281

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14851 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 15:03:23 +00:00
whesse@google.com b074764cfb Fix for bug dart 3639: Process.run gets stuck on Mac
BUG=
TEST=Run fresh build no macosx10.7. Observe finishing to completion without being stuck on dartdoc step

Review URL: https://chromiumcodereview.appspot.com//10834423

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11034 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 11:45:48 +00:00
ager@google.com 758943e32a Add read-only environment variable access.
Map<String, String> env = new Platform().environment();

Unfortunately, this is a bit hard to test at this point. I
will move on to implement support for providing an environment
to processes that are started. At that point we can test it
properly.

Another follow-up change will be to remove the instantiation
for Platform. I would like this to be just

Map<String, String> env = Platform.environment();

R=sgjesse@google.com
BUG=dartbug.com/752
TEST=

Review URL: https://chromiumcodereview.appspot.com//10112002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6646 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 16:20:28 +00:00
ajohnsen@google.com d480a1eeef Add member localHostname() to the Dart IO Platform class.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10050011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6409 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 12:27:55 +00:00
sgjesse@google.com d7c8c1f1e4 Fix a number of issues with the process handling
1. Ignore the signal SIGPIPE on Linux and Mac OS

When reading from or writing to a closed pipe the signal SIGPIPE
is raised. The default handling of this is to terminate the
program. When signal SIGPIPE is ignored the read and write
returns EPIPE.

2. Wrong return type for stdio getter

3. When there is an error on a socket mark it as closed

4. Mark the pipe used for process exit status as a one way pipe

5. Add tests to test stdin, stdout and stderr in Dart scripts

R=ager@google.com

BUG=dart:536, dart:454
TEST=

Review URL: http://codereview.chromium.org//8662006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1793 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 14:49:18 +00:00
ager@google.com 87c2d27fcf Reapply directory error handling change.
Refactor code to have Platform::StrError(int error_code) on all
platforms. Use that to get better error messages on Windows as well.

BUG=
TEST=

Review URL: http://codereview.chromium.org//8511001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1344 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 11:22:33 +00:00
ager@google.com ec697c8481 Implementation of Platform class that exposes information about the machine and the OS.
R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8492007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1260 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-07 15:04:42 +00:00