|
2019-10-02
| ||
| 13:40 | • Closed ticket [9146698599]: NetBSD's gethostbyname_r() incompatible with Tcl... artifact: 44c50ea2c9 user: krytarowski | |
|
2017-05-29
| ||
| 15:30 | • Ticket [9146698599]: 3 changes artifact: 7764c10e05 user: emiliano | |
|
2016-07-26
| ||
| 10:13 | • Ticket [9146698599]: 3 changes artifact: bd24831039 user: gustafn2 | |
| 10:04 | • Add attachment tcl86-gethostbyaddr.patch to ticket [91466985995db6b5|91... artifact: a793c53f80 user: gustafn2 | |
|
2016-07-21
| ||
| 12:20 | • Ticket [9146698599] NetBSD's gethostbyname_r() incompatible with Tcl usage</... artifact: ab5d7a06ad user: gustafn2 | |
| 12:13 | • Ticket [9146698599]: 3 changes artifact: 0e4f2e16ef user: gustafn2 | |
|
2016-07-09
| ||
| 08:40 | • Ticket [9146698599]: 4 changes artifact: b673e41064 user: dkf | |
| 08:37 | • Ticket [9146698599]: 3 changes artifact: 4281739fd0 user: dkf | |
|
2016-07-07
| ||
| 12:57 | • Ticket [9146698599]: 3 changes artifact: 08d2659275 user: emiliano | |
|
2015-11-02
| ||
| 11:29 | • Ticket [9146698599]: 3 changes artifact: 090628fbc9 user: emiliano | |
|
2015-11-01
| ||
| 21:35 | • Add attachment nbsd_gethostbyname.diff to ticket [91466985995db6b5|9146... artifact: 438f049396 user: emiliano | |
| 21:35 | • New ticket [9146698599] NetBSD's gethostbyname_r() incompatible with Tcl usa... artifact: 5fb0df8e65 user: emiliano | |
NetBSD's gethostbyname_r() incompatible with Tcl usage
Closed91466985995db6b505c415322b8090a5754f2dc3Created 11 years agoUpdated 7 years ago
Descriptionplain2015-11-01 21:35:28
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.
emiliano Ticket [9146698599]: 3 changes
[History diff]2015-11-02 11:29:23
emilianoplain2016-07-07 12:57:36
More evidence that gethostbyname_r() is unsupported on NetBSD: http://mail-index.netbsd.org/netbsd-users/2016/06/30/msg018651.html
dkfplain2016-07-09 08:37:26
Is there a reason for that platform not using getaddrinfo()?
dkfhtml2016-07-09 08:40:30
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...
gustafn2plain2016-07-21 12:13:57
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.
gustafn2html2016-07-21 12:20:09
... we do this in NaviServer, see e.g. bitbucket/naviserver/nsd/dns.c#372
gustafn2plain2016-07-26 10:13:03
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*().
emilianoplain2017-05-29 15:30:34
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
krytarowskiplain2019-10-02 13:40:40
Fixed with https://core.tcl-lang.org/tcl/info/16768d65f0
Log in (anonymous is fine) to add a comment.