[bitbake-devel] [PATCH] codeparser: Use hashlib for hashing, not hash()

akuster akuster at mvista.com
Wed Sep 28 15:25:37 UTC 2016



On 09/28/2016 08:14 AM, Richard Purdie wrote:
> On Wed, 2016-09-28 at 08:06 -0700, Armin Kuster wrote:
>> From: Richard Purdie <richard.purdie at linuxfoundation.org>
>>
>> "hash() is randomised by default each time you start a new instance
>> of
>> recent
>> versions (Python3.3+) to prevent dictionary insertion DOS attacks"
>>
>> which means we need to use hashlib.md5 to get consistent values for
>> the codeparser cache under python 3. Prior to this, the codeparser
>> cache was effectively useless under python3 as shown by performance
>> regressions.
>>
>> Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
>> (cherry picked from commit 12d43cf45ba48e3587392f15315d92a1a53482ef)
>>
>> We kept running into an issue where shell scripts were not
>> getting generated on 32bit hosts. It seemed to be caused by this
>> code.
> I'm puzzled. This patch is in master. I'm therefore assuming you're
> suggesting this for 1.30 but it doesn't say that anywhere.

We made a similar change in our bitbake sources for 1.28 which needed to 
be submitted per the Yocto compatible requirements.   I could have sent 
that one but then you might have said "Hey, this looks like the one in 
Master, why are you not using that one?".   I personally like to 
reference upstream official fixes than hand crafted ones that achieve 
the same result. I can send you the one we did if you want.

>
> 1.30 isn't python3 based and therefore doesn't have the problem
> described above?

This fixed an issue we found building on 32bit hosts.

- Armin
>
> Cheers,
>
> Richard
>




More information about the bitbake-devel mailing list