Another patch in need of explanatory context ...
This patch is starting to smell like a fix for the several
subtle I18N problems on HEAD. The segfault, and
the assertion failure all have RPM_I18NSTRING_TYPE
in common when I drill down to see what is happening.
(aside) I have exactly 1 tag in 1 package that uses
RPM_I18NSTRING_TYPE, and the only reason I
have even that is due to a Fedora packaging
oversight. 1 tag is enough for a reproducer, but hardly
enough to claim "fixed". Off to build some pkgs
with i18n tags this evening, todo++.
This patch changes how RPM_I18NSTRING_TYPE
is handled. The patch treats i18n tags as an argv array
rather than a string (which is how i18n strings
are handled internal to rpm).
I'm going to try to hustle a fix into HEAD
to stop creating packages that use RPM_I18NSTRING_TYPE.
For legacy reasons, rpm-5.0 is going to have to continue
handling the bad old type. What I need to find out
is whether arbitrary tags behave well enough to risk throwing
Summary: Group: and Description: onto the mechanism.
So far everything I've tried with arbitrary tags has worked, but
those thre tags are a bit more important than most info in
packages.
73 de Jeff
On Dec 12, 2007, at 4:55 PM, Jeff Johnson wrote:
> RPM Package Manager, CVS Repository
> http://rpm5.org/cvs/
>
> ______________________________________________________________________
> ______
>
> Server: rpm5.org Name: Jeff Johnson
> Root: /v/rpm/cvs Email: jbj@rpm5.org
> Module: rpm Date: 12-Dec-2007
> 22:55:26
> Branch: HEAD Handle: 2007121221552500
>
> Modified files:
> rpm CHANGES
> rpm/rpmdb header.c
>
> Log:
> - another attempt to identify the RPM_I18NSTRING_TYPE flaw.
>
> Summary:
> Revision Changes Path
> 1.1979 +1 -0 rpm/CHANGES
> 1.144 +1 -11 rpm/rpmdb/header.c
>
> ______________________________________________________________________
> ______
>
> patch -p0 <<'@@ .'
> Index: rpm/CHANGES
>
> ======================================================================
> ======
> $ cvs diff -u -r1.1978 -r1.1979 CHANGES
> --- rpm/CHANGES 12 Dec 2007 20:01:24 -0000 1.1978
> +++ rpm/CHANGES 12 Dec 2007 21:55:25 -0000 1.1979
> @@ -1,4 +1,5 @@
> 5.0b1 -> 5.0b2:
> + - jbj: another attempt to identify the RPM_I18NSTRING_TYPE
> flaw.
> - jbj: attempt to measure performance improvement using
> binary tag search.
> - jbj: trade an I18NSTRING assert failure for a memory leak
> for the moment.
> - jbj: push rpm2cpio w-i-p into cvs, try to measure linear <-
> > bsearch win.
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/rpmdb/header.c
>
> ======================================================================
> ======
> $ cvs diff -u -r1.143 -r1.144 header.c
> --- rpm/rpmdb/header.c 12 Dec 2007 20:01:24 -0000 1.143
> +++ rpm/rpmdb/header.c 12 Dec 2007 21:55:25 -0000 1.144
> @@ -1893,23 +1893,13 @@
> case RPM_UINT64_TYPE:
> nb = he->c * sizeof(*he->p.ui64p);
> break;
> - case RPM_I18NSTRING_TYPE:
> -#if HACK_AROUND
> -assert(he->c == 1); /* XXX stop unimplemented oversights. */
> -#else
> - if (he->c > 1) {
> - he->t = RPM_STRING_TYPE;
> - he->p.str = he->p.argv[0];
> - he->c = 1;
> - }
> -#endif
> - /*@fallthrough@*/
> case RPM_STRING_TYPE:
> if (he->p.str)
> nb = strlen(he->p.str) + 1;
> else
> rc = 0;
> break;
> + case RPM_I18NSTRING_TYPE:
> case RPM_STRING_ARRAY_TYPE:
> break;
> }
> @@ .
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> CVS Sources Repository rpm-cvs@rpm5.org
Received on Wed Dec 12 23:07:35 2007