kvm-autotest: weird memory error during stepmaker test
Wondering if anyone else using kvm-autotest stepmaker has ever seen this error:
Traceback (most recent call last):
File "/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepmaker.py", line 146, in update
self.set_image_from_file(self.screendump_filename)
File "/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepeditor.py", line 499, in set_image_from_file
self.set_image(w, h, data)
File "/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepeditor.py", line 485, in set_image
w, h, w*3))
MemoryError
The guest is still running, but stepmaker isn't recording any more so it's boned at that point. And of course, it's near the end of a guest install so one has lost a decent amount of time...
Signature · 4 lines
Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx [email protected]
Excerpts from Ryan Harper's message of Qua Abr 01 12:55:58 -0300 2009:
Quoted 15 lines
Wondering if anyone else using kvm-autotest stepmaker has ever seen this error:
Traceback (most recent call last):
File
"/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepmaker. py", line 146, in update
self.set_image_from_file(self.screendump_filename)
File
"/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepeditor.py", line 499, inset_image_from_file
self.set_image(w, h, data)
File
"/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepeditor.py", line 485, inset_image
Quoted 2 lines
w, h, w*3))MemoryError
I've seen this error twice today, while trying to create a step file to install a Windows 2008 R2 64-bit guest (the Win2008-64 step file available on the git repository doesn't work for me). This happened when the guest was being rebooted by the windows installer. The contents of the screen dump file are this:
$ cat /home/ehabkost/autotest/kvm-autotest/client/results/default/kvm_runtest_2.Win2008.64.install/debug/scrdump.ppm P6 0 0 255 $
And the 0x0 pixmap really makes gdk panic:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(w, h, data) =
ppm_utils.image_read_from_ppm_file('/home/ehabkost/autotest/kvm-autotest/client/results/default/kvm_runtest_2.Win2008.64.install/debug/scrdump.ppm')w,h,data
(0, 0, '')
Quoted 1 line
Quoted 1 line
Quoted 1 line
gtk.gdk.pixbuf_new_from_data(data, gtk.gdk.COLORSPACE_RGB, False, 8, w, h, w*3)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError
Quoted 9 lines
Quoted 1 line
Quoted 1 line
The guest is still running, but stepmaker isn't recording any more so it's boned at that point. And of course, it's near the end of a guest install so one has lost a decent amount of time...
Signature · 1 line
Eduardo
PATCH 1/1 kvm-autotest: stepeditor: clear image if width, height, or data are invalid
This patch fixes the following issue:
Excerpts from Eduardo Habkost's message of Fri Apr 03 17:37:56 -0300 2009:
Quoted 35 lines
Excerpts from Ryan Harper's message of Wed Apr 01 12:55:58 -0300 2009:
Quoted 15 lines
Wondering if anyone else using kvm-autotest stepmaker has ever seen this error:
Traceback (most recent call last):
File
"/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepmaker. py", line 146, in update
self.set_image_from_file(self.screendump_filename)
File
"/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepeditor.py", line 499, inset_image_from_file
self.set_image(w, h, data)
File
"/home/rharper/work/git/build/kvm-autotest/client/tests/kvm_runtest_2/stepeditor.py", line 485, inset_imageQuoted 2 lines
w, h, w*3))MemoryError
I've seen this error twice today, while trying to create a step file to install a Windows 2008 R2 64-bit guest (the Win2008-64 step file available on the git repository doesn't work for me). This happened when the guest was being rebooted by the windows installer. The contents of the screen dump file are this:
$ cat /home/ehabkost/autotest/kvm-autotest/client/results/default/kvm_runtest_2.Win200 8.64.install/debug/scrdump.ppm P6 0 0 255 $And the
0x0pixmap really makes gdk panic:
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(w, h, data) =
ppm_utils.image_read_from_ppm_file('/home/ehabkost/autotest/kvm-autotest/client/results/default/kvm_runtest_2.Win2008.64.install/debug/scrdump.ppm')w,h,data(0, 0, '')
Quoted 1 line
Quoted 1 line
Quoted 1 line
gtk.gdk.pixbuf_new_from_data(data, gtk.gdk.COLORSPACE_RGB, False, 8, w, h, w*3)Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryErrorQuoted 1 line
Quoted 1 line
Quoted 1 line
--- client/tests/kvm_runtest_2/stepeditor.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
client/tests/kvm_runtest_2/stepeditor.py +9 -5
@@ -488,14 +488,18 @@ Utilities vscrollbar = self.scrolledwindow.get_vscrollbar() vscrollbar.set_range(0, h) + def clear_image(self): + self.image.clear() + self.image_width = 0 + self.image_height = 0 + self.image_data = "" + def set_image_from_file(self, filename): if not filename or not os.path.exists(filename): - self.image.clear() - self.image_width = 0 - self.image_height = 0 - self.image_data = "" - return + return self.clear_image() (w, h, data) = ppm_utils.image_read_from_ppm_file(filename) + if w <= 0 or h <= 0 or not data: + return self.clear_image() self.set_image(w, h, data) def get_step_lines(self, output_dir=None, current_step=None):
Signature · 3 lines
1.5.5.6 -- Eduardo
Re: [PATCH] kvm-autotest: stepeditor: clear image if width, height, or data are invalid
Quoted 30 lines · Eduardo Habkost
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
SPACE_RGB, False, 8, w, h, w*3)Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryErrorSigned-off-by Eduardo Habkost <[email protected]>--- client/tests/kvm_runtest_2/stepeditor.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)client/tests/kvm_runtest_2/stepeditor.py +6
-1@@ -488,14 +488,18 @@ Utilities vscrollbar = self.scrolledwindow.get_vscrollbar() vscrollbar.set_range(0, h) + def clear_image(self): + self.image.clear() + self.image_width = 0 + self.image_height = 0 + self.image_data = "" + def set_image_from_file(self, filename): if not filename or not os.path.exists(filename): - self.image.clear()
client/tests/kvm_runtest_2/stepeditor.py Utilities · line 504
Quoted 10 lines
client/tests/kvm_runtest_2/stepeditor.py +3
-4- self.image_width = 0 - self.image_height = 0 - self.image_data = "" - return + return self.clear_image() (w, h, data) = ppm_utils.image_read_from_ppm_file(filename) + if w <= 0 or h <= 0 or not data: + return self.clear_image() self.set_image(w, h, data)
Instead of returning an empty image here, we should throw an exception. Qemu shouldn't write invalid image.
I've just sent a patch to qemu-devel which may help with this.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [PATCH] kvm-autotest: stepeditor: clear image if width, height, or data are invalid
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Eduardo Habkost
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
SPACE_RGB, False, 8, w, h, w*3)Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError
<snip>
Quoted 4 lines
Quoted 1 line
Instead of returning an empty image here, we should throw an exception. Qemu shouldn't write invalid image.
Throwing an exception is exactly what the current code does, and what I want to prevent. stepeditor is a GUI application, there is no point in aborting because the image is invalid during a small time window.
But fixing qemu is welcome, of course.
Quoted 2 lines
I've just sent a patch to qemu-devel which may help with this.
Signature · 1 line
Eduardo
Re: [PATCH] kvm-autotest: stepeditor: clear image if width, height, or data are invalid
In reply to Avi KivityQuoted 36 lines · Avi Kivity
Quoted 22 lines · Eduardo Habkost
Signed-off-by Eduardo Habkost <[email protected]>--- client/tests/kvm_runtest_2/stepeditor.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)client/tests/kvm_runtest_2/stepeditor.py +6
-1@@ -488,14 +488,18 @@ Utilities vscrollbar = self.scrolledwindow.get_vscrollbar() vscrollbar.set_range(0, h) + def clear_image(self): + self.image.clear() + self.image_width = 0 + self.image_height = 0 + self.image_data = "" + def set_image_from_file(self, filename): if not filename or not os.path.exists(filename): - self.image.clear()client/tests/kvm_runtest_2/stepeditor.py Utilities · line 503
Quoted 10 lines
client/tests/kvm_runtest_2/stepeditor.py +3
-4- self.image_width = 0 - self.image_height = 0 - self.image_data = "" - return + return self.clear_image() (w, h, data) = ppm_utils.image_read_from_ppm_file(filename) + if w <= 0 or h <= 0 or not data: + return self.clear_image() self.set_image(w, h, data)Instead of returning an empty image here, we should throw an exception. Qemu shouldn't write invalid image.
Quoted 2 lines
I've just sent a patch to qemu-devel which may help with this.
I'm going to accept this patch.
For step-maker and step-editor, I think we should let the user finish creating/editing the step-file (see Ryan's comment about wasting time).
For guest-installation test (kvm-guest-wizard), I agree that we should fail the test, and not ignore the error.
Thanks,
Uri.