Am Montag, den 13.07.2015, 16:00 +0200 schrieb Richard Weinberger:
> Am 13.07.2015 um 15:58 schrieb Thomas Meyer:
> > Am Montag, den 13.07.2015, 15:52 +0200 schrieb Richard Weinberger:
> > > On Mon, Jul 13, 2015 at 3:41 PM, Thomas Meyer <tho...@m3y3r.de> 
> > > wrote:
> > > > Hi,
> > > > 
> > > > The uml_net network setup "fails" on my computer with:
> > > > 
> > > > [   15.930000] helper_wait : waitpid process 11673 failed, 
> > > > errno = 
> > > > 10
> > > > [   15.930000] * modprobe tun
> > > >                * ifconfig tap0 192.168.10.1 netmask 
> > > > 255.255.255.255 
> > > > up
> > > >                * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward
> > > > [   20.480000] helper_wait : waitpid process 11780 failed, 
> > > > errno = 
> > > > 10
> > > > [   20.480000] * route add -host 192.168.10.2 dev tap0
> > > >                * bash -c echo 1 >
> > > > /proc/sys/net/ipv4/conf/tap0/proxy_arp
> > > > 
> > > > because I run uml linux as a normal user and I guess these 
> > > > commands
> > > > fail, because of insufficient rights:
> > > > bash -c echo 1 > /proc/sys/net/ipv4/ip_forward
> > > > bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp
> > > > 
> > > > But this failure is okay for me, as firewalld, sets above 
> > > > options
> > > > correctly on my host computer.
> > > > 
> > > > The problem I see is that UML list two zombie processes:
> > > >   11780 root       20   0     0     0     0 Z  0.0  0.0 
> > > >  0:00.00 
> > > > 15:34 │  │     ├─ uml_net
> > > >   11673 root       20   0     0     0     0 Z  0.0  0.0 
> > > >  0:00.00 
> > > > 15:34 │  │     ├─ uml_net
> > > > 
> > > > UML seems to never reap those two processes, likely because of 
> > > > errno=10 exit code.
> > > > 
> > > > any idea how to fix this?
> > > 
> > > Hmm, it tries to reap them using waitpid().
> > > But it seems to fail with ECHILD.
> > > 
> > > Can you add a few prints to compare the PIDs?
> > 
> > Sure, where should I add those?
> > os-Linux/helper.c - helper_wait(int pid) ?
> 
> Yeah. And please add a dump_stack() to figure out where it was 
> called.

I think calling dump_stack() somehow changed the errno to 25?!

