On 9/23/2011 9:23 AM, Martin Pool wrote:
> Hi Adi,
>
> Thanks for the report.
>
> Please attach the traceback from ~/.bzr.log and if possible the run
> with -Dmem_dump.
>
> istr seeing something like this being due to a unix api quirk
> rather than actually being out of memory.
>
> ** Changed in: bzr Importance: Undecided => Medium
>
> ** Changed in: bzr Status: New => Incomplete
>
> ** Tags added: aix memory
>
If it is AIX, my guess is that we are missing a place where
"malloc(0)" returns NULL rather than a pointer like a lot of GNU based
systems. I know we had to fix up some patience-diff code for that case.
Given the traceback, I'm suspecting the create_delta_index_from_delta
code.
/* allocate an array to hold whatever entries we find */
entries = malloc(sizeof(*entry) * max_num_entries);
if (!entries) /* malloc failure */
return DELTA_OUT_OF_MEMORY;
If src->size is less than 17, then that ends up as (16-1) / 16 = 0.
The algorithm still works today, because all the rest of the code just
skips, and doesn't try to assign anything into the entries list.
However, we could just do:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 9/23/2011 9:23 AM, Martin Pool wrote:
> Hi Adi,
>
> Thanks for the report.
>
> Please attach the traceback from ~/.bzr.log and if possible the run
> with -Dmem_dump.
>
> istr seeing something like this being due to a unix api quirk
> rather than actually being out of memory.
>
> ** Changed in: bzr Importance: Undecided => Medium
>
> ** Changed in: bzr Status: New => Incomplete
>
> ** Tags added: aix memory
>
If it is AIX, my guess is that we are missing a place where
"malloc(0)" returns NULL rather than a pointer like a lot of GNU based
systems. I know we had to fix up some patience-diff code for that case.
Given the traceback, I'm suspecting the create_ delta_index_ from_delta
code.
Specifically:
max_num_entries = (src->size - 1) / RABIN_WINDOW;
/* allocate an array to hold whatever entries we find */ sizeof( *entry) * max_num_entries); OF_MEMORY;
entries = malloc(
if (!entries) /* malloc failure */
return DELTA_OUT_
If src->size is less than 17, then that ends up as (16-1) / 16 = 0.
The algorithm still works today, because all the rest of the code just
skips, and doesn't try to assign anything into the entries list.
However, we could just do:
if (max_num_entries == 0) {
*fresh = old_index;
return DELTA_OK;
}
John enigmail. mozdev. org/
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAk5 8XZMACgkQJdeBCY SNAANCkQCffLbMJ 97M6cv+ xA6bOnSAY6oQ HWZ0aj4+ ceiiwoT3J
PggAn3x0i5uvD32
=Q3f4
-----END PGP SIGNATURE-----