Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1004918 - git.Repo(os.getcwd()).repo.head.commit doesn't work at i686
Summary: git.Repo(os.getcwd()).repo.head.commit doesn't work at i686
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 19
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-05 18:08 UTC by Igor Gnatenko
Modified: 2014-03-31 20:48 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-16 12:02:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
test.py (221 bytes, text/x-python)
2013-09-05 18:08 UTC, Igor Gnatenko
no flags Details

Description Igor Gnatenko 2013-09-05 18:08:02 UTC
Created attachment 794428 [details]
test.py

Description of problem:
git.Repo(os.getcwd()).repo.head.commit doesn't work at i686

Version-Release number of selected component (if applicable):
git-1.8.3.1-1.fc19.i686
GitPython-0.3.2-0.4.RC1.fc19.noarch
python-2.7.5-4.fc19.i686

How reproducible:
always

Steps to Reproduce:
1. clone any git repo (e.g. Linus kernel tree)
2. cd to clonned repo
3. run test script

Actual results:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Traceback (most recent call last):
  File "../../bar.py", line 9, in <module>
    headcommit = head.commit
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 168, in
_get_commit
    obj = self._get_object()
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 161, in
_get_object
    return Object.new_from_sha(self.repo,
hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "/usr/lib/python2.7/site-packages/git/objects/base.py", line 64, in
new_from_sha
    oinfo = repo.odb.info(sha1)
  File "/usr/lib/python2.7/site-packages/gitdb/db/base.py", line 256, in
info
    return self._db_query(sha).info(sha)
  File "/usr/lib/python2.7/site-packages/gitdb/db/base.py", line 239, in
_db_query
    if db.has_object(sha):
  File "/usr/lib/python2.7/site-packages/gitdb/db/pack.py", line 88, in
has_object
    self._pack_info(sha)
  File "/usr/lib/python2.7/site-packages/gitdb/db/pack.py", line 71, in
_pack_info
    index = item[2](sha)
  File "/usr/lib/python2.7/site-packages/gitdb/pack.py", line 492, in
sha_to_index
    return PackIndexFile_sha_to_index(self, sha)
ValueError: Couldn't obtain fanout table

Expected results:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
ae7a835cc546fc67df90edaaa0c48ae2b22a29fe

Additional info:
This arch-specify problem. At x86_64 isn't present.

Comment 1 Fl@sh 2013-09-06 16:32:19 UTC
 I'm sorry to interrupt, but:
PackIndexFile_sha_to_index imported from _perf :

/usr/lib/python2.7/site-packages/gitdb/pack.py", line 34:

from _perf import PackIndexFile_sha_to_index

It is the /usr/lib64/python2.7/site-packages/gitdb/_perf.so

# yum provides */_perf.so  --disablerepo=*debug*
.... 
python-gitdb-0.5.4-5.fc19.x86_64 : A pure-Python git object database
Repo        : fedora
Matched from:
Filename    : /usr/lib64/python2.7/site-packages/gitdb/_perf.so

python-gitdb-0.5.4-5.fc19.x86_64 : A pure-Python git object database
Repo        : @fedora
Matched from:
Filename    : /usr/lib64/python2.7/site-packages/gitdb/_perf.so

Therefore this bug should be redirected to python-gitdb package.

Comment 2 Gwyn Ciesla 2013-09-06 17:26:41 UTC
python-gitdb-0.5.4-4.fc18.armv6hl
GitPython-0.3.2-0.3.RC1.fc18.noarch
python-2.7.3-13.fc18.1302271210kf.armv6hl
git-1.8.0.1-1.fc18.armv6hl

Seems to work.

Comment 3 Fl@sh 2013-09-06 17:58:57 UTC
maybe I'm wrong, but it's just such an Exception:
/home/Flash/gitdb-0.5.4/gitdb/_fun.c , line 27-32 :

// read lo and hi bounds
	PyObject* fanout_table = PyObject_GetAttrString(inst, "_fanout_table");
	if (!fanout_table){
		PyErr_SetString(PyExc_ValueError, "Couldn't obtain fanout table");
		return NULL;
	}

=> that is, it is not the fault of _perf.so
 ;)

Comment 4 Fl@sh 2013-09-06 19:57:33 UTC
it seems this is the last redirected ( LOL ) :

if bug exist, then it is here :

http://docs.python.org/2/c-api/object.html
    PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name)

or variable inst really do not have that option :D

Comment 5 Igor Gnatenko 2013-09-06 20:00:53 UTC
Tested on bubuntu i686. Bug isn't present.
git (1.8.3.2-1)
python-gitdb (0.5.4-1)
python-git (0.3.2~RC1-2)
python (2.7.5-4)

