Commit graph

628 commits

Author SHA1 Message Date
Vyacheslav Egorov bda70c8489 [vm] Remove support for dart-ext: imports
Per breaking change #45451 we are removing support for dart-ext:
style native extensions from the Dart VM.

This CL removes the associated VM code, tests and samples. It also ports
a single test which used dart-ext: import to use FFI instead.

TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/45451
Change-Id: Iae984bce32baf29a950b5de1323939006a217b94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212050
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-02 14:14:35 +00:00
asiva bc387837c4 [VM/Runtime] Reland : Fix 'File' object leak in async file open operation
The 'File' object created in the async file open method is leaked
if the operation is not completed when the isolate shuts down
with an unhandled exception.
This change adds a finalizable state for the 'File' object so that
the message deletion that happens when ports are closed could run
the callback to clean up the 'File' object.


TEST=new tests added

Change-Id: I64c18a7905261b0fc7bf9f220086791478232d0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211340
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-08-27 17:45:17 +00:00
William Hesse 637e14006c Revert "[VM/Runtime] Fix 'File' object leak in async file open operation"
This reverts commit b67f45f955.

Reason for revert: This seems to cause a crash on ARMv7 aot compiled code.

Original change's description:
> [VM/Runtime] Fix 'File' object leak in async file open operation
>
> The 'File' object created in the async file open method is leaked
> if the operation is not completed when the isolate shuts down
> with an unhandled exception.
> This change adds a finalizable state for the 'File' object so that
> the message deletion that happens when ports are closed could run
> the callback to clean up the 'File' object.
>
> TEST=new tests added
>
> Change-Id: I4a3cb28370d27306c795c1914aeb5c18a1d85e2b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210761
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

TBR=aam@google.com,rmacnak@google.com,asiva@google.com

Change-Id: Ie91aadd318ef19a0bb4d7f769c9e876e76d719d8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211021
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2021-08-24 12:49:23 +00:00
asiva b67f45f955 [VM/Runtime] Fix 'File' object leak in async file open operation
The 'File' object created in the async file open method is leaked
if the operation is not completed when the isolate shuts down
with an unhandled exception.
This change adds a finalizable state for the 'File' object so that
the message deletion that happens when ports are closed could run
the callback to clean up the 'File' object.

TEST=new tests added

Change-Id: I4a3cb28370d27306c795c1914aeb5c18a1d85e2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210761
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-08-23 20:57:48 +00:00
Alexander Aprelev 003e79752c [gardening] Ensure directory_fuzz_test creates test directories in temp folder, not in check-out location.
Fixes https://github.com/dart-lang/sdk/issues/46737

This is similar to https://dart-review.googlesource.com/c/sdk/+/208285

TEST=directory_fuzz_test

Change-Id: Ia74e221ac7095fd6fc4729aec51770df5eabdbe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209105
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-08-06 15:32:22 +00:00
Alexander Aprelev 2f0c35ea0b [vm/gardening] Revert changes to datagram test to accommodate unreliable nature of datagram packets delivery.
On Windows even on localhost datagrams are being sometimes dropped, which is a little surprising but not impossible.
So this CL reverts changes to the test that expects all datagrams to be received.

This is follow-up to https://dart.googlesource.com/sdk/+/d8839511737dbd1775f37cb5a13862bd7d6f4b88

TEST=raw_datagram_read_all_test on Windows

Fixes https://github.com/dart-lang/sdk/issues/46747

Change-Id: I498b9d8c2ea7849de0f3e91acc952043a9312589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208345
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 19:53:14 +00:00
Alexander Aprelev 828cd72cd8 [vm/gardening] Ensure test waits for files to be deleted before deleting temp folder.
This is follow-up to d883951173.

Fixes https://github.com/dart-lang/sdk/issues/46747

Change-Id: I342402cbe959e4f0422d84df39e4368117fd9ca5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208342
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 19:03:44 +00:00
Alexander Aprelev d883951173 [vm/gardening] Cleanup file_fuzz_test and raw_datagram_read_all_test.
This is follow-up to https://dart.googlesource.com/sdk/+/babfe05e4a9e892d71f8f6ebcb6df82095bea0da and https://dart.googlesource.com/sdk/+/f424f3a4cca306513e77c7747682f1c1c99e3307.

