Crash after accessing parts before allocated memory
Marcus Meissner
meissner at suse.de
Fri Nov 18 08:01:57 CST 2016
Hi,
this is really undefined behaviour ... Can you fix the application?
CIao, Marcus
On Thu, Nov 17, 2016 at 06:08:13PM +0100, Fabian Maurer wrote:
> This is a kind-of follow up to "Debugging wine and finding the cause of a
> crash", but another question.
>
> The program I'm debugging works reliably on windows/ReactOS, but on wine it
> crashes every time. I can get it to work by hacking RtlAllocateHeap to always
> allocate 5500 bytes more than needed, but that's hardly a solution.
>
> From what I currently know, the issue stems from a few negative offsets being
> added on a pointer returned from RtlAllocateHeap. On windows this leads to
> accessing a memory region filled with zeroes, on wine it accesses random
> memory. The program can handle nullpointers, but not bogus pointer.
>
> Any ideas how to deal with that, or is UB like that just a no-go? I have zero
> knowledge about the internal management of the heap, so help would be
> appreciated. At least is seems suspicious subtracting something from a pointer
> it got from RtlAllocateHeap, but maybe there's some plan behind it.
>
>
--
Marcus Meissner,SUSE LINUX GmbH; Maxfeldstrasse 5; D-90409 Nuernberg; Zi. 3.1-33,+49-911-740 53-432,,serv=loki,mail=wotan,type=real <meissner at suse.de>
More information about the wine-devel
mailing list