[   19.600000] CPU: 0 PID: 282 Comm: ip Not tainted 
4.2.0-rc1-00089-g1ee9c9e-dirty #256
[   19.600000] Stack:
[   19.600000]  6caf14a0 60089462 ffffffff00000013 7fa4a5ab3698
[   19.600000]  00006b41 60028d90 6caf14b0 60623767
[   19.600000]  6caf14f0 60040c0c 00000000 6caf1590
[   19.600000] Call Trace:
[   19.600000]  [<606206d9>] ? printk+0x0/0x94
[   19.600000]  [<6002c85b>] show_stack+0xdb/0x1a0
[   19.600000]  [<60089462>] ? dump_stack_print_info+0xd2/0xf0
[   19.600000]  [<60623767>] dump_stack+0x2a/0x2c
[   19.600000]  [<60040c0c>] helper_wait+0x7c/0xd0
[   19.600000]  [<60044e5e>] tuntap_open_tramp.constprop.0+0x15e/0x270
[   19.600000]  [<60466a60>] ? dev_set_rx_mode+0x0/0x50
[   19.600000]  [<6004501f>] tuntap_open+0xaf/0x2d0
[   19.600000]  [<60044fdb>] ? tuntap_open+0x6b/0x2d0
[   19.600000]  [<6006f64f>] ? notifier_call_chain+0x4f/0x80
[   19.600000]  [<60466a60>] ? dev_set_rx_mode+0x0/0x50
[   19.600000]  [<60035ccd>] uml_net_open+0x2d/0x140
[   19.600000]  [<60466b57>] __dev_open+0xa7/0x130
[   19.600000]  [<60466a9e>] ? dev_set_rx_mode+0x3e/0x50
[   19.600000]  [<60466ee4>] __dev_change_flags+0xb4/0x1a0
[   19.600000]  [<60466ffb>] dev_change_flags+0x2b/0x70
[   19.600000]  [<6047a9c8>] do_setlink+0x318/0x8f0
[   19.600000]  [<603d24b9>] ? nla_parse+0x39/0x140
[   19.600000]  [<60045330>] ? run_syscall_stub+0xf0/0x350
[   19.600000]  [<6047b7ae>] rtnl_newlink+0x6ae/0xa10
[   19.600000]  [<60042ff0>] ? set_signals+0x0/0x50
[   19.600000]  [<60042d00>] ? change_sig+0x70/0x80
[   19.600000]  [<6004302f>] ? set_signals+0x3f/0x50
[   19.600000]  [<6034e227>] ? avc_has_perm_noaudit+0x57/0x120
[   19.600000]  [<6047bc34>] rtnetlink_rcv_msg+0x94/0x280
[   19.600000]  [<60042ff0>] ? set_signals+0x0/0x50
[   19.600000]  [<6047dda0>] ? sk_filter+0x0/0xe0
[   19.600000]  [<6044de30>] ? skb_pull+0x0/0x90
[   19.600000]  [<6047bba0>] ? rtnetlink_rcv_msg+0x0/0x280
[   19.600000]  [<6048db00>] ? netlink_ack+0x0/0x170
[   19.600000]  [<6048dd39>] netlink_rcv_skb+0xc9/0x100
[   19.600000]  [<6047dda0>] ? sk_filter+0x0/0xe0
[   19.600000]  [<6047bb8b>] rtnetlink_rcv+0x3b/0x50
[   19.600000]  [<6048d4dd>] netlink_unicast+0x1cd/0x2b0
[   19.600000]  [<6048da8e>] netlink_sendmsg+0x3ee/0x460
[   19.600000]  [<6034f3da>] ? selinux_socket_sendmsg+0x2a/0x30
[   19.600000]  [<60442c8a>] sock_sendmsg+0x3a/0x90
[   19.600000]  [<6044480a>] ___sys_sendmsg+0x30a/0x320
[   19.600000]  [<6004592a>] ? map+0x4a/0x50
[   19.600000]  [<600fc150>] ? handle_mm_fault+0x0/0x1590
[   19.600000]  [<6002dcd5>] ? handle_page_fault+0x265/0x350
[   19.600000]  [<6002e1fe>] ? segv+0x28e/0x3e0
[   19.600000]  [<60445b61>] __sys_sendmsg+0x51/0xa0
[   19.600000]  [<60445bc0>] SyS_sendmsg+0x10/0x20
[   19.600000]  [<6002ef3e>] handle_syscall+0x6e/0xa0
[   19.600000]  [<60046552>] userspace+0x3f2/0x4e0
[   19.600000]  [<6002f253>] ? do_op_one_page+0x153/0x240
[   19.600000]  [<60041a4f>] ? save_registers+0x1f/0x40
[   19.600000]  [<60049816>] ? arch_prctl+0x1f6/0x220
[   19.600000]  [<6002b065>] fork_handler+0x85/0x90

[   19.600000] helper_wait : waitpid process 27457 failed, errno = 25
[   19.600000] * modprobe tun
               * ifconfig tap0 192.168.10.1 netmask 255.255.255.255 up
               * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward
[   19.780000] ip (282) used greatest stack depth: 3616 bytes left
[   24.120000] CPU: 0 PID: 305 Comm: ip Not tainted 
4.2.0-rc1-00089-g1ee9c9e-dirty #256
[   24.120000] Stack:
[   24.120000]  6caab720 60089462 ffffffff00000014 7fa4a5ab3698
[   24.120000]  00006b94 60028d90 6caab730 60623767
[   24.120000]  6caab770 60040c0c 6caab8b0 70ac2000
[   24.120000] Call Trace:
[   24.120000]  [<600d767e>] ? __free_pages+0x3e/0xa0
[   24.120000]  [<606206d9>] ? printk+0x0/0x94
[   24.120000]  [<6002c85b>] show_stack+0xdb/0x1a0
[   24.120000]  [<60089462>] ? dump_stack_print_info+0xd2/0xf0
[   24.120000]  [<60623767>] dump_stack+0x2a/0x2c
[   24.120000]  [<60040c0c>] helper_wait+0x7c/0xd0
[   24.120000]  [<60037233>] change+0x193/0x240
[   24.120000]  [<60571a40>] ? fib_magic.isra.1+0x0/0xd0
[   24.120000]  [<60044c00>] ? tuntap_add_addr+0x0/0x70
[   24.120000]  [<60037596>] open_addr+0x26/0x30
[   24.120000]  [<60044c5d>] tuntap_add_addr+0x5d/0x70
[   24.120000]  [<60571a40>] ? fib_magic.isra.1+0x0/0xd0
[   24.120000]  [<60048f40>] ? __memcpy+0x0/0x20
[   24.120000]  [<60035769>] uml_inetaddr_event+0x99/0xc0
[   24.120000]  [<6057302a>] ? fib_inetaddr_event+0x9a/0xc0
[   24.120000]  [<6006f64f>] notifier_call_chain+0x4f/0x80
[   24.120000]  [<6006fb64>] __blocking_notifier_call_chain+0x54/0x80
[   24.120000]  [<60476920>] ? rtnl_is_locked+0x0/0x20
[   24.120000]  [<6006fba8>] blocking_notifier_call_chain+0x18/0x20
[   24.120000]  [<605685e5>] __inet_insert_ifa+0x1a5/0x2d0
[   24.120000]  [<605690d9>] inet_rtm_newaddr+0x1e9/0x4c0
[   24.120000]  [<6047bc34>] rtnetlink_rcv_msg+0x94/0x280
[   24.120000]  [<60042ff0>] ? set_signals+0x0/0x50
[   24.120000]  [<6047dda0>] ? sk_filter+0x0/0xe0
[   24.120000]  [<6044de30>] ? skb_pull+0x0/0x90
[   24.120000]  [<6047bba0>] ? rtnetlink_rcv_msg+0x0/0x280
[   24.120000]  [<6048db00>] ? netlink_ack+0x0/0x170
[   24.120000]  [<6048dd39>] netlink_rcv_skb+0xc9/0x100
[   24.120000]  [<6047dda0>] ? sk_filter+0x0/0xe0
[   24.120000]  [<6047bb8b>] rtnetlink_rcv+0x3b/0x50
[   24.120000]  [<6048d4dd>] netlink_unicast+0x1cd/0x2b0
[   24.120000]  [<6048da8e>] netlink_sendmsg+0x3ee/0x460
[   24.120000]  [<6034f3da>] ? selinux_socket_sendmsg+0x2a/0x30
[   24.120000]  [<60442c8a>] sock_sendmsg+0x3a/0x90
[   24.120000]  [<6044480a>] ___sys_sendmsg+0x30a/0x320
[   24.120000]  [<6004592a>] ? map+0x4a/0x50
[   24.120000]  [<600fc150>] ? handle_mm_fault+0x0/0x1590
[   24.120000]  [<6002dcd5>] ? handle_page_fault+0x265/0x350
[   24.120000]  [<6002e1fe>] ? segv+0x28e/0x3e0
[   24.120000]  [<60445b61>] __sys_sendmsg+0x51/0xa0
[   24.120000]  [<60445bc0>] SyS_sendmsg+0x10/0x20
[   24.120000]  [<6002ef3e>] handle_syscall+0x6e/0xa0
[   24.120000]  [<60046552>] userspace+0x3f2/0x4e0
[   24.120000]  [<6002f253>] ? do_op_one_page+0x153/0x240
[   24.120000]  [<60041a4f>] ? save_registers+0x1f/0x40
[   24.120000]  [<60049816>] ? arch_prctl+0x1f6/0x220
[   24.120000]  [<6002b065>] fork_handler+0x85/0x90

[   24.120000] helper_wait : waitpid process 27540 failed, errno = 25
[   24.120000] * route add -host 192.168.10.2 dev tap0
               * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp


diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index e3ee4a5..683460f 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -14,6 +14,8 @@
 #include <os.h>
 #include <um_malloc.h>
 
+extern __attribute__((regparm(0))) void dump_stack(void);
+
 struct helper_data {
        void (*pre_exec)(void*);
        void *pre_data;
@@ -152,6 +154,7 @@ int helper_wait(int pid)
 
        CATCH_EINTR(ret = waitpid(pid, &status, wflags));
        if (ret < 0) {
+               dump_stack();
                printk(UM_KERN_ERR "helper_wait : waitpid process %d
failed, "
                       "errno = %d\n", pid, errno);
                return -errno;



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to