TEST=ci

Change-Id: Ic4143f9eec90cd2a6218d4f33fdc29d298ef3c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208340
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 16:52:54 +00:00
Alexander Aprelev f424f3a4cc [vm/gardening] Fix file_fuzz_test so it doesn't create files in the dart sdk checkout root.
Fixes https://github.com/dart-lang/sdk/issues/46737

TEST=Ensure file_fuzz_test doesn't create 'a' file

Change-Id: I200bc63a86f75e0b770f1a2240a9e2bfdc99aef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208285
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 02:20:13 +00:00
Alexander Aprelev babfe05e4a [vm/gardening] Increase wait on receive side for all datagrams to make it.
The test seems to flakily fail on regular bots, fail on reload bots because of aggressive hardcoded wait on receive side of RawDatagramSocket test.

Fixes https://github.com/dart-lang/sdk/issues/44037
Fixes https://github.com/dart-lang/sdk/issues/35235

TEST=raw_datagram_read_all_test on ci

Change-Id: Ic9c7cec619783b102b14396fb694467d5030b5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208284
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 00:57:43 +00:00
Martin Kustermann 6a87d049ac [vm] Use unique names for process-anonymous unix domain sockets in test
This will allow running the same test concurrently in multiple isolates
without causing name collisions.

It also aligns the NNBD and non-NNBD test.

TEST=Making test more robust. Fixes one issue in iso-stress builder.

Change-Id: Ic0c15a0f47de8e255d2bdfb96547d44d016b2a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207125
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-07-16 14:23:37 +00:00
Martin Kustermann 627292bcc0 [vm] Remove --experimental-enable-isolate-groups-jit, only guard via --enable-isolate-groups
The JIT support has progressed and is no longer unstable. We'll
therefore remove the experimental flag and rely on the same
--enable-isolate-groups flag as in AOT mode.

Issue https://github.com/dart-lang/sdk/issues/36097

TEST=Existing test suite.

Change-Id: Iff0dd5b64d9b6ab91ad9ffc0ae445efc802d3908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207122
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-16 09:13:28 +00:00
Martin Kustermann 91ac6475cb [vm/concurrency] Enable more isolate tests, remove outdated TODOs, fix 2 tests
This CL

  * Removes conditional Skip markers in status files
  * Removes some outdated TODOs in the code
  * Deletes tests/lib_2/isolate/isolate_stress_test
    => It's skipped everywhere, we no longer support isolates on web
  * Fixes standalone{,_2}/io/directory_list_sync_test:
    => Instead of relying on the Platform.script which could be an ELF
       file lying somewhere else, use Platform.executable instead
  * Fixes standalone{,_2}/io/unix_socket_test:
    => The server used `sub.cancel()` to close it's reading end while
       the client tried to write to it. This is racy.
       If the server goes first, the write on client will throw (since
       no error listener was installed on socket.done)
       Avoid the race by coordinating client/server.

Issue https://github.com/dart-lang/sdk/issues/36097

TEST=Enables more tests.

Change-Id: I0464f81f540f2eda23ef4199cc536e53e6a809b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207120
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-16 07:51:58 +00:00
Martin Kustermann 1ab1438431 [vm] Fix incorrect socket/unix-domain-socket binding code for shared sockets
When creating a binding socket with `shared: true` there will be one
underlying [OSSocket] used. Any following bind on the same address with
`shared: true` will re-use that [OSSocket].

The code that was searching for existing sockets is correct, but the
code that increments the refcount, ... was incorrectly using the start
of the linked list instead of the found existing socket instance.

Fixes https://github.com/dart-lang/sdk/issues/46634

TEST=standalone{,_2}/io/unix_socket_regress_46634_test

Change-Id: I3ce1bdc98ecd4b5311f826ab2597a62fe048be09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207083
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-16 00:27:27 +00:00
Martin Kustermann 6f8304d1f5 [vm] Fix test to use sync file system operations
The test uses a temporary directory that gets deleted once the test
finishes. Though some calls to async methods are not await'ed, so the
directory might get removed before the async methods are completed.

