pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testsuite failures on Ubuntu's autobuilders


From: Ben Pfaff
Subject: Re: Testsuite failures on Ubuntu's autobuilders
Date: Wed, 14 Mar 2012 22:15:32 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Ben Pfaff <address@hidden> writes:

> John Darrington <address@hidden> writes:
>
>> 180 and 181 both relate to reading of openoffice.org
>> spreadsheet files and seem to be just warnings.  I wonder why
>> the problem didn't show up on debian?  Maybe a different libxml
>> library?  Since this xml is generated by openoffice itself,
>> there's probably not much we can do if libxml thinks it is
>> wrong.  Perhaps we should just change the test to ignore the
>> warning.
>
> Looking through my own builder's logs, I see at least three
> failures of these tests on different days (Feb. 29 and March 2
> and 3):
>
> http://pspp.benpfaff.org/~blp/pspp-master/20120229030501/testsuite.dir/
> http://pspp.benpfaff.org/~blp/pspp-master/20120302030501/testsuite.dir/
> http://pspp.benpfaff.org/~blp/pspp-master/20120303030503/testsuite.dir/
>
> Must be something nondeterministic at work.

I found it with valgrind and fixed it with this commit:

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <address@hidden>
Date: Wed, 14 Mar 2012 22:05:54 -0700
Subject: [PATCH] ods-reader: Fix write beyond end of buffer.

The compiler multiplies by sizeof *var_spec for us here, so doing
it ourselves writes past the end of the allocated space.

Tracked down with valgrind.

Reported-by: Boris Heisel <address@hidden>
---
 src/data/ods-reader.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/data/ods-reader.c b/src/data/ods-reader.c
index 122e98c..aedea07 100644
--- a/src/data/ods-reader.c
+++ b/src/data/ods-reader.c
@@ -462,7 +462,7 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct 
dictionary **dict)
                  var_spec = xrealloc (var_spec, sizeof (*var_spec) * (idx + 
1));
 
                  /* xrealloc (unlike realloc) doesn't initialise its memory to 
0 */
-                 memset (var_spec + n_var_specs * sizeof (*var_spec),
+                 memset (var_spec + n_var_specs,
                          0, 
                          (n_var_specs - idx + 1) * sizeof (*var_spec));
                  n_var_specs = idx + 1;
-- 
1.7.2.5


-- 
Ben Pfaff 
http://benpfaff.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]