Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#12290 closed defect (fixed)

resolveip hangs on kirkwood

Reported by: dgolle@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Attitude Adjustment 12.09 Beta
Keywords: resolveip timer kirkwood uclibc Cc:

Description

resolveip freezes and never returns anything on my kirkwood box (while it works fine on other platforms). This seems to be a bug in uclibc on ARM targets which also affects other packages (e.g. asterisk, if DNS is used to resolv SIP hostnames) in a similar way.

strace looks like this:

execve("/usr/bin/resolveip", ["resolveip", "google.com"], [/* 11 vars */]) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0xb6f16000
stat("/etc/ld.so.cache", 0xbe8f9a88)    = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=45791, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0xb6f15000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\f;\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 81920, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ef5000
mmap2(0xb6ef5000, 45188, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6ef5000
mmap2(0xb6f08000, 735, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xb) = 0xb6f08000
close(3)                                = 0
munmap(0xb6f15000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=300175, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0xb6f15000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\300\247\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 352256, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6e9f000
mmap2(0xb6e9f000, 297764, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6e9f000
mmap2(0xb6eef000, 5263, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x48) = 0xb6eef000
mmap2(0xb6ef1000, 14976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6ef1000
close(3)                                = 0
munmap(0xb6f15000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=300175, ...}) = 0
close(3)                                = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=28677, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0xb6f15000
set_tls(0xb6f15430, 0xb6f15ad0, 0xb6f15ad8, 0xb6f15430, 0xb6f17f7c) = 0
mprotect(0xb6eef000, 4096, PROT_READ)   = 0
mprotect(0xb6f17000, 4096, PROT_READ)   = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0

while on a MIPS-based system, it looks like this:

execve("/usr/bin/resolveip", ["resolveip", "google.com"], [/* 10 vars */]) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77152000
stat("/etc/ld.so.cache", 0x7f858820)    = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=76247, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77151000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\3206\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 143360, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7711a000
old_mmap(0x7711a000, 75840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x7711a000
old_mmap(0x7713c000, 2519, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12000) = 0x7713c000
close(3)                                = 0
munmap(0x77151000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=355504, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77151000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\320\237\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 442368, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x770ae000
old_mmap(0x770ae000, 351956, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x770ae000
old_mmap(0x77113000, 7344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x55000) = 0x77113000
old_mmap(0x77115000, 17508, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x77115000
close(3)                                = 0
munmap(0x77151000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=355504, ...}) = 0
close(3)                                = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=28966, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x77151000
set_thread_area(0x77158440)             = 0
mprotect(0x77113000, 4096, PROT_READ)   = 0
mprotect(0x77153000, 4096, PROT_READ)   = 0
ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
rt_sigaction(SIGALRM, {SIG_DFL, [], 0x400a50 /* SA_??? */}, NULL, 16) = 0
alarm(3)                                = 0
brk(0)                                  = 0xb96000
brk(0xb97000)                           = 0xb97000
open("/etc/hosts", O_RDONLY)            = 3
ioctl(3, TIOCNXCL, 0x7f8582c8)          = -1 ENOTTY (Inappropriate ioctl for device)
brk(0xb98000)                           = 0xb98000
read(3, "127.0.0.1 localhost\n", 4096)  = 20
read(3, "", 4096)                       = 0
close(3)                                = 0
stat64(0x77102e74, 0x7f857fe0)          = 0
open("/etc/resolv.conf", O_RDONLY)      = 3
ioctl(3, TIOCNXCL, 0x7f857f90)          = -1 ENOTTY (Inappropriate ioctl for device)
read(3, "search lan\nnameserver 127.0.0.1\n", 4096) = 32
read(3, "", 4096)                       = 0
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 28) = 0
send(3, "\0\2\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\34\0\1", 28, 0) = 28
poll([{fd=3, events=POLLIN}], 1, 5000)  = 1 ([{fd=3, revents=POLLIN}])
recv(3, "\0\2\201\200\0\1\0\1\0\0\0\0\6google\3com\0\0\34\0\1\300\f\0\34"..., 512, MSG_DONTWAIT) = 56
close(3)                                = 0
open("/etc/hosts", O_RDONLY)            = 3
ioctl(3, TIOCNXCL, 0x7f857e30)          = -1 ENOTTY (Inappropriate ioctl for device)
read(3, "127.0.0.1 localhost\n", 4096)  = 20
read(3, "", 4096)                       = 0
close(3)                                = 0
stat64(0x77102e74, 0x7f857b48)          = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 28) = 0
send(3, "\0\3\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, 0) = 28
poll([{fd=3, events=POLLIN}], 1, 5000)  = 1 ([{fd=3, revents=POLLIN}])
recv(3, "\0\3\201\200\0\1\0\v\0\0\0\0\6google\3com\0\0\1\0\1\300\f\0\1"..., 512, MSG_DONTWAIT) = 204
close(3)                                = 0
write(1, "2a00:1450:4009:808::1004\n", 252a00:1450:4009:808::1004
) = 25
write(1, "173.194.41.136\n", 15173.194.41.136
)        = 15
write(1, "173.194.41.135\n", 15173.194.41.135
)        = 15
write(1, "173.194.41.134\n", 15173.194.41.134
)        = 15
write(1, "173.194.41.133\n", 15173.194.41.133
)        = 15
write(1, "173.194.41.132\n", 15173.194.41.132
)        = 15
write(1, "173.194.41.131\n", 15173.194.41.131
)        = 15
write(1, "173.194.41.130\n", 15173.194.41.130
)        = 15
write(1, "173.194.41.129\n", 15173.194.41.129
)        = 15
write(1, "173.194.41.128\n", 15173.194.41.128
)        = 15
write(1, "173.194.41.142\n", 15173.194.41.142
)        = 15
write(1, "173.194.41.137\n", 15173.194.41.137
)        = 15
exit_group(0)                           = ?

so on the systems where resolveip works

ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0

is used instead of the non-working

ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0

which is used on my kirkwood board.

anyone got an idea how I can fix that?

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by stanelie

I am experiencing the same issue with resolveip on my NSLU2. The ppp.sh script calls it and fails, it just pegs the CPU at 100% and my pptp connection never starts.

NSLU2 running ATTITUDE ADJUSTMENT (12.09-beta, r33315)

comment:2 Changed 5 years ago by stanelie

My workaround :
remove resolveip from /usr/bin/resolveip by running "opkg remove resolveip" and replace it with this script :

#!/bin/sh
ping $1 -c 1 -w 1 | grep "PING" | cut -d \  -f 3 | sed -e 's/(//' -e 's/)://'

Run chmod 755 and chmod +x on the script.

comment:3 Changed 5 years ago by anonymous

A very bad workaround...

comment:4 Changed 5 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with r34116, r34117

comment:5 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.