Skip to content

SDK unit test 'tests\standalone_2\io\socket_info_ipv6_test.dart' fails on Windows 10 #51778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
slonm opened this issue Mar 19, 2023 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io os-windows

Comments

@slonm
Copy link
Contributor

slonm commented Mar 19, 2023

Socket.remoteAddress returns incorrect address. The issue appears on any IPv6 address.

  • This tracker is for issues related to: dart:io

  • Dart SDK Version (dart --version): Dart SDK version: 2.19.3 (stable) (Tue Feb 28 15:52:19 2023 +0000) on "windows_x64"

Error message:

PS D:\project\coriv> dart run .\test\socket_info_ipv6_test.dart 
Unhandled exception:
Expect.equals(at index 2: Expected <::48a2:c98f:f77f:0%2414186288...>, Found: <::1>) fails.
#0      Expect._fail (file:///D:/project/coriv/test/expect.dart:696:5)
#1      Expect.equals (file:///D:/project/coriv/test/expect.dart:115:9)
#2      testHostAndPort.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///D:/project/coriv/test/socket_info_ipv6_test.dart:20:16)
#3      _RootZone.runUnaryGuarded (dart:async/zone.dart:1593:10)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#6      _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#7      _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
#8      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
#9      _RootZone.runUnaryGuarded (dart:async/zone.dart:1593:10)
#10     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#11     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#12     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#13     _StreamController._add (dart:async/stream_controller.dart:648:7)
#14     _StreamController.add (dart:async/stream_controller.dart:596:5)
#15     _RawServerSocket.listen.<anonymous closure> (dart:io-patch/socket_patch.dart:1779:24)
#16     _RootZone.runGuarded (dart:async/zone.dart:1581:10)
#17     _RootZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1628:23)
#18     _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1388:45)
#19     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)

I've made preliminary code research and found weird function:
https://github.com/dart-lang/sdk/blob/main/runtime/bin/socket_base_win.cc#L181

  1. RawAddr is a union. getpeername() writes to eaw.addr and when GetAddrPort() and SetAddrPort() read and write other fields of the union. Not sure is this union of different addresses family have well specified memory map to be united.
  2. Why port is set to 0? Comment mentions WSAAddressToString() but it calls nowhere in the SDK

Related issue: #23031

@lrhn lrhn added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io os-windows labels Mar 19, 2023
@slonm

This comment was marked as outdated.

@dart-lang dart-lang deleted a comment from faizan003 Apr 2, 2023
@mraleph
Copy link
Member

mraleph commented Apr 2, 2023

@slonm it was an AI generated nonsense answer.

@faizan003 please don't do this in the future!

slonm added a commit to slonm/dart_sdk that referenced this issue Apr 7, 2023
@slonm slonm changed the title SDK unit test 'test\socket_info_ipv6_test.dart' fails on Windows 10 SDK unit test 'tests\standalone_2\io\socket_info_ipv6_test.dart' fails on Windows 10 May 17, 2023
copybara-service bot pushed a commit that referenced this issue Jun 7, 2023
Closes #51981

GitOrigin-RevId: de22efd
Change-Id: If1d8247f7e0188c47c19e19f33732a56493d21d8
Bug: #51778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294220
Reviewed-by: Alexander Aprelev <[email protected]>
Commit-Queue: Brian Quinlan <[email protected]>
Reviewed-by: Brian Quinlan <[email protected]>
@brianquinlan
Copy link
Contributor

Thanks for the amazing work @slonm !

@lrhn lrhn added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. and removed area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io os-windows
Projects
None yet
Development

No branches or pull requests

4 participants