unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#13958: Failing net-db.test on armv5tel glibc 2.17
       [not found] ` <87txoert3q.fsf@gnu.org>
@ 2013-03-14 14:03   ` Lluís Batlle i Rossell
  2013-03-15 11:14     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Lluís Batlle i Rossell @ 2013-03-14 14:03 UTC (permalink / raw)
  To: 13958

Hello,

running the test below, I see on glibc-2.17 armv5tel-linux:
----
Running net-db.test

;;; (err -11)
unexpected error code: -11 "System error"
FAIL: net-db.test: getaddrinfo: no name
----

I mention glibc 2.17 because I think it didn't fail with glibc 2.13.

Regards,
Lluís.

On Thu, Mar 14, 2013 at 02:47:21PM +0100, Ludovic Courtès wrote:
> Lluís Batlle i Rossell <viric@viric.name> skribis:
> 
> > Running net-db.test
> > unexpected error code: -11 "System error"
> > FAIL: net-db.test: getaddrinfo: no name
> 
> La provo estas:
> 
>         (catch 'getaddrinfo-error
>           (lambda ()
>             (pk "getaddrinfo for \"does-not-exist\" succeeded!"
>                 (getaddrinfo "does-not-exist"))
>             (throw 'unresolved))
>           (lambda (key errcode)
>             ;; In some cases (e.g., in a chroot without
>             ;; /etc/{hosts,resolv.conf}), this can result in
>             ;; `EAI_EAGAIN' (glibc 2.11), or `EAI_NODATA' (glibc 2.12).
>             (and (or (= errcode EAI_NONAME)
>                      (and (defined? 'EAI_NODATA)  ; GNU extension
>                           (= errcode EAI_NODATA))
>                      (= errcode EAI_AGAIN)
>                      (begin
>                        (format #t "unexpected error code: ~a ~s~%"
>                                errcode (gai-strerror errcode))
>                        #f))
>                  (string? (gai-strerror errcode)))))
> 
> Ĉu vi povas ŝanĝi (= errcode EAI_NONAME) per (= (pk 'err errcode) EAI_NONAME)
> kaj sendi la detalojn al bug-guile@gnu.org?
> 
> Dankon!
> 
> Ludo'.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13958: Failing net-db.test on armv5tel glibc 2.17
  2013-03-14 14:03   ` bug#13958: Failing net-db.test on armv5tel glibc 2.17 Lluís Batlle i Rossell
@ 2013-03-15 11:14     ` Ludovic Courtès
  2013-03-15 11:34       ` Lluís Batlle i Rossell
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-03-15 11:14 UTC (permalink / raw)
  To: Lluís Batlle i Rossell; +Cc: 13958

Hi Lluís!

Lluís Batlle i Rossell <viric@viric.name> skribis:

> running the test below, I see on glibc-2.17 armv5tel-linux:
> ----
> Running net-db.test
>
> ;;; (err -11)
> unexpected error code: -11 "System error"
> FAIL: net-db.test: getaddrinfo: no name
> ----

Does it happen in a chroot without /etc/resolv.conf & co.?

Is it a dynamically-linked binary?

Could you run “strace -o log -f ./check-guile net-db.test” and post
the log?

(Note that I build it with Guix on x86_64-linux-gnu without any
problems; glibc 2.17 as well, and in a chroot.)


Now, we have a problem with the ‘getaddrinfo-error’ API: EAI_SYSTEM
means “check what errno says”, and we don’t provide the errno value.

This could be fixed by passing the errno as an additional parameter to
‘throw’.  However, that would lead to wrong-num-args for existing
handlers upon EAI_SYSTEM, and would essentially force programmers to use
‘case-lambda’ for their handlers.

OTOH, there are only two occurrences of EAI_SYSTEM in inet/getaddrinfo.c
in glibc: one is for NETDB_INTERNAL, and the other is for
IDNA_DLOPEN_ERROR.  When that happens, the extra bit of information
provided by errno is probably not very helpful.

Thoughts?

Ludo’.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13958: Failing net-db.test on armv5tel glibc 2.17
  2013-03-15 11:14     ` Ludovic Courtès
@ 2013-03-15 11:34       ` Lluís Batlle i Rossell
  2013-03-15 13:36         ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Lluís Batlle i Rossell @ 2013-03-15 11:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 13958

On Fri, Mar 15, 2013 at 12:14:21PM +0100, Ludovic Courtès wrote:
> Hi Lluís!
> 
> Lluís Batlle i Rossell <viric@viric.name> skribis:
> 
> > running the test below, I see on glibc-2.17 armv5tel-linux:
> > ----
> > Running net-db.test
> >
> > ;;; (err -11)
> > unexpected error code: -11 "System error"
> > FAIL: net-db.test: getaddrinfo: no name
> > ----
> 
> Does it happen in a chroot without /etc/resolv.conf & co.?
> 
> Is it a dynamically-linked binary?
> 
> Could you run “strace -o log -f ./check-guile net-db.test” and post
> the log?
> 
> (Note that I build it with Guix on x86_64-linux-gnu without any
> problems; glibc 2.17 as well, and in a chroot.)
> 
> 
> Now, we have a problem with the ‘getaddrinfo-error’ API: EAI_SYSTEM
> means “check what errno says”, and we don’t provide the errno value.
> 
> This could be fixed by passing the errno as an additional parameter to
> ‘throw’.  However, that would lead to wrong-num-args for existing
> handlers upon EAI_SYSTEM, and would essentially force programmers to use
> ‘case-lambda’ for their handlers.
> 
> OTOH, there are only two occurrences of EAI_SYSTEM in inet/getaddrinfo.c
> in glibc: one is for NETDB_INTERNAL, and the other is for
> IDNA_DLOPEN_ERROR.  When that happens, the extra bit of information
> provided by errno is probably not very helpful.

I think this log should be enough. I have a dns server at 127.0.0.1,
and I have in nix.conf:
build-use-chroot = false


Excerpt of the strace log:
16993 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
16993 gettimeofday({1363270208, 638948}, NULL) = 0
16993 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
16993 sendmmsg(7, {{{msg_name(0)=NULL, msg_iov(1)=[{"\25>\1\0\0\1\0\0\0\0\0\0\16does-not-exist\10ho
me"..., 45}], msg_controllen=0, msg_flags=MSG_WAITALL|MSG_TRUNC|MSG_DONTWAIT|MSG_RST|MSG_NOSIGNAL|M
SG_MORE|0xbed40000}, 45}, {{msg_name(0)=NULL, msg_iov(1)=[{"\303:\1\0\0\1\0\0\0\0\0\0\16does-not-ex
ist\10home"..., 45}], msg_controllen=0, msg_flags=0}, 45}}, 2, MSG_NOSIGNAL) = 2
16993 poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
16993 ioctl(7, FIONREAD, [106])         = 0
16993 recvfrom(7, "\25>\201\203\0\1\0\0\0\1\0\0\16does-not-exist\10home"..., 2048, 0, {sa_family=AF
_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 106
16993 gettimeofday({1363270208, 645244}, NULL) = 0
16993 poll([{fd=7, events=POLLIN}], 1, 4993) = 1 ([{fd=7, revents=POLLIN}])
16993 ioctl(7, FIONREAD, [106])         = 0
16993 recvfrom(7, "\303:\201\203\0\1\0\0\0\1\0\0\16does-not-exist\10home"..., 1940, 0, {sa_family=A
F_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 106
16993 close(7)                          = 0
16993 gettimeofday({1363270208, 646679}, NULL) = 0
16993 gettimeofday({1363270208, 646897}, NULL) = 0
16993 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
16993 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
16993 gettimeofday({1363270208, 647559}, NULL) = 0
16993 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
16993 sendmmsg(7, {{{msg_name(0)=NULL, msg_iov(1)=[{"\332\330\1\0\0\1\0\0\0\0\0\0\16does-not-exist\
0\0\1\0\1", 32}], msg_controllen=0, msg_flags=MSG_WAITALL|MSG_TRUNC|MSG_DONTWAIT|MSG_RST|MSG_NOSIGN
AL|MSG_MORE|0xbed40000}, 32}, {{msg_name(0)=NULL, msg_iov(1)=[{"\313w\1\0\0\1\0\0\0\0\0\0\16does-no
t-exist\0\0\34\0\1", 32}], msg_controllen=0, msg_flags=0}, 32}}, 2, MSG_NOSIGNAL) = 2
16993 poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
16993 ioctl(7, FIONREAD, [107])         = 0
16993 recvfrom(7, "\332\330\201\203\0\1\0\0\0\1\0\0\16does-not-exist\0\0\1\0\1"..., 2048, 0, {sa_fa
mily=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 107
16993 gettimeofday({1363270208, 651397}, NULL) = 0
16993 poll([{fd=7, events=POLLIN}], 1, 4996) = 1 ([{fd=7, revents=POLLIN}])
16993 ioctl(7, FIONREAD, [107])         = 0
16993 recvfrom(7, "\313w\201\203\0\1\0\0\0\1\0\0\16does-not-exist\0\0\34\0\1"..., 1940, 0, {sa_fami
ly=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 107
16993 close(7)                          = 0
16993 open("/nix/store/83fff5psdwad2vcy44lv5gwyzfmj4433-glibc-2.17/lib/libnss_myhostname.so.2", O_R
DONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
16993 write(1, "\n", 1)                 = 1
16993 write(1, ";;; ", 4)               = 4
16993 write(1, "(", 1)                  = 1
16993 write(1, "err", 3)                = 3
16993 write(1, " ", 1)                  = 1
16993 write(1, "-11", 3)                = 3
16993 write(1, ")", 1)                  = 1
16993 write(1, "\n", 1)                 = 1
16993 write(1, "unexpected error code: ", 23) = 23


Regards,
Lluís.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13958: Failing net-db.test on armv5tel glibc 2.17
  2013-03-15 11:34       ` Lluís Batlle i Rossell
@ 2013-03-15 13:36         ` Ludovic Courtès
  2013-03-15 13:40           ` Lluís Batlle i Rossell
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-03-15 13:36 UTC (permalink / raw)
  To: Lluís Batlle i Rossell; +Cc: 13958

Lluís Batlle i Rossell <viric@viric.name> skribis:

> I think this log should be enough. I have a dns server at 127.0.0.1,
> and I have in nix.conf:
> build-use-chroot = false
>
>
> Excerpt of the strace log:
> 16993 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0

So you disabled nscd?  (The request goes directly to the DNS server.)

> 16993 open("/nix/store/83fff5psdwad2vcy44lv5gwyzfmj4433-glibc-2.17/lib/libnss_myhostname.so.2", O_R
> DONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

This is most likely the culprit.  Presumably you forgot to add
libnss_myhostname to $LD_LIBRARY_PATH, no?

Also, what does /etc/nsswitch.conf look like?

Ludo’.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13958: Failing net-db.test on armv5tel glibc 2.17
  2013-03-15 13:36         ` Ludovic Courtès
@ 2013-03-15 13:40           ` Lluís Batlle i Rossell
  2013-03-15 13:48             ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Lluís Batlle i Rossell @ 2013-03-15 13:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 13958

On Fri, Mar 15, 2013 at 02:36:40PM +0100, Ludovic Courtès wrote:
> Lluís Batlle i Rossell <viric@viric.name> skribis:
> 
> > I think this log should be enough. I have a dns server at 127.0.0.1,
> > and I have in nix.conf:
> > build-use-chroot = false
> >
> >
> > Excerpt of the strace log:
> > 16993 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
> 
> So you disabled nscd?  (The request goes directly to the DNS server.)

Right.

> > 16993 open("/nix/store/83fff5psdwad2vcy44lv5gwyzfmj4433-glibc-2.17/lib/libnss_myhostname.so.2", O_R
> > DONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> 
> This is most likely the culprit.  Presumably you forgot to add
> libnss_myhostname to $LD_LIBRARY_PATH, no?
> 
> Also, what does /etc/nsswitch.conf look like?

The hosts line:
hosts:     files  dns  myhostname

Ok, so the source of that bad-handled message is a NSS problem in nix builds
without chroot.

What should be the proper user program reaction to that EAI_AGAIN + errno?

Regards,
Lluís.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13958: Failing net-db.test on armv5tel glibc 2.17
  2013-03-15 13:40           ` Lluís Batlle i Rossell
@ 2013-03-15 13:48             ` Ludovic Courtès
  2013-03-25 21:47               ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-03-15 13:48 UTC (permalink / raw)
  To: Lluís Batlle i Rossell; +Cc: 13958

Lluís Batlle i Rossell <viric@viric.name> skribis:

> On Fri, Mar 15, 2013 at 02:36:40PM +0100, Ludovic Courtès wrote:
>> Lluís Batlle i Rossell <viric@viric.name> skribis:

[...]

>> > 16993 open("/nix/store/83fff5psdwad2vcy44lv5gwyzfmj4433-glibc-2.17/lib/libnss_myhostname.so.2", O_R
>> > DONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> 
>> This is most likely the culprit.  Presumably you forgot to add
>> libnss_myhostname to $LD_LIBRARY_PATH, no?
>> 
>> Also, what does /etc/nsswitch.conf look like?
>
> The hosts line:
> hosts:     files  dns  myhostname

OK.  I wonder if adding a [NOTFOUND=...] clause could help.

> Ok, so the source of that bad-handled message is a NSS problem in nix builds
> without chroot.

Yes, it’s reading an NSS configuration that cannot be used.

> What should be the proper user program reaction to that EAI_AGAIN + errno?

Ideally Guile would propagate the errno value.  But in your case it’s
ENOENT, so the error message would be like:

  failed to resolve host name: No such file or directory

This is not really more helpful than:

  failed to resolve host name: System error

(That’s part of the reason why exceptions were invented.  :-))

To me, that example is an argument in favor of the status quo in
Guile—i.e., keeping EAI_SYSTEM handling as it is.

Thoughts?

Ludo’.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13958: Failing net-db.test on armv5tel glibc 2.17
  2013-03-15 13:48             ` Ludovic Courtès
@ 2013-03-25 21:47               ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2013-03-25 21:47 UTC (permalink / raw)
  To: Lluís Batlle i Rossell; +Cc: 13958-done

ludo@gnu.org (Ludovic Courtès) skribis:

> Ideally Guile would propagate the errno value.  But in your case it’s
> ENOENT, so the error message would be like:
>
>   failed to resolve host name: No such file or directory
>
> This is not really more helpful than:
>
>   failed to resolve host name: System error
>
> (That’s part of the reason why exceptions were invented.  :-))
>
> To me, that example is an argument in favor of the status quo in
> Guile—i.e., keeping EAI_SYSTEM handling as it is.

I went ahead and documented the missing errno value for EAI_SYSTEM.

Thanks,
Ludo’.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-25 21:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20130310225811.GO14560@vicerveza.homeunix.net>
     [not found] ` <87txoert3q.fsf@gnu.org>
2013-03-14 14:03   ` bug#13958: Failing net-db.test on armv5tel glibc 2.17 Lluís Batlle i Rossell
2013-03-15 11:14     ` Ludovic Courtès
2013-03-15 11:34       ` Lluís Batlle i Rossell
2013-03-15 13:36         ` Ludovic Courtès
2013-03-15 13:40           ` Lluís Batlle i Rossell
2013-03-15 13:48             ` Ludovic Courtès
2013-03-25 21:47               ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).