Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 300744 - sys-apps/portage-2.1.6.13: quickpkg/qpkg produces binpkgs with bad xpak data.
Summary: sys-apps/portage-2.1.6.13: quickpkg/qpkg produces binpkgs with bad xpak data.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 302803
  Show dependency tree
 
Reported: 2010-01-12 16:28 UTC by Jeremy Olexa (darkside) (RETIRED)
Modified: 2010-01-29 21:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
python script to emulate functionality of qtbz2 -x (xpak-extract.py,648 bytes, text/plain)
2010-01-13 05:30 UTC, Zac Medico
Details
python script to emulate functionality of qxpak -l (xpak-list.py,478 bytes, text/plain)
2010-01-13 05:37 UTC, Zac Medico
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-12 16:28:56 UTC
(completely stable, up to date system)
%% emerge --version
Portage 2.1.6.13 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.10.1-r1)

Hello, there are three packages on my system (out of ~300) that have wrong xpak data if generated with quickpkg/qpkg. Those are python, ncurses, & mysql.

Steps to reproduce:
%% sudo PKGDIR=~/tmp quickpkg --umask=0002 python
 * Building package for dev-lang/python-2.6.4 ...                        [ ok ]
 * Excluded config: '/etc/conf.d/pydoc-2.6'
 * Excluded config: '/etc/init.d/pydoc-2.6'

 * Packages now in '/home/jolexa/tmp':
 * dev-lang/python-2.6.4: 9.4M

 * Excluded config files: 2
 * See --help if you would like to include config files.
