FWIW, this doesn't seem to have fixed my problem. I cobbled together and installed a dulwich package to try this out (lp:~jelmer/dulwich/debian r199, with r226 of http://people.samba.org/bzr/jelmer/dulwich/trunk/ applied on top of this; also lp:~bzr/bzr-git/trunk r340 since that seems to be the most recent version that works with the version of bzr I have). I also made a change similar to Ivan's above to print out the parameters passed to mmap.mmap(). The result was as follows: $ bzr get git://git.kernel.org/pub/scm/linux/hotplug/udev.git /usr/lib/python2.6/dist-packages/dulwich/objects.py:25: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha 6 4517536 1 0 ] git: Total 24442 (delta 13944), reused 24183 (delta 13760) 0 6 4056275 1 112 bzr: ERROR: mmap.error: [Errno 22] Invalid argument Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 716, in exception_to_return_code return the_callable(*args, **kwargs) File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 911, in run_bzr ret = run(*run_argv) File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 547, in run_argv_aliases return self.run(**all_cmd_args) File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 1100, in run source_branch=br_from) File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 1134, in sprout result_repo.fetch(source_repository, fetch_spec=fetch_spec) File "/usr/lib/python2.6/dist-packages/bzrlib/repository.py", line 1133, in fetch find_ghosts=find_ghosts, fetch_spec=fetch_spec) File "/home/cjwatson/.bazaar/plugins/git/fetch.py", line 353, in fetch mapping=mapping, fetch_spec=fetch_spec) File "/home/cjwatson/.bazaar/plugins/git/fetch.py", line 373, in fetch_refs self.fetch_objects(determine_wants, mapping, pb) File "/home/cjwatson/.bazaar/plugins/git/fetch.py", line 408, in fetch_objects target_git_object_retriever, recorded_wants, pb) File "/home/cjwatson/.bazaar/plugins/git/fetch.py", line 278, in import_git_objects o = object_iter[head] File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 953, in __getitem__ type, uncomp = self.get_raw(sha1) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 943, in get_raw offset = self.idx.object_index(sha1) File "/home/cjwatson/.bazaar/plugins/git/remote.py", line 192, in idx self._data.create_index_v2(self._idx_path, self.resolve_ext_ref) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 551, in create_index_v2 entries = self.sorted_entries(resolve_ext_ref) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 542, in sorted_entries ret = list(self.iterentries(resolve_ext_ref)) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 529, in iterentries type, obj = self.resolve_object(offset, type, obj, get_ref_text) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 480, in resolve_object type, base_obj = get_offset(base_offset) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 572, in get_object_at map, map_offset = simple_mmap(self._file, offset, self._size-offset) File "/usr/lib/python2.6/dist-packages/dulwich/pack.py", line 113, in simple_mmap offset=int(offset / mmap.ALLOCATIONGRANULARITY)), error: [Errno 22] Invalid argument bzr 1.13.1 on python 2.6.2 (linux2) arguments: ['/usr/bin/bzr', 'get', 'git://git.kernel.org/pub/scm/linux/hotplug/udev.git'] encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8' plugins: bazimport /home/cjwatson/.bazaar/plugins/bazimport [1.6] builddeb /usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb [unknown] bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [1.13] cia /usr/lib/python2.6/dist-packages/bzrlib/plugins/cia [1.0dev] cvsps_import /usr/lib/python2.6/dist-packages/bzrlib/plugins/cvsps_import [unknown] fastimport /home/cjwatson/.bazaar/plugins/fastimport [unknown] git /home/cjwatson/.bazaar/plugins/git [0.2dev] gtk /usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk [0.96.0.dev.1] launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [unknown] netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [unknown] push_and_update /home/cjwatson/.bazaar/plugins/push_and_update [0.2dev] push_fix /home/cjwatson/.bazaar/plugins/push_fix [unknown] rebase /usr/lib/python2.6/dist-packages/bzrlib/plugins/rebase [0.4.4] vimdiff /home/cjwatson/.bazaar/plugins/vimdiff [unknown] *** Bazaar has encountered an internal error. Please report a bug at https://bugs.launchpad.net/bzr/+filebug including this traceback, and a description of what you were doing when the error occurred.