From zbynek.michl at nic.cz Mon Feb 15 12:54:21 2010 From: zbynek.michl at nic.cz (Zbynek Michl) Date: Mon, 15 Feb 2010 13:54:21 +0100 Subject: [ldns-users] ldns_resolver_set_ip6() and ldns_resolver_query() leads to SIGSEGV Message-ID: <4B7943FD.5050009@nic.cz> Hello, when I read resolver addresses from /etc/resolv.conf where are only IPv4 addresses and set IPv6 resolvers preference to LDNS_RESOLV_INET6, then ldns_resolver_query() calling causes a crash. My /etc/resolv.conf: nameserver 127.0.0.1 nameserver 172.20.20.40 Sample code: /* create a new resolver from /etc/resolv.conf */ s = ldns_resolver_new_frm_file(&res, NULL); if (s != LDNS_STATUS_OK) { exit(EXIT_FAILURE); } /* set IPv6 resolver preference */ ldns_resolver_set_ip6(res, LDNS_RESOLV_INET6); /* use the resolver to send a query for the mx * records of the domain given on the command line */ p = ldns_resolver_query(res, domain, LDNS_RR_TYPE_MX, LDNS_RR_CLASS_IN, LDNS_RD); When I compile it and run, on ldns_resolver_query() calling program crashes (Segmentation fault). The same failure occurs when I set IPv4 preference and resolv.conf contains only IPv6 addresses. gdb backtrace: Program received signal SIGSEGV, Segmentation fault. ldns_pkt_tc (packet=0x0) at packet.c:58 58 { (gdb) bt #0 ldns_pkt_tc (packet=0x0) at packet.c:58 #1 0x00007ffff73d3072 in ldns_resolver_send_pkt (answer=0x7fffffffe200, r=0x602290, query_pkt=0x602070) at resolver.c:968 #2 0x00007ffff73d3246 in ldns_resolver_send (answer=0x7fffffffe268, r=0x602290, name=0x602010, t=LDNS_RR_TYPE_MX, c=LDNS_RR_CLASS_IN, flags=8) at resolver.c:1090 #3 0x00007ffff73d3308 in ldns_resolver_query (r=0x602290, name=0x602010, t=LDNS_RR_TYPE_MX, c=LDNS_RR_CLASS_IN, flags=8) at resolver.c:908 Regards, Zbynek From matthijs at NLnetLabs.nl Tue Feb 16 09:28:39 2010 From: matthijs at NLnetLabs.nl (Matthijs Mekking) Date: Tue, 16 Feb 2010 10:28:39 +0100 Subject: [ldns-users] ldns_resolver_set_ip6() and ldns_resolver_query() leads to SIGSEGV In-Reply-To: <4B7943FD.5050009@nic.cz> References: <4B7943FD.5050009@nic.cz> Message-ID: <4B7A6547.6080804@nlnetlabs.nl> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I fixed this in ldns trunk. In these cases, ldns will now return a "No (valid) nameservers" error. Best regards, Matthijs Zbynek Michl wrote: > Hello, > > when I read resolver addresses from /etc/resolv.conf where are only IPv4 > addresses and set IPv6 resolvers preference to LDNS_RESOLV_INET6, then > ldns_resolver_query() calling causes a crash. > > My /etc/resolv.conf: > > nameserver 127.0.0.1 > nameserver 172.20.20.40 > > > Sample code: > > /* create a new resolver from /etc/resolv.conf */ > s = ldns_resolver_new_frm_file(&res, NULL); > > if (s != LDNS_STATUS_OK) { > exit(EXIT_FAILURE); > } > > /* set IPv6 resolver preference */ > ldns_resolver_set_ip6(res, LDNS_RESOLV_INET6); > > /* use the resolver to send a query for the mx > * records of the domain given on the command line > */ > p = ldns_resolver_query(res, domain, LDNS_RR_TYPE_MX, LDNS_RR_CLASS_IN, > LDNS_RD); > > > When I compile it and run, on ldns_resolver_query() calling program > crashes (Segmentation fault). > > The same failure occurs when I set IPv4 preference and resolv.conf > contains only IPv6 addresses. > > > gdb backtrace: > > Program received signal SIGSEGV, Segmentation fault. > ldns_pkt_tc (packet=0x0) at packet.c:58 > 58 { > (gdb) bt > #0 ldns_pkt_tc (packet=0x0) at packet.c:58 > #1 0x00007ffff73d3072 in ldns_resolver_send_pkt (answer=0x7fffffffe200, > r=0x602290, query_pkt=0x602070) at resolver.c:968 > #2 0x00007ffff73d3246 in ldns_resolver_send (answer=0x7fffffffe268, > r=0x602290, name=0x602010, t=LDNS_RR_TYPE_MX, > c=LDNS_RR_CLASS_IN, flags=8) at resolver.c:1090 > #3 0x00007ffff73d3308 in ldns_resolver_query (r=0x602290, > name=0x602010, t=LDNS_RR_TYPE_MX, c=LDNS_RR_CLASS_IN, flags=8) > at resolver.c:908 > > > Regards, > Zbynek > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > http://open.nlnetlabs.nl/mailman/listinfo/ldns-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJLemVGAAoJEA8yVCPsQCW5OBIIAJuENc9vuMop2XQ7tIDKlkSA SN8+OKj1fRas5oYLjb2Y48c5M8JVpyaOO2u+laf7AGxO37Wd5v7k9zX/toPhq7Qj cerGe7JVS4dlr12V5OAqLnJSXDzArUmy2cGKSjfN2mPjkNyzkNeKlmB9QjkEnc08 uqPjP33W7BN6kgpkEMBdqz/O9+KRvwpRgVll4wOL+pElN9RkJvADDcSb8RHZv6ko eQsCP9aOFumST7u42urgZOPNwZkeAW5Dw0TwEWqbBUhNAqtEXmJgrTaoqu95FN6k HJszmKhopZPXCglsDCL1nAwjd9prTDIm9strOrFuzHUcbV5h5Xe03/COv9T7CT8= =Qk/4 -----END PGP SIGNATURE----- From paul at xelerance.com Tue Feb 23 21:07:54 2010 From: paul at xelerance.com (Paul Wouters) Date: Tue, 23 Feb 2010 16:07:54 -0500 (EST) Subject: [ldns-users] ldns linking bug with pthreads Message-ID: Hi, Fedora 13 will no longer implicitely link in certain libraries. For a full description see: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange This is happening with ldns and the pthreads library. So we need to pass it a -lpthreads when we are compiling with --with-pthreads. However, looking at configure, I don't see it handling anything related to the --with-pthreads options, so I am not sure where I am supposed to be adding -lpthreads to the LIBS line in Makefile. Paul From edmonds at debian.org Tue Feb 23 21:49:32 2010 From: edmonds at debian.org (Robert Edmonds) Date: Tue, 23 Feb 2010 16:49:32 -0500 Subject: [ldns-users] ldns linking bug with pthreads In-Reply-To: References: Message-ID: <20100223214931.GA13818@mycre.ws> Paul Wouters wrote: > This is happening with ldns and the pthreads library. So we need to > pass it a -lpthreads when we are compiling with --with-pthreads. -lpthreads or -lpthread? -- Robert Edmonds edmonds at debian.org From paul at xelerance.com Tue Feb 23 22:18:42 2010 From: paul at xelerance.com (Paul Wouters) Date: Tue, 23 Feb 2010 17:18:42 -0500 (EST) Subject: [ldns-users] ldns linking bug with pthreads In-Reply-To: <20100223214931.GA13818@mycre.ws> References: <20100223214931.GA13818@mycre.ws> Message-ID: On Tue, 23 Feb 2010, Robert Edmonds wrote: > Paul Wouters wrote: >> This is happening with ldns and the pthreads library. So we need to >> pass it a -lpthreads when we are compiling with --with-pthreads. > > -lpthreads or -lpthread? Typo, should indeed be -lpthread From wouter at NLnetLabs.nl Wed Feb 24 07:41:10 2010 From: wouter at NLnetLabs.nl (W.C.A. Wijngaards) Date: Wed, 24 Feb 2010 08:41:10 +0100 Subject: [ldns-users] ldns linking bug with pthreads In-Reply-To: References: <20100223214931.GA13818@mycre.ws> Message-ID: <4B84D816.8000201@nlnetlabs.nl> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Paul, Robert, ldns does not use pthreads? In other products we use acx_pthread.m4 that is included. Best regards, Wouter On 02/23/2010 11:18 PM, Paul Wouters wrote: > On Tue, 23 Feb 2010, Robert Edmonds wrote: > >> Paul Wouters wrote: >>> This is happening with ldns and the pthreads library. So we need to >>> pass it a -lpthreads when we are compiling with --with-pthreads. >> >> -lpthreads or -lpthread? > > Typo, should indeed be -lpthread > > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > http://open.nlnetlabs.nl/mailman/listinfo/ldns-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAkuE2BYACgkQkDLqNwOhpPjs+gCgoYphQM85wJmARBzRaVHIazgU IooAnRa1Jr8FkYE0SXiqusda9pXUsS+r =UmO0 -----END PGP SIGNATURE----- From paul at xelerance.com Wed Feb 24 16:30:32 2010 From: paul at xelerance.com (Paul Wouters) Date: Wed, 24 Feb 2010 11:30:32 -0500 (EST) Subject: [ldns-users] ldns linking bug with pthreads In-Reply-To: <4B84D816.8000201@nlnetlabs.nl> References: <20100223214931.GA13818@mycre.ws> <4B84D816.8000201@nlnetlabs.nl> Message-ID: On Wed, 24 Feb 2010, W.C.A. Wijngaards wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Paul, Robert, > > ldns does not use pthreads? In other products we use acx_pthread.m4 > that is included. Oops. This of course was meant for unbound, not ldns. I'll repost it there :) Paul From zbynek.michl at nic.cz Thu Feb 25 11:04:11 2010 From: zbynek.michl at nic.cz (Zbynek Michl) Date: Thu, 25 Feb 2010 12:04:11 +0100 Subject: [ldns-users] Documentation update suggestion for "ldns_rr_list * good_keys" structure Message-ID: <4B86592B.2060008@nic.cz> Hello, there is the following "good_keys" structure description at this time, e.g. in ldns_verify_rrsig_keylist() and similar functions: "if this is a (initialized) list, the keys from keys that validate one of the signatures are added to it" I guess it is a little bit confusing because it seems that key is copied to good_keys list, but only pointer to that key from keys is added actually. This could provoke user to use ldns_rr_list_deep_free() to free that structure instead of only ldns_rr_list_free() function. So I suggest to update that description to: "if this is a (initialized) list, the pointers to keys from keys that validate one of the signatures are added to it" Regards, Zbynek From matthijs at NLnetLabs.nl Thu Feb 25 11:24:06 2010 From: matthijs at NLnetLabs.nl (Matthijs Mekking) Date: Thu, 25 Feb 2010 12:24:06 +0100 Subject: [ldns-users] Documentation update suggestion for "ldns_rr_list * good_keys" structure In-Reply-To: <4B86592B.2060008@nic.cz> References: <4B86592B.2060008@nic.cz> Message-ID: <4B865DD6.3000802@nlnetlabs.nl> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Zbynek, Fair enough. I have committed your suggestions to trunk. Thanks for reporting. Best regards, Matthijs Mekking NLnet Labs Zbynek Michl wrote: > Hello, > > there is the following "good_keys" structure description at this time, > e.g. in ldns_verify_rrsig_keylist() and similar functions: > > "if this is a (initialized) list, the keys from keys that validate one > of the signatures are added to it" > > I guess it is a little bit confusing because it seems that key is copied > to good_keys list, but only pointer to that key from keys is added > actually. This could > provoke user to use ldns_rr_list_deep_free() to free that structure > instead of only ldns_rr_list_free() function. > > So I suggest to update that description to: > > "if this is a (initialized) list, the pointers to keys from keys that > validate one of the signatures are added to it" > > > Regards, > Zbynek > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > http://open.nlnetlabs.nl/mailman/listinfo/ldns-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJLhl3TAAoJEA8yVCPsQCW5rNQH+gKIxJPqEaoxq9Cu0p4fyzF1 0EteusbjKEe588+MckNhZe4ZbckFb9CkrthLyuvZhQbAosMCPymids4v1IoLOH3J CDIIXVXu8WqMpX9rGYfCWcpHGjvFenavTZqGjIhaFBKQxot1pNA7ITINSudVEDO8 ZsFDm+Iw8l8vL9HMkW5AIXKnTipS+rAIJU/UH3kzP2cHVuUNmMUS2d721xLxT8Ra F2eaKDKbd2snXXi03SSn6sn9LQtzTEEwQHk0xHzYOukZ8RjRS36qcOpG9XjUonrX V7w1RVW9SHLfWCPZ1LokbNMfX1VGpVTu/wjUBI5z0XlBHlfmgpKMkRAfPJAYlyk= =uyX9 -----END PGP SIGNATURE-----