%% cd tmp/dev-lang/
%% ls -l
total 9608
-rw-rw-r-- 1 root root 9819067 Jan 11 17:20 python-2.6.4.tbz2
%% qtbz2 -x python-2.6.4.tbz2
%% ls
python-2.6.4.tbz2  python-2.6.4.xpak
%% qxpak -l python-2.6.4.xpak     
USE
FEATURES
LICENSE
COUNTER
CXXFLAGS
SRC_URI
KEYWORDS
CBUILD
CONTENTS
RDEPEND
SLOT
DEPEND
IUSE
CHOST
LDFLAGS
PF
HOMEPAGE
DEFINED_PHASES
repository
PROVIDE
environment.bz2
PDEPEND
INHERITED
CATEGORY
EAPI
DESCRIPTION
CXX
python-2.6.4.ebuild
NEEDED
CFLAGS
BINPKGMD5
NEEDED.ELF.2
%% for i in $(qxpak -l python-2.6.4.xpak); do echo "Extracting $i"; qxpak -x python-2.6.4.xpak $i; done
Extracting USE
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting FEATURES
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting LICENSE
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting COUNTER
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CXXFLAGS
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting SRC_URI
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting KEYWORDS
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CBUILD
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CONTENTS
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting RDEPEND
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting SLOT
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting DEPEND
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting IUSE
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CHOST
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting LDFLAGS
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting PF
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting HOMEPAGE
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting DEFINED_PHASES
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting repository
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting PROVIDE
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting environment.bz2
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting PDEPEND
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting INHERITED
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CATEGORY
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting EAPI
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting DESCRIPTION
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CXX
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting python-2.6.4.ebuild
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting NEEDED
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting CFLAGS
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting BINPKGMD5
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
Extracting NEEDED.ELF.2
qxpak: qxpak.c:213: xpak_extract: Assertion `(size_t)x->data_len < sizeof(ext)' failed.
Aborted
%%

Interesting analysis:
- xpak size differs when created with quickpkg/qpkg vs FEATURES=buildpkg

-rw-r--r-- 1 jolexa users  60705 Jan 12 16:14 buildpkg/python-2.6.4.xpak
-rw-r--r-- 1 jolexa users 407388 Jan 12 16:12 qpkg/python-2.6.4.xpak
-rw-r--r-- 1 jolexa users 407388 Jan 12 16:10 quickpkg/dev-lang/python-2.6.4.xpak

- Out of the three methods to creating binpkgs, buildpkg is the only one that works for these problem packages. (qpkg, quickpkg, FEATURES=buildpkg)
-Multiple devs have reproduced this for e.g python.
Comment 1 solar (RETIRED) gentoo-dev 2010-01-13 01:22:39 UTC
SpanKY, 
We/Mainly You might be interested in this bug.
Comment 2 Zac Medico gentoo-dev 2010-01-13 03:55:56 UTC
(In reply to comment #0)
> Interesting analysis:
> - xpak size differs when created with quickpkg/qpkg vs FEATURES=buildpkg
> 
> -rw-r--r-- 1 jolexa users  60705 Jan 12 16:14 buildpkg/python-2.6.4.xpak
> -rw-r--r-- 1 jolexa users 407388 Jan 12 16:12 qpkg/python-2.6.4.xpak
> -rw-r--r-- 1 jolexa users 407388 Jan 12 16:10
> quickpkg/dev-lang/python-2.6.4.xpak

My gut feeling is that the problem(s) are all on the portage-utils side. It doesn't make sense to get different results from buildpkg and quickpkg since they both use the exact same code from the portage.xpak module.
Comment 3 solar (RETIRED) gentoo-dev 2010-01-13 04:01:26 UTC
(In reply to comment #2)
> (In reply to comment #0)
> > Interesting analysis:
> > - xpak size differs when created with quickpkg/qpkg vs FEATURES=buildpkg
> > 
> > -rw-r--r-- 1 jolexa users  60705 Jan 12 16:14 buildpkg/python-2.6.4.xpak
> > -rw-r--r-- 1 jolexa users 407388 Jan 12 16:12 qpkg/python-2.6.4.xpak
> > -rw-r--r-- 1 jolexa users 407388 Jan 12 16:10
> > quickpkg/dev-lang/python-2.6.4.xpak
> 
> My gut feeling is that the problem(s) are all on the portage-utils side. It
> doesn't make sense to get different results from buildpkg and quickpkg since
> they both use the exact same code from the portage.xpak module.
> 

Zac, 
My gut feeling the was the same at first, then darkside showed me that it happens even with the new quickpkg.py rewrite. IMO it's unclear where the real bug is here.
Comment 4 Zac Medico gentoo-dev 2010-01-13 05:30:05 UTC
Created attachment 216331 [details]
python script to emulate functionality of qtbz2 -x
Comment 5 Zac Medico gentoo-dev 2010-01-13 05:37:32 UTC
Created attachment 216333 [details]
python script to emulate functionality of qxpak -l
Comment 6 Zac Medico gentoo-dev 2010-01-13 05:40:37 UTC
Jeremy, please try these scripts on your 'bad' tbz2 that was created by quickpkg. I suspect it is perfectly valid since quickpkg uses exactly the same code as --buildpkg. The reason quickpkg produces a larger xpak segment is that it contains the CONTENTS file.
Comment 7 SpanKY gentoo-dev 2010-01-13 13:42:01 UTC
should we fix quickpkg to not include the CONTENTS file ?  i'll look into fixing qxpak in the mean time ...
Comment 8 SpanKY gentoo-dev 2010-01-13 13:52:52 UTC
ive fixed qxpak:
http://sources.gentoo.org/gentoo-projects/portage-utils/qxpak.c?r1=1.16&r2=1.17

but i think quickpkg and --buildpkg should mirror each other exactly (i.e. no CONTENTS)
Comment 9 Zac Medico gentoo-dev 2010-01-13 20:36:07 UTC
(In reply to comment #7)
> should we fix quickpkg to not include the CONTENTS file ?

Yes, that's fixed in r15198.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-14 05:19:05 UTC
I have confirmed portage-utils-0.3 working and now quickpkg works similarly to --buildpkg in svn so I guess this bug is resolved.

Thanks for looking at it.
Comment 11 Zac Medico gentoo-dev 2010-01-29 21:35:49 UTC
This is fixed in 2.1.7.17 and 2.2_rc62.