Bug#552570: bibutils: xml2bib segfaults for large xml files on i386 arch

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#552570: bibutils: xml2bib segfaults for large xml files on i386 arch

Andreas Tille
Package: bibutils
Version: 4.3-1
Severity: important

Hi,

I observer the following problem on i386 arch:

$ xml2bib buggy.xml
Segmentation fault
$ ls -l buggy.xml
-rw-r--r-- 1 tillea admin 2886795 Oct 27 15:31 buggy.xml


The same runs fine on amd64 architecture.  I can provide the
xml file in question but I do not want to blur the BTS with
3MB files.

Kind regards

      Andreas.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (501, 'testing'), (50, 'unstable'), (5, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-2-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bibutils depends on:
ii  libbibutils1                  4.3-1      bibliography file converter, share
ii  libc6                         2.9-25     GNU C Library: Shared libraries

bibutils recommends no packages.

bibutils suggests no packages.

-- no debconf information



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#552570: bibutils: xml2bib segfaults for large xml files on i386 arch

David Bremner-5


Andreas Tille wrote:


>The same runs fine on amd64 architecture.  I can provide the
>xml file in question but I do not want to blur the BTS with
>3MB files.


Dear Andreas;

Yes, please send me either a gzipped copy of the xml file, or a link
where I can fetch it.  If all else fails I could get it off alioth.

All the best,

David




--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#552570: bibutils: xml2bib segfaults for large xml files on i386 arch

David Bremner-5
In reply to this post by Andreas Tille

Thanks for the test data. A quick look with valgrind in an i386 chroot
finds uninitialized value used in routine name_comma. Hopefully that
is enough of a clue to track it down; I'll have a go this weekend.
There is also a new upstream version, which might or might not fix
this bug.

d




--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#552570: bibutils: xml2bib segfaults for large xml files on i386 arch

David Bremner-5
In reply to this post by Andreas Tille


The following patch seems to fix it for me. I may as well do a new
upstream release as well as the bug fix, so it will take a bit longer.

diff --git a/lib/name.c b/lib/name.c
index 94a225c..e1dec3a 100644
--- a/lib/name.c
+++ b/lib/name.c
@@ -185,6 +185,7 @@ name_comma( char *p, newstr *outname )
 
        /** Last name **/
        start_last = skip_ws( p );
+       end_last = string_end(p);
        while ( *p && ( *p!=',' ) ) {
                newstr_addchar( outname, *p++ );
                end_last = p;





test.xml (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#552570: bibutils: xml2bib segfaults for large xml files on i386 arch

Andreas Tille
On Fri, 30 Oct 2009, David Bremner wrote:

> The following patch seems to fix it for me. I may as well do a new
> upstream release as well as the bug fix, so it will take a bit longer.
>
> diff --git a/lib/name.c b/lib/name.c
> index 94a225c..e1dec3a 100644
> --- a/lib/name.c
> +++ b/lib/name.c
> @@ -185,6 +185,7 @@ name_comma( char *p, newstr *outname )
>
>        /** Last name **/
>        start_last = skip_ws( p );
> +       end_last = string_end(p);
>        while ( *p && ( *p!=',' ) ) {
>                newstr_addchar( outname, *p++ );
>                end_last = p;

I tried this patch but it does not work for me.

Kind regards

           Andreas.



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]