cupsd: ../sysdeps/posix/getaddrinfo.c:1457: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native' failed.

Bug #317824 reported by Loïc Minier
2
Affects Status Importance Assigned to Milestone
glibc (Debian)
Fix Released
Unknown
glibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

cups in jaunty/amd64 SIGABORTs on startup:
# /usr/sbin/cupsd -f
cupsd: ../sysdeps/posix/getaddrinfo.c:1457: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native' failed.
zsh: abort (core dumped) /usr/sbin/cupsd -f

I don't get an apport crash despite having apport enabled; presumably because it's a SIGABORT, not SEGV.

# strace -f -e trace=file /usr/sbin/cupsd -f
ends in :
open("/dev/urandom", O_RDONLY) = 4
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=80, ...}) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 5
open("/etc/gai.conf", O_RDONLY) = 5
cupsd: ../sysdeps/posix/getaddrinfo.c:1457: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native' failed.
--- SIGABRT (Aborted) @ 0 (0) ---

It might be related to the fact I have IPv6.

Bye,

Revision history for this message
Loïc Minier (lool) wrote :
Download full text (3.9 KiB)

I installed cups-dbg and got this backtrace on the core file:
(gdb) thread apply all bt full

Thread 1 (process 10495):
#0 0x00007f7b20a70f85 in raise () from /lib/libc.so.6
No symbol table info available.
#1 0x00007f7b20a72af3 in abort () from /lib/libc.so.6
No symbol table info available.
#2 0x00007f7b20a69ed9 in __assert_fail () from /lib/libc.so.6
No symbol table info available.
#3 0x00007f7b20b0e0ff in rfc3484_sort () from /lib/libc.so.6
No symbol table info available.
#4 0x00007f7b20a736e8 in msort_with_tmp () from /lib/libc.so.6
No symbol table info available.
#5 0x00007f7b20a73c4f in qsort_r () from /lib/libc.so.6
No symbol table info available.
#6 0x00007f7b20b0d41a in getaddrinfo () from /lib/libc.so.6
No symbol table info available.
#7 0x00007f7b214ac226 in httpAddrGetList (hostname=0x7f7b22f83f50 "fox.dooz.org", family=0, service=0x0) at http-addrlist.c:302
        current = <value optimized out>
        hints = {ai_flags = 0, ai_family = 0, ai_socktype = 1, ai_protocol = 0, ai_addrlen = 0, ai_addr = 0x0, ai_canonname = 0x0, ai_next = 0x0}
        results = <value optimized out>
        ipv6 = "C^�\000\000\000\000�&\000\000\000\000\000x\000\000\000\000\000\000\000�\030\212*�\177\000\000x\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000� {\177\000\000zfc\"{\177\000\000\001\000\000\000{\177\000\000\000\000\000\000\000\000\000\000Ag? {\177\000\000\000\020�\000\000``:�>� {\177\000\000\000\000\000\000\000\000\000\000\027\031\212*�\177\000\000\000\000\000\000\000\000\000\000\003", '\0' <repeats 15 times>, "\004\000\000\000\000\000\000\000`\234< {\177\000\000\004\000\000\000\000\000\000\000x\000\000\000\000\000\000\000\220\030\212*�\177\000\000x\000\000\000\000\000\000\000�\030\212*�\177\000\000%�> {"...
        ipv6len = 0
        error = <value optimized out>
        first = <value optimized out>
        addr = <value optimized out>
        cg = (_cups_globals_t *) 0x7f7b22f84f70
#8 0x00007f7b2287ec40 in cupsdStartListening () at listen.c:152
        status = <value optimized out>
        p = <value optimized out>
        val = <value optimized out>
        lis = <value optimized out>
        s = '\0' <repeats 73 times>, "\020�\000\000``:", '\0' <repeats 16 times>, "\001\000\000\000\000\000\000\000����������������*\227< {\177\000\000\001\000\000\000\000\000\000\000\211�< {\177\000\000�� {\177\000\0000\034\212*�\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\227\034\212*�\177\000\000\000\000\000\000\000\000\000\000�(\000\000�(\000\000\000\000\000\000\000\000\000\000Hyb\"{\177\000\000 \035\212*�\177\000\000ܠ\211\"{\177\000\000\002\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000έ<\"{\177\000"
        have_domain = <value optimized out>
        encryptions = {0x7f7b2289dc31 "IfRequested", 0x7f7b2289dc3d "Never", 0x7f7b228949e6 "Required", 0x7f7b2289dc43 "Always"}
#9 0x00007f7b2288dffb in cupsdStartServer () at server.c:86
No locals.
#10 0x00007f7b2286d29c in main (argc=2, argv=<value optimized out>) at main.c:538
        i = 2
        opt = <value optimized out>
        fg = 1
        fds = <value optimized out>
        con = <value optimized out>
        job = <value optimi...

Read more...

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

It's triggered by a relatively broken /etc/hosts file (my doing I'm afraid).

If I comment out anyline in this file, it doesn't crash.

My hosts file should have been:
127.0.0.1 localhost
127.0.0.1 fox.dooz.org fox
::1 ip6-localhost ip6-loopback
::1 fox.dooz.org fox
2a01:e35:8a6e:5e80:21d:60ff:fe40:59ae fox.dooz.org fox
192.168.0.101 fox.dooz.org fox

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

CUPS should not crash on a broken /etc/hosts file but give an error message (or use decent defaults and give a warning).

Please report the problem upstream on

http://www.cups.org/str.php

Revision history for this message
Loïc Minier (lool) wrote :

This just happened again with python, on another host which is i386:
python: ../sysdeps/posix/getaddrinfo.c:1457: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native' failed.
zsh: abort (core dumped) requestsync libv4l jaunty

Reassigning to glibc.

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

First address in hosts MUST be 127.0.0.1, second and third address must be in 192.168.x.y and 127.u.v.w, but order doesn't matter for the last two.

Revision history for this message
Loïc Minier (lool) wrote :

I'm reproducing on Debian sid.

Loïc Minier (lool)
Changed in glibc:
importance: Undecided → Unknown
status: New → Unknown
Changed in glibc:
status: Unknown → New
Changed in glibc (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.