bzr update exceeds pypy's maximum recursion depth in gigantic repositories such as MariaDB.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
New
|
Undecided
|
Unassigned |
Bug Description
I'm using bzr to access MariaDB's source code. MariaDB has a gigantic repository full of its and MySQL's years and years of history with tons of branches and tags. Using bzr with MariaDB's repository is extra slow, because the repository is so gigantic. If you don't believe me just do a check out of its repository:
cd $repo/maria # (ex: ~/repos/maria)
bzr branch lp:maria trunk
(from: https:/
This will use an insane 1.2 gigs or so of ram, and take 30 minutes to an hour depending on how fast your computer is. This was before I switched to using pypy instead of python, so with pypy it will probably run faster, and use less memory.
After checking out MariaDB's repository, cd to it (cd maria/trunk), and then run the command:
bzr update -r tag:mariadb-10.0.4
This command should switch the working copy to the version tagged as MariaDB 10.0.4.
Instead it blows up because it exceeds python's recursion depth (Perl's is 100 levels, so chances are python's is similar.).
Apparently, open() in the file branch.py calls open_branch() in the file bzrdir.py, which in turn calls open() in the file branch.py, which in turn calls open_branch() in the file bzrdir.py. At least this is what the backtrace seems to indicate.
This is unusual, and really cool. I've never seen recursion among two functions calling each other repeatedly. Normally recursion is one function calling itself. But both create loops that can blow up in your face on large inputs such as MariaDB's gigantic repository.
The back trace is pasted below:
$ bzr update -r tag:mariadb-10.0.4
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/usr/lib64/
return the_callable(*args, **kwargs)
File "/usr/lib64/
ret = run(*run_argv)
File "/usr/lib64/
return self.run(
File "/usr/lib64/
return self._operation
File "/usr/lib64/
self.cleanups, self.func, *args, **kwargs)
File "/usr/lib64/
result = func(*args, **kwargs)
File "/usr/lib64/
tree = WorkingTree.
File "/usr/lib64/
return control.
File "/usr/lib64/
return format.open(self, _found=True)
File "/usr/lib64/
wt = self._open(
File "/usr/lib64/
branch=
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
<snip> See .bzr.log attached for full back trace.
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
possible_
File "/usr/lib64/
location, possible_
File "/usr/lib64/
_unsupporte
File "/usr/lib64/
find_format, transport, redirected)
File "/usr/lib64/
return action(transport)
File "/usr/lib64/
probers=
File "/usr/lib64/
return prober.
File "/usr/lib64/
raise errors.
File "/usr/lib64/
path = urlutils.
File "/usr/lib64/
path = local_path_
File "/usr/lib64/
url = split_segment_
File "/usr/lib64/
lurl = strip_trailing_
File "/usr/lib64/
scheme_loc, first_path_slash = _find_scheme_
File "/usr/lib64/
m = _url_scheme_
RuntimeError: maximum recursion depth exceeded
bzr 2.6b2 on python 2.7.2.42 (Linux-
2_Duo_
arguments: ['/usr/bin/bzr', 'update', '-r', 'tag:mariadb-
plugins: __builtins_
changelog_
news_
encoding: 'ascii', fsenc: 'ANSI_X3.4-1968', lang: None
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
bzr: warning: some compiled extensions could not be loaded; see <https:/
I don't know if the fix is to remove the recursion, or just increase the max recursion depth threshold before throwing an exception?
Attached is my bzr log file.
Thanks,
Dave.
tags: | added: check-for-breezy |
Apparently this is a real infinite loop bug, because increasing the maximum stack size by adding "sys.setrecursi onlimit( 10000)" to the bzr python script actually still triggers this bug. My now much larger .bzr.log file is attached.
Also, setting it much higher than 10000 results in a segmentation fault, because the stack overflows into the heap.
My computer is too old to run the binary compiled for Ubuntu on my Slackware setup, so I'm stuck with Cpython or pypy 1.9. I don't have enough RAM to compile pypy myself, because a 64bit build needs 4gig, and I only have 4gigs of total ram. pypy's build requirements are insane.
Thanks,
Dave.