Commit Graph

3601 Commits

Author SHA1 Message Date
Zachary Anderson a1579c6a45 Fuchsia: Implement recursive delete
Currently, readdir() doesn't fill out d_type correctly, so we just do
an extra stat() to get the file type.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2621093002 .
2017-01-10 15:08:39 -08:00
Zachary Anderson 245e62280e Fuchsia: Pass a job to launchpad_create()
This API will change soon such that passing 0 for the
job handle will prevent spawned processes from creating
new processes themselves.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2621783003 .
2017-01-10 11:01:09 -08:00
Zachary Anderson a5d8a2f365 Fuchsia: Adds support for Process.kill()
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2619233003 .
2017-01-09 15:57:41 -08:00
Zachary Anderson 44e5ace2df Fuchsia: Remove overly-restrictive assert from eventhandler
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2625463002 .
2017-01-09 11:20:51 -08:00
Zachary Anderson 9b8ce83ef3 Fuchsia: Use new call to get thread CPU time
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2613283002 .
2017-01-07 14:45:34 -08:00
Adam Barth 8eeb9df82d Use the new MX_PROCESS_SIGNALED signal name
R=zra@google.com, abarth@google.com

Review-Url: https://codereview.chromium.org/2614253002 .
2017-01-06 14:19:18 -08:00
Ben Konyi 9ff7ee6132 Created placeholders for MallocHooks implementation and added define DART_USE_TCMALLOC to specifiy when tcmalloc is available.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2619443002 .
2017-01-06 12:38:11 -08:00
Martin Kustermann e0a427a957 Workaround attempt for timeout flakiness: Avoid running atexit() handlers in fork()ed process on linux
About this CL:

  The only purpose of `if (fork() == 0) exit(0)` is to wake up
  a thread in the parent process which might be blocked on `wait()`.

  There is no need to run atexit() handlers in the `fork()`ed child.

  This is a *workaround attempt* for a deadlocked `free()` call inside the
  processing of atexit handlers in glibc.

  (Side note: There might be better ways of notifying the thread, like sending a
   signal to the particular pthread with `pthread_kill` which would make the
   `wait()` syscall be interrupted.)