We instead change the test to use synchronous methods consistently. The
regression test is still testing the `rename` method as before.

TEST=Fixes iso-stress builder failures where this issue occurs.

Change-Id: Ide3098fa67de619756417e83df056cf5d1299189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207003
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-15 09:31:39 +00:00
Martin Kustermann d6d00b344a [vm] Fix standalone{,_2}/io/issue_30687_test to operate in custom temp directory
All of our tests relying on filesystem operations should operate in a
randomly created temporary directory. This ensures the test will not
interact badly with other tests - running in parallel.

This particular test couldn't be run multiple times concurrently,
since it would cause races to FSE creation/deletion.

TEST=Fixes iso-stress builder issue (which runs tests repeatedly in parallel)

Change-Id: I8b2e015bf4b6a9ecdfa471eb2ec887e634c2b233
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206783
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-14 12:45:00 +00:00
Martin Kustermann c133aa8660 Reland "[vm] Remove --causal-async-stacks flag"
The flag isn't used anywhere in our tests or in embedder code. Turning
it on will result in a VM startup error.

We should therefore remove all uses of the flag and the flag itself.

This is a unmodified reland of

  https://dart-review.googlesource.com/c/sdk/+/204500

after some remaining g3 usages have been fixed (the flutter
roll didn't port the GN changes to BUILD changes in g3)

TEST=Existing test suite.

Change-Id: Ic28c9b334a0b04524ee57e2554cc8d713a83fbfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204785
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-02 14:26:46 +00:00
Alexander Aprelev b1db8a3c65 [io/gardening] Marking large_file_read_small_file_test slow.
Fixes https://github.com/dart-lang/sdk/issues/45388.

TEST=io/large_file_read_small_file_test

Change-Id: Ib3512f3005a820ff69e8cbe4c5e3f6b0b5e1a0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205841
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-02 03:53:13 +00:00
Konstantin Shcheglov 32f9d0c404 Issue 46529. Annotate imports unresolved because of errors in .packages files.
Bug: https://github.com/dart-lang/sdk/issues/46529
Change-Id: I05dc36914adddb6196ade294650ec683dc4a593d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205628
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-01 16:15:18 +00:00
Ben Konyi 71c61ea24c [ VM ] Add delay between SIGINTs to fix flakiness of regress_42092_test
Change-Id: I1cce3f37491567bd13c9f64d4d15afed23a35a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204901
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-29 01:36:32 +00:00
Martin Kustermann 0999d13ff3 Revert "[vm] Remove --causal-async-stacks flag"
This reverts commit b1f1aee94d.

Reason for revert: Some left-over uses in g3 need to removed first
(some were removed in b/380758599 but apparently there's some 
usages left).

Original change's description:
> [vm] Remove --causal-async-stacks flag
>
> The flag isn't used anywhere in our tests or in embedder code. Turning
> it on will result in a VM startup error.
>
> We should therefore remove all uses of the flag and the flag itself.
>
> TEST=Existing test suite.
>
> Change-Id: I19dfba052df7948dfdb379c0610dab67ebbcd12d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204500
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,cskau@google.com

Change-Id: I03aad46f46153d5ea4ac2fcdd5685d0ef2a0d9af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204723
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-06-23 16:53:22 +00:00
Martin Kustermann b1f1aee94d [vm] Remove --causal-async-stacks flag
The flag isn't used anywhere in our tests or in embedder code. Turning
it on will result in a VM startup error.

We should therefore remove all uses of the flag and the flag itself.

TEST=Existing test suite.

Change-Id: I19dfba052df7948dfdb379c0610dab67ebbcd12d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204500
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-06-23 14:37:31 +00:00
Alexander Aprelev b791ee1b9e [gardening] Skip socket_sigpipe_test on jitk, simarm.
The test uses ffi and it spawns helper process, therefore it's not compatible with those bots.

Fixes https://github.com/dart-lang/sdk/issues/46386.
Fixes https://github.com/dart-lang/sdk/issues/46387.

TEST=ci

Change-Id: I680609c17c91133e7208bc2dc7ffe7c847f4987d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203830
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-16 21:56:57 +00:00
Alexander Aprelev fb32ffd97f [io/mac/sigpipe] Ensure SIGPIPE is not triggered for client socket connect code.
Fixes https://github.com/flutter/flutter/issues/84499

TEST=socket_sigpipe_test.dart

Change-Id: I220558e74b41c1969efa422254867c11dd17ee91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203660
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-16 17:38:37 +00:00
Alexander Aprelev bd4a6291e5 [io/stacktraces] Fix socket_connect_stacktrace_test exception expectations.
This is follow-up to 52aa8508f1.

TEST=socket_connect_stacktrace_test

Change-Id: I46eafa4852bed92eaf1a9035bcb3b007d700fc0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203280
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-10 18:27:40 +00:00
Alexander Aprelev 52aa8508f1 [io/stacktraces] Ensure websocket connect reports callers stacktrace.
Introduce dwarf-friendly socket connect stacktrace test.

TEST=socket_connect_dwarf_stacktrace_test

Fixes https://github.com/dart-lang/sdk/issues/46304

Change-Id: I428ac4b334d9d80ea06c64283ece3ff411abfa19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203160
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-10 16:16:50 +00:00
Tess Strickland 7d44c20f2c [tests] Fixes for standalone{,_2}/check_for_aot_snapshot_jit_test.
* Skip on IA32, since it has no AOT mode.

* Use .bat/.exe suffixes on Windows.

* Look for gen_snapshot in <buildDir>/clang_x64 on MacOS ARM64.

* Avoid using Platform.script to find .dart source file locations, since
  some architectures generate a .dill for running JIT programs, which
  will be in the generated files directory, not the SDK directory.

* Try both 'dart <aotsnapshot>' and 'dart run <aotsnapshot>', which
  should both give the correct error message.

Cq-Include-Trybots: luci.dart.try:vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-release-ia32-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-mac-release-x64-try,vm-kernel-nnbd-mac-release-x64-try
Change-Id: Ic50b86fb51b5f2b30c6a4cb4fd8f0594bb1cf93d
Bug: https://github.com/dart-lang/sdk/issues/46306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202923
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-06-09 12:22:41 +00:00
Alexander Aprelev 80749188ca [io/socket] When socket connection fails report stacktrace of the callsite.
Currently stack trace reported on thrown exceptions is null.

TEST=socket_connect_stacktrace_test.dart

Bug: https://github.com/dart-lang/sdk/issues/44994
Change-Id: I188aff197ab519272f63f41387b94458c2f1cec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202802
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-08 16:17:47 +00:00
Martin Kustermann 706965fd2c [gardening] Fix string_overflow_test.dart
The test was originally introduced in [0]. This restores its state to
how it was written back then with some small adjustements.

[0] d8ef2ae7 https://codereview.chromium.org//16783003

TEST=standalone{,_2}/string_overflow_test

Fixes https://github.com/dart-lang/sdk/issues/46225

Change-Id: I255f676481f2ab6e906ebfe4612d394c29663dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202482
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-06-04 14:38:16 +00:00
Alexander Aprelev 05e5427800 [io/mac] Ensure FSEventsWatcher::Node is deleted synchronously with Callback that uses it.
This is follow-up to ed82bb6f4c

TEST=tests/standalone/io/file_system_watcher_large_set_test.dart

Change-Id: If02c922eafe1371c6e67196158896b9cb786bfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202312
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-04 14:26:36 +00:00
Alexander Aprelev 6c254fab89 [io/http] Don't add zero-valued content-length header on GET, HEAD, DELETE, CONNECT requests.
Per https://tools.ietf.org/html/rfc7230#section-3.3.2:
"... A user agent SHOULD NOT send a
Content-Length header field when the request message does not contain
a payload body and the method semantics do not anticipate such a
body."

Fixes https://github.com/dart-lang/sdk/issues/45139

Change-Id: I96b735c06038eb3d12a303ee5329228a9b594726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194881
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-06-03 16:14:24 +00:00
Robert Nystrom e376bcd30f Rename "string/overflow.dart" -> "string/overflow_test.dart".
Change-Id: I32fa46c5750ee6d2410231322bf16fa7decb751d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201227
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-06-03 00:40:24 +00:00
Alexander Thomas 997487db0f [testing] Fix line numbers in dwarf_stack_trace_test.dart
The test contained hardcoded line numbers that changed when the language
version comment was added[1].

[1] https://dart-review.googlesource.com/c/sdk/+/201564

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try
Change-Id: I2fda2b013a8ac3ee71dd98a6c243c00a5aeae823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202040
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-06-02 09:54:25 +00:00
Alexander Thomas 7baeabe0e4 [testing] Rely on language versions in the analyzer tests
https://github.com/dart-lang/co19/issues/1090

TEST=Standard tryjobs, all changes are in test code only.

Change-Id: Ie73174447ab165827335652cf035f85b7510ab55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201564
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-06-02 07:47:46 +00:00
Zach Anderson 8beec1d9cc Fix abstract unix socket test
There was a race between the subprocess listening on the socket and
the test trying to connect.

Also the Android bits of the test harness needed to be taught about
the abstract_socket_test program, similar to how process_test is
handled.

TEST=Fixes tests
Change-Id: I5e1c5d2e23e4bff2a01cd5c491a45e1c58d2578e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201861
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-06-01 17:30:54 +00:00
asiva 0742ed66a7 [VM/Tests] - Fix new abstract_socket_test.
- Skip in configurations that do not build the abstract_socket_test
executable
- Fix MemorySanitizer: use-of-uninitialized-value error

TEST=existing test - unix-socket-test

Change-Id: Ie9bf6dc1cd6bea98cd7859584473154f6ac49eee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201722
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-05-29 00:16:34 +00:00
Zach Anderson 5dc1f8db8c Trim abstract unix socket path length
Fixes https://github.com/dart-lang/sdk/issues/46149

TEST=unix_socket_test
Change-Id: Icc5273941f880f581cc2621431b5cecb7782c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201441
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-27 21:50:24 +00:00
Alexander Aprelev 8d54a30825 [io/http] Introduce callback that embedder can override to provide custom HTTPClient connection validation.
For example, this can be used to ban insecure http connections, force use of https ones - see https://github.com/flutter/engine/pull/26226.

Issue https://github.com/flutter/flutter/issues/69685
Issue https://github.com/flutter/flutter/issues/54448

Change-Id: Id81aeae9aff0d469ac6f911e4e502b39ce9558bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200524
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-20 15:17:52 +00:00
Lasse R.H. Nielsen cf627eb01c Change signature of HttpClient.authenticate{,Proxy}.
Allow the `realm` argument to callbacks to be `null`.
This is a breaking change, but it only affects null-safe code.

Also fix a bug in http_impl.dart where an error function with
an *optional* stack trace parameter would be called without a stack trace.

Bug: https://github.com/dart-lang/sdk/issues/44039
Change-Id: I4b38382328e26478661bf45f46cd3017631f4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170094
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-20 13:13:42 +00:00
asiva fb90f11f4b [dart:io] - Fix incorrect setting of socket options for UNIX-DOMAIN sockets
- setting of UNIX-DOMAIN socket options was not throwing the correct error
- listen in HTTPServer was trying to set TCP_NODELAY for UNIX-DOMAIN sockets

Fixes :
 https://github.com/dart-lang/sdk/issues/45977
 https://github.com/dart-lang/sdk/pull/45978
 https://github.com/dart-lang/sdk/issues/45975

TEST=new test cases added

Change-Id: Ie0341f26b1ba0f9423c08a8de968053a2af1c730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199640
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-14 01:53:48 +00:00
Alexander Aprelev c395e5fe54 [vm/ssl] Reenable client certificate tests.
Fixes https://github.com/dart-lang/sdk/issues/26057

Change-Id: I172f7b8221f34d2bd16df324d96ad7a6ec88d54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199301
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-05-12 10:01:30 +00:00
Alexander Markov a98500a139 [vm/aot] Discard Code objects of invisible functions
Previously, Code objects of invisible functions were retained
in order to omit frames corresponding to such functions from stack
traces when stack trace is printed.

This change drops Code objects of invisible functions. That also
means that frames corresponding to such functions are no longer
skipped in binary DWARF stack traces.

In order to account for that, DW_AT_artificial attribute is added to
generated DWARF debug information to mark invisible functions.
Stack trace decoding now looks at this attribute and skips those
frames when symbolizing stack trace.

Flutter gallery in release-sizeopt mode:
Heap size of snapshot objects -4.2% (arm), -4.4% (arm64).

A large application in --dwarf_stack_traces mode:
Number of discarded Code objects increased from 72.4% to 83.7%
(out of all Code objects).
Heap size of Code objects -37.4%.
Heap size of all snapshot objects -5%.

TEST=tests/standalone/dwarf_stack_trace_invisible_functions_test.dart
Issue: https://github.com/dart-lang/sdk/issues/44852
Change-Id: Ib804852aba1e083670f1d9b9d66cbaab7dcdcff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196583
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-04-27 23:31:02 +00:00
Leaf Petersen b101a7d002 Add language versions to _2 test libraries
Change-Id: Ib33169c3e0ffc870915c189404074a1dea472546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196548
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-26 17:58:57 +00:00
Martin Kustermann e50a59d2f2 [gardening] Add stdout/stderr from subprocess if subprocess failed and makes test fail
Locally this test doesn't seem to fail though it did so on a nightly builder.
If the test fails again we'll have more information on what goes wrong.

TEST=Adding more information to test.

Change-Id: Id5ca71d42322c813ba3cfd56e9dfe335160e2e7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196497
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-04-23 10:23:31 +00:00
Xiao Yu d968304570 Reland "Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic"
This is a reland of d84f359786

Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

Bug: https://github.com/flutter/flutter/issues/72723
Change-Id: I466d888b3f324a996f0bef0463e7ab3df3179c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195485
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
2021-04-16 20:25:36 +00:00
Xiao Yu f560d90059 Revert "Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic"
This reverts commit d84f359786.

Reason for revert: removed some private looking but actually vm-entrypoints used by Flutter engine https://buganizer.corp.google.com/issues/185462669

Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,vegorov@google.com,xster@google.com

Change-Id: Ie746805ab7ef214bc4ba6f3582eb1d32672360ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/72723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195484
Reviewed-by: Xiao Yu <xster@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
2021-04-15 15:29:28 +00:00
Xiao Yu d84f359786 Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
Bug: https://github.com/flutter/flutter/issues/72723
Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
Auto-Submit: Xiao Yu <xster@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-04-15 09:25:17 +00:00
asiva f642761c54 [Runtime/Tests] - Do not output large amount of test data to stdout
- typed_data_isolate_test was printing received data to stdout which
causes trucation issues when running in the test script, changed test to
verify the received data and not print to stdout.

TEST=modifying a test.

Change-Id: I99357960e80fcdd2d65676c6bef326799f1d4d98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194884
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-12 04:51:05 +00:00
Alexander Aprelev bddded13aa [io/lookup] Ensure public type InternetAddress is used in lookup methods.
Use of private _InternetAddress class in method declarations results
in errors when user attempts to for example provide timeout handler.

Fixes https://github.com/dart-lang/sdk/issues/45542

Change-Id: Ied83479d7ce6319d0a82985c667ad29ef58cf6de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193720
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-03-31 19:43:42 +00:00
Alexander Aprelev f5432d7164 [io/http] Relax http parsing constraints around CRLF.
https://tools.ietf.org/html/rfc2616\#section-19.3 advises to
allow CR*LF wherever CRLF line terminator is expected.

Issue https://github.com/dart-lang/sdk/issues/43916

TEST=http_client_parser_crlf_tolerant_test, http_100_continue_test

Change-Id: I8c6d263bdb950b2f3992b69921eff0ee75704c10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192120
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-20 03:11:28 +00:00