Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/ip hangs #185

Open
milahu opened this issue Dec 12, 2018 · 7 comments
Open

tests/ip hangs #185

milahu opened this issue Dec 12, 2018 · 7 comments

Comments

@milahu
Copy link

milahu commented Dec 12, 2018

tests/ip hangs with 100% cpu load
in libmill-git-2dd13ae at make check

$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: en: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.102/24 brd 192.168.2.255 scope global noprefixroute wlp3s0
       valid_lft forever preferred_lft forever
$ sysctl -a -r 'net.ipv6.conf.*.disable_ipv6'
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.en.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.wl.disable_ipv6 = 1

tc.bash stop did not help [stop traffic shaping]

$ diff ...
-3: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb state UP group default qlen 1000
+3: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

me clueless

but at least the tests should be wrapped in timeout -k $sec $sec $cmd

@sustrik
Copy link
Owner

sustrik commented Dec 12, 2018

The tests have infinite timeouts. If DNS is not accessible, the test will hang.

@milahu
Copy link
Author

milahu commented Dec 12, 2018

If DNS is not accessible, the test will hang.

dns is working in all of my other apps

The tests have infinite timeouts.

which is not ideal with while(1) { ... } in ip.c

i replaced it with for(_i=0;_i<4;_i++) { ... ; sleep 1 }
and added some printfs ...

debug-tests-ip.txt

ideas?

@sustrik
Copy link
Owner

sustrik commented Dec 12, 2018

First things first: Can you resolve www.example.org from the machine in question?

dig +short www.example.org

@milahu
Copy link
Author

milahu commented Dec 12, 2018

Can you resolve www.example.org from the machine in question?

yes

already tried with the resolveip tool
now confirmed with dig

$ dig www.example.com | grep -e time -e SERVER -e HEADER -e example
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61831
www.example.com.	38919	IN	A	93.184.216.34
;; Query time: 13 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)

$ dig @8.8.8.8 www.example.com | grep -e time -e SERVER -e HEADER -e example
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5835
www.example.com.	15320	IN	A	93.184.216.34
;; Query time: 11 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)

$ time tor-resolve www.example.com
real average 300 ms

$ ping -c10 192.168.2.1
average 3.5 ms

$ ping -c10 8.8.8.8
average 11 ms

$ traceroute 8.8.8.8
[...]
 7  google-public-dns-a.google.com (8.8.8.8)  11.938 ms  11.619 ms  11.610 ms

my router is just slow at DNS, but it does work

i also tried ... as suggested by toybox ping

$ echo 0 9999999 | sudo tee /proc/sys/net/ipv4/ping_group_range

and

$ sudo ./tests/ip

without success

@sustrik
Copy link
Owner

sustrik commented Dec 13, 2018

Ok, so looking at your debug output it looks like the test exits al right:

ipremote. call dns_ai_close
tests/ip. resolve 6 done, errno = 99
tests/ip. return

What am I missing?

@milahu
Copy link
Author

milahu commented Dec 13, 2018

it looks like the test exits al right

only after i replaced while true with for(_i=0;_i<4;_i++)

now the loop runs 4 times for ipv4 and 4 times for ipv6, even with sleep 1 after every iteration

the lookup should be done in 13 ms but it takes forever with 100% cpu load, with the original code

also i dont see the ip address anywhere, it is always NULL

im gonna have a closer look at your dns lookup functions later

ps, libdill seems to work [note to self, verify]

@vieks
Copy link

vieks commented Aug 18, 2019

I have the exact same problem.
see: #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants