Bug 19997 – std.socket.InternetHost.getHostByAddr unittest does not work with IPv6

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-06-22T18:51:42Z
Last change time
2024-12-01T16:35:07Z
Assigned to
No Owner
Creator
Dan Printzell
Moved to GitHub: phobos#9773 →

Comments

Comment #0 by dlang — 2019-06-22T18:51:42Z
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 by shove — 2019-07-05T12:19:00Z
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 by robert.schadek — 2024-12-01T16:35:07Z
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