[Bf-cycles] bad pointers with recent Cycles standalone build

Mohamed Sakr 3dsakr at gmail.com
Mon Aug 29 11:39:54 CEST 2016


Hi Sergey,

so the problem got fixed after I turned off WITH_CYCLES_DEBUG from CMake.
to clarify what happens when WITH_CYCLES_DEBUG is active:

scene->mutex._Mtx points at the correct memory.
once you enter the function, _Mtx points at a bad memory (16 bytes offset).

this is caused by DeviceScene dscene;

if you add something like:
int anything[4000];
thread_mutex mutex;
int something[4000];

it works..., also SceneParams params; memory is dumbed, so you may check
what cycles debug is doing with memory (a dangling pointer is changing
memory).

thanks again for help.

cheers,
Mohamed Sakr

On Mon, Aug 29, 2016 at 9:45 AM, Sergey Sharybin <sergey.vfx at gmail.com>
wrote:

> Hi,
>
> Several points:
>
> 1. Such errors are really difficult to give any meaningful suggestions
> unless they are reproducable with official builds (like Blender). There are
> lots of possibilities here starting from real issue in the code ending with
> wrongly compiled dependencies.
>
> 2. There are fixes which were synchronized to standalone repo this morning
> which solves some known crashes in subd code.
>
> 3. If that's recently introduced error you can easily isect the sources
> and find out a buggy commit, so we can have a closer look on it.
>
> On Mon, Aug 29, 2016 at 9:35 AM, Mohamed Sakr <3dsakr at gmail.com> wrote:
>
>> Hi,
>>
>> I just grabbed the most recent build (18/8), I'm on Windows 10, VS2013,
>> C++11
>> there is a decent bug with the scene->mutex. (actually the bug is caused
>> by the member DeviceScene dscene;)
>>
>> old build was running fine, new build got a problem which I'll explain
>>
>> what happens:
>> memory is fine, so at any point in my DLL, if I check scene->mutex,
>> memory is correct.
>> now the problem comes when I try to access it:
>>
>> if (_session && _session->scene && _session->ready_to_reset() &&
>> _session->scene->mutex.try_lock())
>>
>> here, scene->mutex.try_lock(), inside the function call, the mutex
>> pointer is WRONG.
>>
>> after debugging, pointer is shifted by 2 indices (16 bytes)
>>
>> so outside the function, (scene->mutex._Mtx) is correct
>> inside the function, *(&_Mtx + 2) is correct
>>
>> _Mtx alone is a corrupted memory, showing 0x0000...1
>>
>> any ideas?
>>
>> cheers,
>> Mohamed Sakr
>>
>> _______________________________________________
>> Bf-cycles mailing list
>> Bf-cycles at blender.org
>> https://lists.blender.org/mailman/listinfo/bf-cycles
>>
>>
>
>
> --
> With best regards, Sergey Sharybin
>
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> https://lists.blender.org/mailman/listinfo/bf-cycles
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20160829/774d793b/attachment.htm 


More information about the Bf-cycles mailing list