[Bug 48482] Star Wars Knights of the Old Republic randomly crashes after failed malloc

WineHQ Bugzilla wine-bugs at winehq.org
Thu Jan 23 13:42:44 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=48482

--- Comment #16 from Federico Dossena <info at fdossena.com> ---
(In reply to Stefan Dösinger from comment #15)
> Use after free should be caught by WINEDEBUG=warn+heap.
> 
> Add some extra ERR lines to HeapAlloc to make sure you're actually getting a
> NULL allocation back. If you do, you can see what the parameters are and why
> it is failing.
> 
> If you suspect use after free you can try to make HeapFree do nothing. You
> might die from out of memory though.
> 
> There are other alloc APIs, most importantly VirtualAlloc and GlobalAlloc.
> But the first one is usually not used for regular work allocations (but e.g.
> for allocating memory for dynamically generated code or hardware I/O) and
> GlobalAlloc is more a Win16 thing if I am not mistaken.

The game seems to use the same malloc and free functions, so I was able to
modify them.

I'm attaching a 7z file containing the diffs files to apply to swkotor.exe to
do the double mallocs and to disable the free function.

The game still crashes at the same location, so I guess it has nothing to do
with memory allocations.
I noticed 2 things however: the crash is always at the end of the loading,
which is where some large textures are allocated and pbuffers are used. This
used to be a problem with Mesa, although they seem to have fixed it over a year
ago. In the terminal it says something about a WGL function being a partial
stub, could this be the problem?

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list