Artifacts Associated With Ticket 91466985995db6b5
Ticket change [5fb0df8e65] (rid 143798) by emiliano on 2015-11-01 21:35:28:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
On NetBSD, gethostbyname_r is detected but the function is incompatible with Tcl usage, so at least on NetBSD-7 [info hostname] crashes. Attached patch solves the issue.
- foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "emiliano"
- priority initialized to: "5 Medium"
- private_contact initialized to: "885ae311f5fce05c2a8d9c31d2d2a1b5638ca9df"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "emiliano"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to:
NetBSD's gethostbyname_r() incompatible with Tcl usage
- type initialized to: "Bug"
Add attachment "nbsd_gethostbyname.diff" [438f049396] (rid 143799) by emiliano on 2015-11-01 21:35:58.
Ticket change [090628fbc9] (rid 143810) by emiliano on 2015-11-02 11:29:23:
- login: "emiliano"
- mimetype: "text/plain"
- subsystem changed to: "52. Portability Support"
Ticket change [08d2659275] (rid 147583) by emiliano on 2016-07-07 12:57:36:
- icomment:
More evidence that gethostbyname_r() is unsupported on NetBSD: http://mail-index.netbsd.org/netbsd-users/2016/06/30/msg018651.html
- login: "emiliano"
- mimetype: "text/plain"
- icomment:
Ticket change [4281739fd0] (rid 147724) by dkf on 2016-07-09 08:37:26:
- icomment:
Is there a reason for that platform not using getaddrinfo()?
- login: "dkf"
- mimetype: "text/plain"
- icomment:
Ticket change [b673e41064] (rid 147725) by dkf on 2016-07-09 08:40:30:
- icomment:
By which I mean "why don't we switch to using getaddrinfo() there as well as for actually creating sockets?" After all, we've already got the machinery largely there in tclIOSock.c...
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"
- icomment:
Ticket change [0e4f2e16ef] (rid 148195) by gustafn2 on 2016-07-21 12:13:57:
- icomment:
my 5ct: i would think that in cases, where HAVE_GETADDRINFO is defined, one should use getaddrinfo() instead of gethostbyname*(). If there are really systems in use, which do not HAVE_GETADDRINFO, these can fallback to the GETHOSTBYNAME machinery.
- login: "gustafn2"
- mimetype: "text/plain"
- icomment:
Ticket change [ab5d7a06ad] (rid 148196) by gustafn2 on 2016-07-21 12:20:09:
- icomment:
... we do this in NaviServer, see e.g. <a href="https://bitbucket.org/naviserver/naviserver/src/5f7cd4c8661884156c5d5a0af65ecc3b09485d54/nsd/dns.c?at=default&fileviewer=file-view-default#dns.c-372">bitbucket/naviserver/nsd/dns.c#372</a>
- login: "gustafn2"
- mimetype: "text/html"
- icomment:
Add attachment "tcl86-gethostbyaddr.patch" [a793c53f80] (rid 148258) by gustafn2 on 2016-07-26 10:04:14.
Ticket change [bd24831039] (rid 148261) by gustafn2 on 2016-07-26 10:13:03:
- icomment:
I've added a patch replacing all occurrences of gethostbyname_r() by an appropriate call of getaddrinfo(). Actually, the definition of TclpGetHostByName() could/should be dropped, when HAVE_GETADDRINFO is defined (i am not sure, what the policy in tcl-core concerning Tclp* calls is). I would recommend to drop TclpGetHostByName(), since this returns a partial struct hostent, which makes mostly sense in connection with gethostbyname*().
- login: "gustafn2"
- mimetype: "text/plain"
- icomment:
Ticket change [7764c10e05] (rid 153998) by emiliano on 2017-05-29 15:30:34:
- icomment:
From a fresh update of Tcl trunk (2017-05-29), compiled with default options: % info hostname cabernet.vinotinto.com.ar % info patchlevel 8.7a0 % uname -a NetBSD cabernet.vinotinto.com.ar 7.1 NetBSD 7.1 (GENERIC.201703111743Z) i386 So this ticket can be closed. The issue of using non-standard interfaces (gethostbyname_r) when a standard one can be used (getaddrinfo) should be addressed to avoid reintroducing these type of bugs
- login: "emiliano"
- mimetype: "text/plain"
- icomment:
Ticket change [44c50ea2c9] (rid 175638) by krytarowski on 2019-10-02 13:40:40:
- closedate changed to: "2458759.06990988"
- closer changed to: "krytarowski"
- icomment:
Fixed with https://core.tcl-lang.org/tcl/info/16768d65f0
- login: "krytarowski"
- mimetype: "text/plain"
- status changed to: "Closed"