[ros-kernel] "My Computer" crash
Jason Filby
jasonfilby at yahoo.com
Wed Feb 18 01:24:14 CET 2004
Great work Ge! I'm sure that's been a source of other problems too.
Also - ReactOS seems to be far snappier since I last built it several
hours ago?
There also seems to be a new bug relating to focus/activation: I
can't
click on the Start button. In fact, the only thing that works now is
opening My Computer - I can't click menus or any of the drive icons -
in
fact - it seems that the Explorer window loses focus. The only recent
commit that seems as though it may be related is a fix to search
backwards in winpos.c by Thomas. I may be wrong about this, but it's
the
first thing that comes to mind.
Cheers
Jason
Ge van Geldorp wrote:
>When double-clicking on "My Computer" in VMware, Explorer would
often
>
>crash, shutting down the system. I finally tracked it down to
>
>HeapAlloc() not always returning 8-byte aligned blocks (sometimes it
>
>would return blocks at xxxxxxx4 or xxxxxxxC). This causes
>
>Local/GlobalAlloc to misbehave. Someone before me already tried to
fix
>
>it:
>
>
>
> phandle = RtlAllocateHeap(GetProcessHeap(), 0,
>
>sizeof(GLOBAL_HANDLE));
>
> /* This little hack is to make sure that we get a pointer with
8-byte
>
> ** alignment.
>
> ** Fixme: When we are sure all allocations are 8-byte aligned,
>
> ** we can remove this hack.
>
> */
>
> if (ISPOINTER(INTERN_TO_HANDLE(phandle)))
>
> {
>
> hack_fix = RtlAllocateHeap(GetProcessHeap(), 0,
>
>sizeof(GLOBAL_HANDLE));
>
> RtlFreeHeap(GetProcessHeap(), 0, phandle);
>
> phandle = hack_fix;
>
> }
>
>
>
>Unfortunately, the 2nd call to RtlAllocateHeap() was not guaranteed
to
>
>return an 8-byte aligned block either. The end result was that
>
>GlobalAlloc returned what looked like a pointer while in reality it
was
>
>a handle. Via a series of 4 memory overwrites this finally caused
the
>
>crash. A small debugging nightmare I might add.
>
>
>
>Normally, I wouldn't bother y'all with this. However, I fixed it by
>
>adjusting some structures in reactos/lib/ntdll/rtl/heap.c and making
a
>
>change to one of these low-level memory allocation routines while
we're
>
>in a freeze period makes me feel slightly uneasy. OTOH, the problem
in
>
>my opinion was seriously enough to need a fix ASAP.
>
>
>
>Gé van Geldorp.
>
>
>
>
>
>_______________________________________________
>
>Ros-kernel mailing list
>
>Ros-kernel at reactos.com
>
>http://reactos.com/mailman/listinfo/ros-kernel
>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
More information about the Ros-kernel
mailing list