Issue 19997 - std.socket.InternetHost.getHostByAddr unittest does not work with IPv6
Summary: std.socket.InternetHost.getHostByAddr unittest does not work with IPv6
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-22 18:51 UTC by Dan Printzell
Modified: 2024-12-01 16:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dan Printzell 2019-06-22 18:51:42 UTC
The unittest[1] does not work when www.digitalmars.com resolved to a IPv6 address.

[1] https://github.com/dlang/phobos/blob/35e9f2fbbaab75815c01a7e6b7d207e98afb9d56/std/socket.d#L790

---

core.exception.AssertError@std/socket.d(790): unittest failure
----------------
??:? onAssertErrorMsg [0x7f7b50a58a23]
??:? onUnittestErrorMsg [0x7f7b50a58aa5]
??:? _d_unittest_msg [0x7f7b50a58d64]
??:? _d_unittest [0x7f7b50a58da5]
??:? _d_unittestp [0x7f7b50a58d1d]
??:? @safe void std.socket.__unittest_L773_C7() [0x7f7b4f81033c]
??:? void std.socket.__modtest() [0x7f7b4f81c636]
../druntime/src/test_runner.d:61 [0x56463967c9db]
../druntime/src/test_runner.d:32 [0x56463967c8e7]
../druntime/src/test_runner.d:13 [0x56463967c71f]
??:? runModuleUnitTests [0x7f7b50a59946]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x7f7b50a80c49]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x7f7b50a80bc4]
??:? _d_run_main [0x7f7b50a80b2a]
??:? [0x56463967cfa1]
??:? __libc_start_main [0x7f7b4b853ee2]
```
Comment 1 shove 2019-07-05 12:19:00 UTC
https://github.com/dlang/phobos/blob/35e9f2fbbaab75815c01a7e6b7d207e98afb9d56/std/socket.d#L986

Also here, IPv6 can cause exceptions.
std/socket.d does not fully support IPv6, such as GetHostByAddr().

Perfecting std/socket.d to fully support IPv6 is certainly the best, but it's a bit of a workload.
So it may be a short-term solution to temporarily handle unittest to make it work properly. Otherwise, auto-tester of PR will be interrupted frequently.
Comment 2 dlangBugzillaToGithub 2024-12-01 16:35:07 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9773

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB