Skip to contentSkip to conversation

uml_net zombie processes

uml-devel Thomas Meyer 3 participants 13 messages Jul 13, 2015 – Aug 9, 2015 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

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?

with kind regards
thomas

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 21 lines · Thomas Meyer

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.

Quoted 7 lines

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?

Signature · 13 lines
Thanks,
//richard

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#2 lore raw

Am Montag, den 13.07.2015, 15:52 +0200 schrieb Richard Weinberger:

Quoted 35 lines
Quoted 33 lines · Thomas Meyer

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.

Quoted 6 lines
Quoted 1 line

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) ?

Quoted 1 line

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw

Am 13.07.2015 um 15:58 schrieb Thomas Meyer:

Quoted 38 lines

Am Montag, den 13.07.2015, 15:52 +0200 schrieb Richard Weinberger:

Quoted 37 lines
Quoted 34 lines · Thomas Meyer

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?

Quoted 7 lines
Quoted 4 lines

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.

Thanks,
//richard

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#4 lore raw

Am Montag, den 13.07.2015, 16:00 +0200 schrieb Richard Weinberger:

Quoted 49 lines

Am 13.07.2015 um 15:58 schrieb Thomas Meyer:

Quoted 48 lines

Am Montag, den 13.07.2015, 15:52 +0200 schrieb Richard Weinberger:

Quoted 47 lines
Quoted 34 lines · Thomas Meyer

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 
Quoted 7 lines

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.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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
arch/um/os-Linux/helper.c +3 -0
index e3ee4a5..683460f 100644
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 7 lines
Quoted 2 lines

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?!

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

Thanks,
//richard

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#6 lore raw

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 7 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 6 lines
Quoted 2 lines

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?!

Quoted 8 lines
Quoted 1 line

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

I run UML as non-root user, tun is:

$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014  /usr/bin/uml_net
Quoted 4 lines

Thanks,
//richard

Quoted 11 lines

---------------------------------------------------------------------
---------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#7 lore raw

Am 13.07.2015 um 17:08 schrieb Thomas Meyer:

Quoted 17 lines

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 7 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 6 lines
Quoted 2 lines

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?!

Quoted 8 lines
Quoted 1 line

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

Quoted 8 lines

I run UML as non-root user, tun is:

$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014  /usr/bin/uml_net

And eth0=tuntap,tap?

Thanks,
//richard

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#8 lore raw

Am Montag, den 13.07.2015, 17:11 +0200 schrieb Richard Weinberger:

Quoted 21 lines

Am 13.07.2015 um 17:08 schrieb Thomas Meyer:

Quoted 20 lines

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 8 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 7 lines
Quoted 3 lines

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?!

Quoted 8 lines
Quoted 1 line

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

I run UML as non-root user, tun is:

Quoted 8 lines
Quoted 6 lines
$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014  /usr/bin/uml_net

And eth0=tuntap,tap?

yes,

eth0=tuntap,,,192.168.10.2

Quoted 3 lines

Thanks,
//richard

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#9 lore raw
Quoted 26 lines · Thomas Meyer

Am Montag, den 13.07.2015, 17:11 +0200 schrieb Richard Weinberger:

Quoted 25 lines

Am 13.07.2015 um 17:08 schrieb Thomas Meyer:

Quoted 24 lines

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 8 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 7 lines
Quoted 3 lines

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?!

Quoted 8 lines
Quoted 1 line

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

I run UML as non-root user, tun is:

$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014  /usr/bin/uml_net

And eth0=tuntap,tap?

yes,

eth0=tuntap,,,192.168.10.2

Sorry for the late reply.
I'm still burred in work issues and had no time to look in detail at this.

But in the meanwhile you can try to gather some more Infos. Remove the dump_stack() and add some printk()s. I'm interested which PIDs are returned and waited for.

Signature · 13 lines
Thanks,
//richard

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#10 lore raw

Am Mittwoch, den 15.07.2015, 12:12 +0200 schrieb Richard Weinberger:

Quoted 34 lines
Quoted 32 lines · Thomas Meyer

Am Montag, den 13.07.2015, 17:11 +0200 schrieb Richard Weinberger:

Quoted 31 lines

Am 13.07.2015 um 17:08 schrieb Thomas Meyer:

Quoted 29 lines

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 10 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 9 lines
Quoted 4 lines

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?!

Quoted 8 lines
Quoted 1 line

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

I run UML as non-root user, tun is:

$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014  /usr/bin/uml_net
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

And eth0=tuntap,tap?

yes,

eth0=tuntap,,,192.168.10.2

Sorry for the late reply.

Hi,

null problemo.

Quoted 6 lines

I'm still burred in work issues and had no time to look in detail at this.

But in the meanwhile you can try to gather some more Infos. Remove the dump_stack() and add some printk()s. I'm interested which PIDs are returned and waited for.

Mhh.. I think the pid is already printed in error case:

[   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

pid 11673 and pid 11780 in above case were the two zombie processes.

errno 10 = ECHILD

which can happen for the waitpid() call, according to the man page:

ECHILD (for waitpid() or waitid()) The process specified by pid (waitpid()) or idtype and id (waitid()) does not exist or
is not a child of the calling process. (This can happen for one's own child if the action for SIGCHLD is set to SIG_IGN. See also the Linux Notes section about threads.)

I'm not able to completely figure out above meaning, so... But maybe ECHILD is returned because uml_net is run with setuid bit set?

any ideas?

------------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#11 lore raw
Quoted 73 lines · Thomas Meyer

Am Mittwoch, den 15.07.2015, 12:12 +0200 schrieb Richard Weinberger:

Quoted 34 lines
Quoted 32 lines · Thomas Meyer

Am Montag, den 13.07.2015, 17:11 +0200 schrieb Richard Weinberger:

Quoted 31 lines

Am 13.07.2015 um 17:08 schrieb Thomas Meyer:

Quoted 29 lines

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 10 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 9 lines
Quoted 4 lines

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?!

Quoted 8 lines
Quoted 1 line

+extern __attribute__((regparm(0))) void dump_stack(void);

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root. -> UML is unable to setup eth0.
But no zombies here.

I run UML as non-root user, tun is:

$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014  /usr/bin/uml_net
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

And eth0=tuntap,tap?

yes,

eth0=tuntap,,,192.168.10.2

Sorry for the late reply.

Hi,

null problemo.

Quoted 6 lines

I'm still burred in work issues and had no time to look in detail at this.

But in the meanwhile you can try to gather some more Infos. Remove the dump_stack() and add some printk()s. I'm interested which PIDs are returned and waited for.

Mhh.. I think the pid is already printed in error case:

[   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

pid 11673 and pid 11780 in above case were the two zombie processes.

errno 10 = ECHILD

which can happen for the waitpid() call, according to the man page:

ECHILD (for waitpid() or waitid()) The process specified by pid (waitpid()) or idtype and id (waitid()) does not exist or
is not a child of the calling process. (This can happen for one's own child if the action for SIGCHLD is set to SIG_IGN. See also the Linux Notes section about threads.)

Quoted 5 lines

I'm not able to completely figure out above meaning, so... But maybe ECHILD is returned because uml_net is run with setuid bit set?

any ideas?

The attached fix should fix the issue. Please confirm.

Signature · 2 lines
Thanks,
//richard
arch/um/os-Linux/helper.c +3 -3
index e3ee4a5..3f02d42 100644
@@ -96,7 +96,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
 			       "ret = %d\n", -n);
 			ret = n;
 		}
-		CATCH_EINTR(waitpid(pid, NULL, __WCLONE));
+		CATCH_EINTR(waitpid(pid, NULL, __WALL));
 	}
 
 out_free2:
@@ -129,7 +129,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
 		return err;
 	}
 	if (stack_out == NULL) {
-		CATCH_EINTR(pid = waitpid(pid, &status, __WCLONE));
+		CATCH_EINTR(pid = waitpid(pid, &status, __WALL));
 		if (pid < 0) {
 			err = -errno;
 			printk(UM_KERN_ERR "run_helper_thread - wait failed, "
@@ -148,7 +148,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
 int helper_wait(int pid)
 {
 	int ret, status;
-	int wflags = __WCLONE;
+	int wflags = __WALL;
 
 	CATCH_EINTR(ret = waitpid(pid, &status, wflags));
 	if (ret < 0) {

------------------------------------------------------------------------------

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#12 lore raw

Am Sonntag, den 09.08.2015, 19:57 +0200 schrieb Richard Weinberger:

Quoted 91 lines
Quoted 89 lines · Thomas Meyer

Am Mittwoch, den 15.07.2015, 12:12 +0200 schrieb Richard Weinberger:

Quoted 40 lines
Quoted 38 lines · Thomas Meyer

Am Montag, den 13.07.2015, 17:11 +0200 schrieb Richard Weinberger:

Quoted 36 lines

Am 13.07.2015 um 17:08 schrieb Thomas Meyer:

Quoted 34 lines

Am Montag, den 13.07.2015, 16:41 +0200 schrieb Richard Weinberger:

Quoted 15 lines

Am 13.07.2015 um 16:24 schrieb Thomas Meyer:

Quoted 6 lines
Quoted 5 lines

Yeah. And please add a dump_stack() to figure out
where
it
was
called.

Quoted 7 lines

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

+extern __attribute__((regparm(0))) void
dump_stack(void);

Quoted 7 lines

Hmm, maybe the regparm(0) kills your stack. Anyway, how do you trigger the issue?
I tried here and don't see any zombie processes? In my setup I run UML as non-root and tap0 is owned by root.
-> UML is unable to setup eth0.
But no zombies here.

I run UML as non-root user, tun is:

$ ll /dev/net
insgesamt 0
crw-rw----. 1 root zml-net 10, 200 13. Jul 14:49 tun
$ ll /usr/bin/uml_net
-rwsr-x---. 1 root uml-net 31472 19. Aug 2014 
 /usr/bin/uml_net
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

And eth0=tuntap,tap?

yes,

eth0=tuntap,,,192.168.10.2

Sorry for the late reply.

Hi,

null problemo.

Quoted 7 lines

I'm still burred in work issues and had no time to look in detail at
this.

But in the meanwhile you can try to gather some more Infos. Remove the dump_stack() and add some printk()s. I'm interested which PIDs are returned and waited for.

Mhh.. I think the pid is already printed in error case:

[   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

pid 11673 and pid 11780 in above case were the two zombie processes.

errno 10 = ECHILD

which can happen for the waitpid() call, according to the man page:

ECHILD (for waitpid() or waitid()) The process specified
by pid (waitpid()) or idtype and id (waitid()) does not exist or
is not a child of the calling process. (This can
happen for one's own child if the action for SIGCHLD is set to
SIG_IGN. See also the Linux Notes section about
threads.)

Quoted 8 lines
Quoted 5 lines

I'm not able to completely figure out above meaning, so... But maybe ECHILD is returned because uml_net is run with setuid bit set?

any ideas?

The attached fix should fix the issue. Please confirm.

Hi,

yes, the uml_net zombie processes are gone now!

many thanks for this patch!

with kind regards
thomas

------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel