[CRIU] [PATCH 1/5] zdtm.py: don't stack trace when umount fails

Andrew Vagin avagin at virtuozzo.com
Mon Nov 23 23:55:42 PST 2015


On Mon, Nov 23, 2015 at 01:55:24PM -0700, Tycho Andersen wrote:
> I'm not exactly sure why, but it seems when a test fails sometimes I get
> this stack trace:
> 
> sudo ./zdtm.py run -t zdtm/live/static/bridge
> === Run 1/1 ================
> 
> ====================== Run zdtm/live/static/bridge in ns =======================
> cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../../lib/arch/x86/include -I../../lib   bridge.c ../../lib/libzdtmtst.a   -o bridge
> Start test
> Test is SUID
> ./bridge --pidfile=bridge.pid --outfile=bridge.out
> mount: /tmp/criu-root-eIt72x is not mountpoint or bad option
> 
>        In some cases useful info is found in syslog - try
>        dmesg | tail or so.
> Run criu dump
> Run criu restore
> ------------------------ grep Error ------------------------
> (00.322301)      1: Error (net.c:597): Restoring link lo type 1 (idx 1)
> (00.322556)      1: Error (net.c:597): Restoring link zdtmbr0 type 6 (idx 2)
> (00.334240)      1: Error (net.c:553): waiting on if zdtmbr0 (index 2 and 2)
> ------------------------ ERROR OVER ------------------------
> Wait for zdtm/live/static/bridge to die for 0.100000
> Test output: ================================
> 1c1
> < 2: zdtmbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
> ---
> > 2: zdtmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
> 02:46:34.877:     5: FAIL: bridge.c:76: Net config differs after restore (errno = 11 (Resource temporarily unavailable))
> 
>  <<< ================================
> Traceback (most recent call last):
>   File "zdtm.py", line 922, in <module>
>     do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
>   File "zdtm.py", line 696, in do_run_test
>     t.kill()
>   File "zdtm.py", line 302, in kill
>     self.__flavor.fini()
>   File "zdtm.py", line 168, in fini
>     subprocess.check_call(["mount", "--make-private", self.root])
>   File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
>     raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['mount', '--make-private', '/tmp/criu-root-eIt72x']' returned non-zero exit status 32
> umount: /tmp/criu-root-eIt72x: not mounted
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  test/zdtm.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/test/zdtm.py b/test/zdtm.py
> index b9bcb4f..2e701b3 100755
> --- a/test/zdtm.py
> +++ b/test/zdtm.py
> @@ -165,8 +165,12 @@ class ns_flavor:
>  			self.__copy_libs(dep)
>  
>  	def fini(self):
> -		subprocess.check_call(["mount", "--make-private", self.root])
> -		subprocess.check_call(["umount", "-l", self.root])
> +		try:
> +			# if these fail, we don't really care.
> +			subprocess.check_call(["mount", "--make-private", self.root])
> +			subprocess.check_call(["umount", "-l", self.root])
> +		except subprocess.CalledProcessError:

I think we should print an error message here.
> +			pass
>  
>  class userns_flavor(ns_flavor):
>  	def __init__(self, opts):
> -- 
> 2.6.2
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list