About the issue:

  It is still unclear why, in this particular case, the tcmalloc locks should
  be hold during the `exit()` call:

    * via a static initializer tcmalloc uses
        `pthread_atfork(before=ObtainAllLocks(),
                        after_parent=ReleaseAllLocks(),
                        after_child=ReleaseAllLocks())`
      to register locking & unlocking around `fork()`

    * glibc's `fork()` runs the either `after_parent` or `after_child` handlers
      (unconditionally) which should free the locks

    * the `exit()` call later should be free to malloc/free

  The [BUG] describes more in detail how we can hit a tcmalloc deadlock in a
  different situation (it's a linux kernel bug).
  Namely, if the linux kernel runs OOM during `fork()` and therefore fails to
  set the new thread-id. The glibc code hits an assert and tries to allocate
  memory before `after_parent`/`after_child` handlers were executed which
  deadlocks.

BUG=https://github.com/dart-lang/sdk/issues/28246
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2618723002 .
2017-01-05 13:56:01 +01:00
Kevin Millikin 50348f5f22 Fixes to patch files necessary to use the analyzer
The analyzer has a stricter patch parser than the VM.  Patch files
cannot change signatures of patched members.  Specifically, they cannot
change:

  - the return type
  - a parameter's name
  - a parameter to an initializing formal
  - an optional parameter's default value

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2612043002 .
2017-01-05 12:23:51 +01:00
Zachary Anderson 5e2898887b Standardize errno's from a few dart:io File and Link calls
No new tests because I'm just returning more sensical errors in cases
that were already errors.

Not touching Windows. It's doing its own thing.

fixes #28201, #28202, #28204

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2612653003 .
2017-01-04 13:09:07 -08:00
Zachary Anderson 5c8510bca5 Make RandomAccessFile.writeFrom use the correct starting offset
fixes #28174

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2615673002 .
2017-01-04 09:33:28 -08:00
Zachary Anderson 1f6c914d67 Signal an error for File.lastModified on a directory
fixes #28173

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2616463004 .
2017-01-04 07:50:35 -08:00
Zachary Anderson 128313ec3c Signal an error for File.length on a directory
fixes #28172

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2615473002 .
2017-01-03 15:06:23 -08:00
Zachary Anderson 375322d3ab GN: Add option to build with TSAN
fixes #28216

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2614493002 .
2017-01-03 14:37:27 -08:00
Zachary Anderson 2ad9b921be Reland: Make File.create() fail when a directory exists at the same path
related #28170

Review-Url: https://codereview.chromium.org/2594413002 .
2016-12-22 08:12:53 -08:00
Kasper Lund 101552b033 Revert "Make File.create() fail when a directory exists at the same path"
The added test case fails in non-English locales.

This reverts commit f2604a3647.

TBR'ed.

R=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2599723002 .
2016-12-22 09:56:45 +01:00
Zach Anderson f2604a3647 Make File.create() fail when a directory exists at the same path
fixes #28170

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2593913003 .
2016-12-21 15:19:23 -08:00
Zach Anderson 2b48261764 Fix Process.runSync error handling.
Now, failing to allocate a buffer for stderr or stdout will generate
an ENOMEM OSError exception.

Also previously, read() returning an error would cause buffers for
stderr and stdout to leak. After this change, they'll be reclaimed.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2596543002 .
2016-12-21 09:10:40 -08:00
Zachary Anderson 1f99052303 Fuchsia: Adds File::Copy()
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2591523002 .
2016-12-20 09:44:08 -08:00
Zachary Anderson 918b90ba46 Fuchsia: implement Process::Wait() for Process.runSync()
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2591473004 .
2016-12-20 09:30:00 -08:00
Zachary Anderson 1f289fc12b Fuchsia: resolve executable name, fetch environment vars
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2581363002 .
2016-12-16 21:23:20 -08:00
Zachary Anderson a919399031 Fix directory existence query error
fixes #28147

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2580133002 .
2016-12-16 20:58:52 -08:00
Ryan Macnak 4607e38d28 Reapply "Save and restore feedback from JIT."
Ensure ICData is attached to the callee flow graph in the inliner when built from kernel IR, not just from source.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2572423004 .
2016-12-16 16:00:17 -08:00
Ryan Macnak 1a41627ecc When creating a JIT app snapshot, don't recreate the VM isolate snapshot.
Prerequisite for using multiple isolate snapshots in the same process.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2583673002 .
2016-12-16 15:44:29 -08:00
Ryan Macnak 176d732cc3 Revert "Save and restore feedback from JIT."
This reverts commit 31ee20297e.

Review-Url: https://codereview.chromium.org/2579413002 .
2016-12-16 13:53:20 -08:00
Ryan Macnak 31ee20297e Save and restore feedback from JIT.
- Adjust fingerprints to be independent of the library's private key, which varies with load order.
 - Use usage_counter in AOT inlining decisions if JIT feedback is available.
 - Reduce inlining in cold functions.

dart2js product aot snapshot 15841351 -> 14436273 (-8.86%)

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2562693003 .
2016-12-16 10:21:40 -08:00
Zach Anderson 9506cb9975 Error checking for Stdio calls
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2585443002 .
2016-12-15 11:12:42 -08:00
Zachary Anderson 846a73e262 Fuchsia: Directory listing
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2579483002 .
2016-12-14 15:06:27 -08:00
Zachary Anderson 4b9087f9f5 Handle non-regular files in recursive delete
Fix is similar to the fix for directory listing from last week.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2573143002 .
2016-12-14 12:54:59 -08:00
Zachary Anderson 7f55ad8b86 Fuchsia: Allows building the full SDK for host and target.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2571713004 .
2016-12-13 13:02:52 -08:00
Zachary Anderson 32e5ef787d Fuchsia: dart:io Processes
This change adds support for non-detached processes
spawned with Process.run and Process.start (but not Process.runSync).

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2563463002 .
2016-12-13 11:09:55 -08:00
Kasper Lund 53dd819a4c Cleanup the kernel service implementation and avoid printing on the console when no tracing flags are provided.
R=kmillikin@google.com, hausner@google.com
BUG=

Review-Url: https://codereview.chromium.org/2570483003 .
2016-12-13 09:08:10 +01:00
John McCutchan f125cc7d0b Improve the casing of Stackmap and Stacktrace.
- [x] Stackmap -> StackMap
- [x] Stacktrace -> StackTrace

This makes us consistent with the Dart language (StackTrace) and
corrects the casing of StackMap.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2572563004 .
2016-12-12 14:51:30 -08:00
John McCutchan adfa01b907 Enable code write protection on standalone VM
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2563803002 .
2016-12-08 15:10:47 -08:00
Zachary Anderson 35d87e7b75 Fuchsia: fix build
mx_size_t -> size_t

Review URL: https://codereview.chromium.org/2559843003 .
2016-12-08 12:28:52 -08:00
Zachary Anderson 4f04970a13 Handle non-regular file types in the directory lister
fixes #28015

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2556313002 .
2016-12-08 10:02:04 -08:00
Zachary Anderson f4b7952ae0 Fuchsia: Reland enable observatory. Pass rpath for host builds.
Fuchsia host build boilerplate doesn't setup rpath the same way that
the standalone build does, so we pass the flags explicitly when
building dart executables.

Review URL: https://codereview.chromium.org/2552203006 .
2016-12-07 23:14:25 -08:00
Zachary Anderson da544dee08 Fuchsia: Revert observatory inclusion again
Review URL: https://codereview.chromium.org/2555343002 .
2016-12-07 14:48:57 -08:00
Zachary Anderson 82f3ca2b1d Fuchsia: Re-land build of VM with Observatory with better debug output.
Review URL: https://codereview.chromium.org/2555813004 .
2016-12-07 13:01:59 -08:00
Zachary Anderson 59ecf032b6 Fuchsia: Revert build of VM with observatory
Review URL: https://codereview.chromium.org/2560703004 .
2016-12-07 12:29:34 -08:00
Zachary Anderson 6f0b59b508 Fuchsia: Make targets including the observatory in the standlone VM available.
R=asiva@google.com

Review URL: https://codereview.chromium.org/2553273002 .
2016-12-07 11:12:02 -08:00
Matthias Hausner f5ab173c77 Add Kernel Isolate, second attempt
To run a script with the Dart->Kernel parser, use the -dfe option:

dart --dfe=runtime/tools/kernel-service.dart  --packages=/src/d2/sdk/.packages  foo.dart

The front end expects a directory named patched_sdk in the build directory (patched_sdk should be a sibling of the directory that contains the dart executable.)

Warning: using a debug build dart executable is very slow. It takes 2 minutes to run Hello World in a debug build, and about 7 seconds in a release build.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2558673002 .
2016-12-07 09:11:16 -08:00
Matthias Hausner 2ea399285a Revert "Add Kernel Isolate"
This reverts commit c9399fc557.

The change broke Dartium and Fuchsia.

BUG=

Review URL: https://codereview.chromium.org/2554953004 .
2016-12-06 14:17:09 -08:00
Matthias Hausner c9399fc557 Add Kernel Isolate
To run a script with the Dart->Kernel parser, use the -dfe option:

dart --dfe=runtime/tools/kernel-service.dart  --packages=/src/d2/sdk/.packages  foo.dart

The front end expects a directory named patched_sdk in the build directory (patched_sdk should be a sibling of the directory that contains the dart executable.)

Warning: using a debug build dart executable is very slow. It takes 2 minutes to run Hello World in a debug build, and about 7 seconds in a release build.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2483373002 .
2016-12-06 12:23:09 -08:00
Zachary Anderson bc661cf77b Fuchsia: Update VM test statuses
R=asiva@google.com

Review URL: https://codereview.chromium.org/2529293010 .
2016-12-01 20:28:14 -08:00
Ryan Macnak 3126ade6d0 Fuchsia: Throttle epoll to prevent message queues from being overwhelmed with level-triggered events.
BUG=US-109
R=asiva@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2545833003 .
2016-12-01 16:39:22 -08:00
Martin Kustermann 37dfdbdc97 VM: Remove unused (and incomplete) HashMap::Remove() function
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2542103002 .
2016-12-01 13:51:49 +01:00
Martin Kustermann d822f36f15 VM: Fix memory leak during shutdown
The way runtime/platform/hashmap.h:HashMap was implemented so far did not allow
deleting elements while iterating over the map. If one iterated like this

  HashMap::Entry* cursor = map.Start();
  while (cursor != NULL) {
    if (cond) {
      map.Remove(cursor->key, cursor->hash);
    }
    cursor = map.Next(cursor);
  }

Then the iteration `cursor` will skip elements. This is due to the fact that
`HashMap::Remove()` is left-rotating elements in certain cases and
`HashMap::Next()` will unconditionally advance to the next position in the
backing store.

PROBLEM IS: There was existing code which did remove elements while iterating
over a HashMap.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2533303005 .
2016-11-30 23:52:04 +01:00
Zachary Anderson c8ecd31aa5 Properly label vm_tests as tests
This will allow build tools that are interested in target types to work
properly.

BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2540853002 .
2016-11-30 14:34:37 -08:00
Zachary Anderson cec2a1cab2 Adjust memory pressure from SSL
This includes the size of the internal memory buffers for the filter
and the trusted certs in the security context.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2542663002 .
2016-11-30 10:26:45 -08:00