Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Troubleshoot OS Lock-up

Reply
 
Old 05-27-2009   #1 (permalink)
eschneider


 
 

Troubleshoot OS Lock-up

Hello,

I'm looking for some help on troublehooting a OS Lock-up issue. I can
reproduce the problem in my large solution, but I'm currently unable to
create a small reproducable sample to submit to anyone else.

I plan to try a Win debug dump tonight.
I have tried the Managed Stack Explorer, but it does not run on Vista Home
Premium.

This is related to:
microsoft.public.dotnet.framework.drawing: DrawReversibleLine issues in
Vista


Thanks,
Eric Schneider


My System SpecsSystem Spec
Old 05-28-2009   #2 (permalink)
Jie Wang [MSFT]


 
 

RE: Troubleshoot OS Lock-up

Hi Eric,

The DrawReversibleLine method simply calls Windows GDI APIs to have its
task done. Looks like this:

[UIPermission(SecurityAction.LinkDemand,
Window=UIPermissionWindow.AllWindows)]
public static void DrawReversibleLine(Point start, Point end, Color
backColor)
{
int nDrawMode = GetColorRop(backColor, 10, 7);
IntPtr handle = UnsafeNativeMethods.GetDCEx(new HandleRef(null,
UnsafeNativeMethods.GetDesktopWindow()), NativeMethods.NullHandleRef,
0x403);
IntPtr ptr2 = SafeNativeMethods.CreatePen(0, 1,
ColorTranslator.ToWin32(backColor));
int num2 = SafeNativeMethods.SetROP2(new HandleRef(null, handle),
nDrawMode);
IntPtr ptr3 = SafeNativeMethods.SelectObject(new HandleRef(null,
handle), new HandleRef(null, UnsafeNativeMethods.GetStockObject(5)));
IntPtr ptr4 = SafeNativeMethods.SelectObject(new HandleRef(null,
handle), new HandleRef(null, ptr2));
SafeNativeMethods.MoveToEx(new HandleRef(null, handle), start.X,
start.Y, null);
SafeNativeMethods.LineTo(new HandleRef(null, handle), end.X, end.Y);
SafeNativeMethods.SetROP2(new HandleRef(null, handle), num2);
SafeNativeMethods.SelectObject(new HandleRef(null, handle), new
HandleRef(null, ptr3));
SafeNativeMethods.SelectObject(new HandleRef(null, handle), new
HandleRef(null, ptr4));
SafeNativeMethods.DeleteObject(new HandleRef(null, ptr2));
UnsafeNativeMethods.ReleaseDC(NativeMethods.NullHandleRef, new
HandleRef(null, handle));
}

And the Splitter control uses a similar approach to draw the splitter (GDI
function PatBlt).

If you're familiar with some other unmanaged language (VB6 or C++), you can
try call these functions in the exactly the same way to simulate the same
task you want to do in your project, and see if the machine still gets
hung. This way you may be able to narrow down the problem - to see if this
is .NET specific or it is in GDI.

The problem could also be caused by the video driver (I've seen cases where
app got hung/crash while doing certain graphic operations, and the problem
gone after upgrading/downgrading the video driver). Especially if this
problem only happens on a single machine or on machines with the same
hardware/driver configuration but not reproducable on other machines.

So could you let me know whether or not the problem is reproducable on all
Vista machines with different graphic cards/drivers? If you don't have
spare machines to test, you can also try on a virtual machine.

Waiting for more information.

Regards,

