Bug 19581

Summary: virt-builder --list gets stuck after inovacation
Product: Mageia Reporter: Shlomi Fish <shlomif>
Component: RPM PackagesAssignee: Joseph Wang <joequant>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: marja11, ngompa13, rjones
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: libguestfs CVE:
Status comment:

Description Shlomi Fish 2016-10-13 14:45:23 CEST
When I run "virt-builder --list" from the command line , it gets stuck eating 100% of a single CPU for many minutes. It also happens as root. To reproduce "urpmi libguestfs-tools".
Richard Jones 2016-10-13 15:22:32 CEST

CC: (none) => rjones

Comment 1 Richard Jones 2016-10-13 15:23:17 CEST
Stack trace at suspected crash point:

(gdb) bt
#0  0x00007ffff649d8a0 in __read_nocancel ()
    at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff642bb59 in __GI__IO_file_xsgetn (fp=0x903260,
    data=<optimized out>, n=8192) at fileops.c:1434
#2  0x00007ffff6421226 in __GI__IO_fread (buf=<optimized out>, size=1,
    count=8192, fp=0x903260) at iofread.c:42
#3  0x00000000004f560f in yy_get_next_buffer ()
#4  0x00000000004f58b4 in input ()
#5  0x00000000004f5c22 in yylex ()
#6  0x00000000004f7149 in yyparse ()
#7  0x00000000004f7335 in do_parse ()
#8  0x00000000004f7488 in virt_builder_parse_index ()
#9  0x000000000042e5d4 in camlIni_reader__read_ini_1059 ()
#10 0x000000000042ad39 in camlIndex_parser__get_index_1069 ()
#11 0x000000000048f3b1 in camlList__map_1040 ()
#12 0x0000000000422c82 in camlBuilder__main_1137 ()
#13 0x000000000043f709 in camlCommon_utils__run_main_and_handle_errors_1327 ()
#14 0x00000000004245f7 in camlBuilder__entry ()
#15 0x0000000000413669 in caml_program ()
#16 0x000000000050b73a in caml_start_program ()
#17 0x0000000000000000 in ?? ()
Comment 2 Richard Jones 2016-10-13 15:28:02 CEST
Stack trace frame 11 above corresponds to this code:

https://github.com/libguestfs/libguestfs/blob/d6c42a6c587028bfb29ccfcdf343fa00d86b6e52/builder/builder.ml#L203
Comment 3 Marja Van Waes 2016-10-13 15:29:15 CEST
Assigning to maintainer

CC: (none) => marja11
Assignee: bugsquad => joequant
Source RPM: (none) => libguestfs

Comment 4 Richard Jones 2016-10-13 15:34:13 CEST
What it's doing here is downloading

http://download.opensuse.org/repositories/Virtualization:/virt-builder-images/images/index

and then trying to parse that file using the code in

https://github.com/libguestfs/libguestfs/blob/master/builder/index-scan.l
https://github.com/libguestfs/libguestfs/blob/master/builder/index-parse.y

(However it is not hanging for me, so maybe we are seeing different
file contents, although hanging while parsing a file is never
acceptable whatever the contents are).
Comment 6 Shlomi Fish 2016-10-13 19:42:13 CEST
I fixed it locally by updating the libguestfs mgarepo checkout to 1.34.2, rebuilding it , and upgrading the packages. I can commit my changes with the permission of joequant.
Comment 7 Neal Gompa 2016-10-29 21:53:40 CEST
@Shlomi:

If it builds and works locally, can you please submit the update to 1.34.3 for Cauldron?

CC: (none) => ngompa13

Comment 8 Shlomi Fish 2019-06-07 22:39:59 CEST
works fine on latest mga7.

Status: NEW => RESOLVED
Resolution: (none) => FIXED