Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 08 Oct 2012 18:35:22 -0300
From: Claudio André <>
Subject: Re: Memory leak in most OpenCL formats

Em 08-10-2012 18:01, magnum escreveu:
> On 8 Oct, 2012, at 20:04 , magnum <> wrote:
>> I found a nasty bug today that affects all OpenCL formats that use the shared find_best_workgroup() function. The bug is present in numerous formats in the released Jumbo-6 (I think) and Jumbo-7 (definitely). The fix (in each of those formats) is this:
> ...
>> BTW, maybe there are better ways to handle this than the quick'n'dirty fix I made: I suppose we could change the global profilingEvent into *profilingEvent and do something like this in common-opencl:
>> opencl_find_best_workgroup(args)
>> {
>> 	cl_event benchEvent;
>> 	profilingEvent = &benchEvent
>> 	...
>> 	(do the find_best stuff)
>> 	...
>> 	profilingEvent = NULL;
>> }
>> Then it would point to a valid event during find_best() and then set to NULL during actual cracking, with no need to release anything for each crypt_all(). Theoretically this is cleaner but we'd still need to patch all 22 formats, changing &profilingEvent into just profilingEvent.
> The last part of the above became clear to me as I wrote that mail :)  And obviously that solutions is much cleaner, and potentially faster (events are never even created when not needed). So I have now committed another patch that reverted the first one and implemented the pointer version instead. Works like a champ.

It is much cleaner indeed.

> Claudio, this second fix removes the memory leak for your sha2crypt formats too, but they still are somewhat broken since you implemented split kernels, as the shared function can only handle one event and in your case that is currently clEnqueueReadBuffer()... nothing else is measured!

Agree. I will revert to the previous find_best_workgroup approach!


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.