Jie Wang (jiewan@xxxxxx, remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxx.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

My System SpecsSystem Spec
Old 06-02-2009   #3 (permalink)
eschneider


 
 

Re: Troubleshoot OS Lock-up

It is not that simple of a WIN 32API call, there are a lot of other objects
involved, most of which are private classes.

I have tried to update the video card drivers, no help.
How could I prove it's a driver issue? Then at least I could submit a bug to
ATI.

I can not reproduce this issue on any other machine yet. Currently using a
laptop.

Toshiba L355D-S7901
ATI Radeon 3100
Driver:
4/22/2008
8.479.0.0

I tried the newer driver "9-5_vista64_win7_64_dd" , it failed also.

It had windows home premium, thought maybe it was a bad os image so now I
have installed Vista Ultimate.

Eric


""Jie Wang [MSFT]"" <jiewan@xxxxxx> wrote in message
news:A0jpsO33JHA.2064@xxxxxx
Quote:

> Hi Eric,
>
> The DrawReversibleLine method simply calls Windows GDI APIs to have its
> task done. Looks like this:
>
> [UIPermission(SecurityAction.LinkDemand,
> Window=UIPermissionWindow.AllWindows)]
> public static void DrawReversibleLine(Point start, Point end, Color
> backColor)
> {
> int nDrawMode = GetColorRop(backColor, 10, 7);
> IntPtr handle = UnsafeNativeMethods.GetDCEx(new HandleRef(null,
> UnsafeNativeMethods.GetDesktopWindow()), NativeMethods.NullHandleRef,
> 0x403);
> IntPtr ptr2 = SafeNativeMethods.CreatePen(0, 1,
> ColorTranslator.ToWin32(backColor));
> int num2 = SafeNativeMethods.SetROP2(new HandleRef(null, handle),
> nDrawMode);
> IntPtr ptr3 = SafeNativeMethods.SelectObject(new HandleRef(null,
> handle), new HandleRef(null, UnsafeNativeMethods.GetStockObject(5)));
> IntPtr ptr4 = SafeNativeMethods.SelectObject(new HandleRef(null,
> handle), new HandleRef(null, ptr2));
> SafeNativeMethods.MoveToEx(new HandleRef(null, handle), start.X,
> start.Y, null);
> SafeNativeMethods.LineTo(new HandleRef(null, handle), end.X, end.Y);
> SafeNativeMethods.SetROP2(new HandleRef(null, handle), num2);
> SafeNativeMethods.SelectObject(new HandleRef(null, handle), new
> HandleRef(null, ptr3));
> SafeNativeMethods.SelectObject(new HandleRef(null, handle), new
> HandleRef(null, ptr4));
> SafeNativeMethods.DeleteObject(new HandleRef(null, ptr2));
> UnsafeNativeMethods.ReleaseDC(NativeMethods.NullHandleRef, new
> HandleRef(null, handle));
> }
>
> And the Splitter control uses a similar approach to draw the splitter (GDI
> function PatBlt).
>
> If you're familiar with some other unmanaged language (VB6 or C++), you
> can
> try call these functions in the exactly the same way to simulate the same
> task you want to do in your project, and see if the machine still gets
> hung. This way you may be able to narrow down the problem - to see if this
> is .NET specific or it is in GDI.
>
> The problem could also be caused by the video driver (I've seen cases
> where
> app got hung/crash while doing certain graphic operations, and the problem
> gone after upgrading/downgrading the video driver). Especially if this
> problem only happens on a single machine or on machines with the same
> hardware/driver configuration but not reproducable on other machines.
>
> So could you let me know whether or not the problem is reproducable on all
> Vista machines with different graphic cards/drivers? If you don't have
> spare machines to test, you can also try on a virtual machine.
>
> Waiting for more information.
>
> Regards,
>
> Jie Wang (jiewan@xxxxxx, remove 'online.')
>
> Microsoft Online Community Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@xxxxxx.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/en-us/subs...#notifications.
>
> Note: MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 2 business days is acceptable. Please note that each
> follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions. Issues of this
> nature are best handled working with a dedicated Microsoft Support
> Engineer
> by contacting Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
My System SpecsSystem Spec
Old 06-03-2009   #4 (permalink)
eschneider


 
 

Re: Troubleshoot OS Lock-up

It crashes on the SafeNativeMethods.MoveToEx(new HandleRef(null, handle),
start.X, start.Y, null);

I have a trace before every call, that is the only way I know. I have no
error message since it locks the whole system.



""Jie Wang [MSFT]"" <jiewan@xxxxxx> wrote in message
news:A0jpsO33JHA.2064@xxxxxx
Quote:

> Hi Eric,
>
> The DrawReversibleLine method simply calls Windows GDI APIs to have its
> task done. Looks like this:
>
> [UIPermission(SecurityAction.LinkDemand,
> Window=UIPermissionWindow.AllWindows)]
> public static void DrawReversibleLine(Point start, Point end, Color
> backColor)
> {
> int nDrawMode = GetColorRop(backColor, 10, 7);
> IntPtr handle = UnsafeNativeMethods.GetDCEx(new HandleRef(null,
> UnsafeNativeMethods.GetDesktopWindow()), NativeMethods.NullHandleRef,
> 0x403);
> IntPtr ptr2 = SafeNativeMethods.CreatePen(0, 1,
> ColorTranslator.ToWin32(backColor));
> int num2 = SafeNativeMethods.SetROP2(new HandleRef(null, handle),
> nDrawMode);
> IntPtr ptr3 = SafeNativeMethods.SelectObject(new HandleRef(null,
> handle), new HandleRef(null, UnsafeNativeMethods.GetStockObject(5)));
> IntPtr ptr4 = SafeNativeMethods.SelectObject(new HandleRef(null,
> handle), new HandleRef(null, ptr2));
> SafeNativeMethods.MoveToEx(new HandleRef(null, handle), start.X,
> start.Y, null);
> SafeNativeMethods.LineTo(new HandleRef(null, handle), end.X, end.Y);
> SafeNativeMethods.SetROP2(new HandleRef(null, handle), num2);
> SafeNativeMethods.SelectObject(new HandleRef(null, handle), new
> HandleRef(null, ptr3));
> SafeNativeMethods.SelectObject(new HandleRef(null, handle), new
> HandleRef(null, ptr4));
> SafeNativeMethods.DeleteObject(new HandleRef(null, ptr2));
> UnsafeNativeMethods.ReleaseDC(NativeMethods.NullHandleRef, new
> HandleRef(null, handle));
> }
>
> And the Splitter control uses a similar approach to draw the splitter (GDI
> function PatBlt).
>
> If you're familiar with some other unmanaged language (VB6 or C++), you
> can
> try call these functions in the exactly the same way to simulate the same
> task you want to do in your project, and see if the machine still gets
> hung. This way you may be able to narrow down the problem - to see if this
> is .NET specific or it is in GDI.
>
> The problem could also be caused by the video driver (I've seen cases
> where
> app got hung/crash while doing certain graphic operations, and the problem
> gone after upgrading/downgrading the video driver). Especially if this
> problem only happens on a single machine or on machines with the same
> hardware/driver configuration but not reproducable on other machines.
>
> So could you let me know whether or not the problem is reproducable on all
> Vista machines with different graphic cards/drivers? If you don't have
> spare machines to test, you can also try on a virtual machine.
>
> Waiting for more information.
>
> Regards,
>
> Jie Wang (jiewan@xxxxxx, remove 'online.')
>
> Microsoft Online Community Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@xxxxxx.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/en-us/subs...#notifications.
>
> Note: MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 2 business days is acceptable. Please note that each
> follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions. Issues of this
> nature are best handled working with a dedicated Microsoft Support
> Engineer
> by contacting Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
My System SpecsSystem Spec
Old 06-04-2009   #5 (permalink)
Jie Wang [MSFT]


 
 

Re: Troubleshoot OS Lock-up

Hi Eric,

What are the coordinates you passed to the DrawReversibleLine?

After doing some research, I found it is known that the max delta
MoveTo(Ex) & LineTo can accept is 2^27, reaching or exceeding this number,
the DrawReversibleLine just silently fails on my machines (from XP, Vista
to 7), but never hang the machine.

Another way to narrow down the problem is to use the default VGA graphics
driver provided by Windows itself, then run the program, will that also
hang the machine?

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxx.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Notification area/ How to get rid of Caps Lock, Scroll Lock Vista General
troubleshoot Vista installation & setup
CAPS lock / SHIFT lock difficulty Vista General
How troubleshoot DRV E: ? Vista General
Troubleshoot-reinstall Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46