Comment 6 Fl@sh 2013-09-06 20:08:11 UTC
(In reply to Igor Gnatenko from comment #5)
> Tested on bubuntu i686. Bug isn't present.
> git (1.8.3.2-1)
> python-gitdb (0.5.4-1)
> python-git (0.3.2~RC1-2)
> python (2.7.5-4)

To be sure it would be good to compare the code in gitdb-0.5.4/gitdb/_fun.c, line 27-32. If the code is identical, then just need to redirect to python package.

Comment 7 Igor Gnatenko 2013-09-06 20:20:20 UTC
(In reply to Fl@sh from comment #6)
> (In reply to Igor Gnatenko from comment #5)
> > Tested on bubuntu i686. Bug isn't present.
> > git (1.8.3.2-1)
> > python-gitdb (0.5.4-1)
> > python-git (0.3.2~RC1-2)
> > python (2.7.5-4)
> 
> To be sure it would be good to compare the code in gitdb-0.5.4/gitdb/_fun.c,
> line 27-32. If the code is identical, then just need to redirect to python
> package.
identical. ok. re-assign.

Comment 8 Fl@sh 2013-09-06 20:27:50 UTC
however, the error may be to initialize the variable inst here :
/home/Flash/gitdb-0.5.4/gitdb/_fun.c , line 12-15 :

// get instance and sha
	PyObject* inst = 0;
	if (!PyArg_ParseTuple(args, "Os#", &inst, &sha, &sha_len))
		return NULL;

but it does not change anything. It's all the same python.

Comment 9 Bohuslav "Slavek" Kabrda 2013-09-16 12:02:58 UTC
Definitely not a Python issue. Running under python-debug, I get:

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Traceback (most recent call last):
  File "a.py", line 9, in <module>
    headcommit = head.commit
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 168, in _get_commit
    obj = self._get_object()
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 161, in _get_object
    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "/usr/lib/python2.7/site-packages/git/objects/base.py", line 64, in new_from_sha
    oinfo = repo.odb.info(sha1)
  File "/usr/lib/python2.7/site-packages/gitdb/db/base.py", line 256, in info
    return self._db_query(sha).info(sha)
  File "/usr/lib/python2.7/site-packages/gitdb/db/base.py", line 239, in _db_query
    if db.has_object(sha):
  File "/usr/lib/python2.7/site-packages/gitdb/db/pack.py", line 88, in has_object
    self._pack_info(sha)
  File "/usr/lib/python2.7/site-packages/gitdb/db/pack.py", line 71, in _pack_info
    index = item[2](sha)
  File "/usr/lib/python2.7/site-packages/gitdb/pack.py", line 419, in sha_to_index
    get_sha = self.sha
  File "/usr/lib/python2.7/site-packages/gitdb/util.py", line 238, in __getattr__
    self._set_cache_(attr)
  File "/usr/lib/python2.7/site-packages/gitdb/pack.py", line 281, in _set_cache_
    mmap = self._cursor.map()
  File "/usr/lib/python2.7/site-packages/gitdb/util.py", line 238, in __getattr__
    self._set_cache_(attr)
  File "/usr/lib/python2.7/site-packages/gitdb/pack.py", line 274, in _set_cache_
    raise AssertionError("The index file at %s is too large to fit into a mapped window (%i > %i). This is a limitation of the implementation" % (self._indexpath, self._cursor.file_size(), mman.window_size()))
AssertionError: The index file at /root/linux/.git/objects/pack/pack-9e6f8c55dcde2d199604b5efe6db04bb5269e364.idx is too large to fit into a mapped window (90411812 > 33554432). This is a limitation of the implementation


So I'm closing this as cantfix, sorry. If you really need to use this on big indexes (like linux kernel), try using 64bit machine (on small indexes, it works like a charm).

Comment 10 Igor Gnatenko 2013-09-16 12:08:21 UTC
But why on ububuntu all works fine on i686?

Comment 11 Bohuslav "Slavek" Kabrda 2013-09-16 12:18:44 UTC
(In reply to Igor Gnatenko from comment #10)
> But why on ububuntu all works fine on i686?

Did you test it on sufficiently large repository, e.g. linux kernel? It works ok on small repositories on i686.

Comment 12 Igor Gnatenko 2013-09-16 12:23:44 UTC
(In reply to Bohuslav "Slavek" Kabrda from comment #11)
> (In reply to Igor Gnatenko from comment #10)
> > But why on ububuntu all works fine on i686?
> 
> Did you test it on sufficiently large repository, e.g. linux kernel? It
> works ok on small repositories on i686.
yeah. I will re-test on bubuntu i686 w/ Linus git tree and if that works will re-open this bug..


Note You need to log in before you can comment on or make changes to this bug.