Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

Update 2: The Silverlight team at Microsoft was able to reproduce the bug, and it has been entered in the bug database. Thanks all for your precious help!!

Update: Apparently this bug is not consistently reproducible. If you get the bug, please enter a comment with your system information. I was able to reproduce on a number of machines and OS, but on some other PCs it works just fine.

Here is an interesting one:

<UserControl x:Class="GalaSoft.SL.ScrollViewerNoCrash.Page" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300"> <Grid x:Name="LayoutRoot" Background="Green"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition /> </Grid.RowDefinitions> <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"> <StackPanel Orientation="Horizontal" Height="150"> <Border Margin="10,5,10,5" BorderBrush="#FFA9A899" BorderThickness="2,2,2,2"> <Image Source="pic1.png" Stretch="Fill" /> </Border> <Border Margin="10,5,10,5" BorderBrush="#FFA9A899" BorderThickness="2,2,2,2"> <Image Source="pic2.jpg" Stretch="Fill" /> </Border> </StackPanel> </ScrollViewer> </Grid> </UserControl>

The code above crashes both Internet Explorer and Firefox (on Windows) when you resize the browser window to let the horizontal scrollbar appear in the scrollviewer. I didn't test other platforms.

On the other hand, the following code works:

<UserControl x:Class="GalaSoft.SL.ScrollViewerCrash.Page" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300"> <Grid x:Name="LayoutRoot" Background="Red"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="150" /> </Grid.RowDefinitions> <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"> <StackPanel Orientation="Horizontal"> <Border Margin="10,5,10,5" BorderBrush="#FFA9A899" BorderThickness="2,2,2,2"> <Image Source="pic1.png" Stretch="Fill" /> </Border> <Border Margin="10,5,10,5" BorderBrush="#FFA9A899" BorderThickness="2,2,2,2"> <Image Source="pic2.jpg" Stretch="Fill" /> </Border> </StackPanel> </ScrollViewer> </Grid> </UserControl>

Did you spot the difference? The first Grid (the one that crashes) has the second row's height set to 150, while the ScrollViewer and its children are all set to Auto. In the second one (the one that works), the Grid is set to Auto, while the StackPanel inside the ScrollViewer has its Height set to 150. The workaround is good enough for now, but I hope it'll get corrected because I like to layout my grids and then let the auto layout take care of the rest.

Note that both versions work fine in WPF.

Resources
  • Test the crash and non-crash case.
  • Download the source code.
Print | posted on Monday, March 31, 2008 10:58 PM

Feedback

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Luke at 4/1/2008 12:42 AM Gravatar
It does not crash on Polish Windows XP and IE 7...

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Excel Dashboard at 4/1/2008 7:09 AM Gravatar
Thanks, really helped me

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Laurent at 4/1/2008 9:04 AM Gravatar
@Luke: Thanks for the feedback. What system do you have?

@Excel Dashboard: Are you able to reproduce the crash? What system do you have?

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Toby at 4/1/2008 12:48 PM Gravatar
So it crashes on my system, although i only tested it so far with firefox.

My system is:
Windows XP-64bit SP2
Firefox Portable v2.0.0.11

that should sum it up, huh?

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Tom at 4/1/2008 5:01 PM Gravatar
I tried it on two systems and in all cases it caused the browser to hang using max CPU as soon as the scrollbar should have been displayed. I never got a crash - just a hang.

System 1: Vista 32-bit, Firefox 2.0.0.13, IE7
System 2: XP SP2, Firefox 2.0.0.13, IE6

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Laurent at 4/1/2008 7:50 PM Gravatar
Hi Tom,

Thanks for the feedback. To be precise, my browser also hangs, and it's not a crash. I should have been more precise.

Greetings,
Laurent

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Rodney Reid at 4/2/2008 4:07 AM Gravatar
Laurent,

The crash version didn't crash at first, but I tried to maximize it and it's just hanging now.

System: Dell 9400 laptop, 2gb ram, running XP SP3 v.3311

Browser: IE 8 beta 1 (8.6001.17184)

I brought up process explorer on it. IEFrame.DLL is taking 100% of one core.

For what it's worth, the stack frame is:

ntkrnlpa.exe!KiUnexpectedInterrupt+0x121
ntkrnlpa.exe!ZwYieldExecution+0x1c8e
hal.dll+0x2ef2
agcore.dll!ConvertYV12toARGB+0x18cfa
agcore.dll!ConvertYV12toARGB+0x18bbd
agcore.dll!ConvertYV12toARGB+0x1893f
agcore.dll!SetFrameworkCallbacks+0x780e
agcore.dll!FrameworkElement_MeasureOverride+0xa4
agcore.dll!FrameworkElement_MeasureOverride+0x5f
coreclr.dll+0x1a22
coreclr.dll+0x7ef48
coreclr.dll+0x7efa0
coreclr.dll+0x7f049
coreclr.dll+0x7eee2
agcore.dll!ConvertYV12toARGB+0x18cfa
agcore.dll!ConvertYV12toARGB+0x18bbd
agcore.dll!ConvertYV12toARGB+0x1893f
agcore.dll!SetFrameworkCallbacks+0x780e
agcore.dll!ConvertYV12toARGB+0x1911c
agcore.dll!Application_GetCurrent+0x2cfd
agcore.dll!Application_GetCurrent+0x2e9f
npctrl.dll+0xabb0
npctrl.dll!DllGetClassObject+0xc2c4
npctrl.dll!DllGetClassObject+0xc320
npctrl.dll!DllGetClassObject+0xc379
npctrl.dll!DllGetClassObject+0xc3eb
npctrl.dll!DllGetClassObject+0xc0e2
npctrl.dll!DllGetClassObject+0xcaae
npctrl.dll!DllGetClassObject+0xcae3
npctrl.dll!DllGetClassObject+0xc8c8
npctrl.dll!DllGetClassObject+0xc9bd
USER32.dll!GetDC+0x6d
USER32.dll!GetDC+0x14f
USER32.dll!DefWindowProcW+0x184
USER32.dll!DefWindowProcW+0x1d0
ntdll.dll!KiUserCallbackDispatcher+0x13
USER32.dll!DispatchMessageW+0xf
IEFRAME.dll!Ordinal160+0xbcac
IEFRAME.dll!IEGetWriteableHKCU+0xbefd
IEFRAME.dll!Ordinal141+0x1392
kernel32.dll!GetModuleFileNameA+0x1

HTH,

...Rodney

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Laurent at 4/2/2008 9:03 AM Gravatar
Hi Rodney,

Thanks a lot. For info, Microsoft can now repro the bug and has logged it in the bug database.

Thanks all,
Laurent

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Luke at 4/3/2008 2:30 PM Gravatar
I have Polish Windows XP SP2 32-bit and Polish IE7 with all updates applied.
And It's strange because when I run it second time it hanged.

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Mike at 6/3/2008 8:00 AM Gravatar
Silverlight 1.0 kept crashing IE7 on Win 2003 SP2. I installed Silverlight 2.0 Beta 1. It crashed on silverlight.net website and in the Eventviewer, I see error like this:

Faulting application iexplore.exe, version 7.0.6000.16640, faulting module ntdll.dll, version 5.2.3790.3959, fault address 0x0001975e.

# re: Silverlight 2 beta 1: ScrollViewer with auto-layout crashes both IE and FF

left by Laurent at 6/3/2008 11:42 AM Gravatar
Hi Mike,

I think you should report the bug to Microsoft, since it seems to be consistently reproducible. A good way is to report the bug in the Silverlight.net forums, or on the Microsoft Connect website.

Greetings,
Laurent
Title  
Name
Email (never displayed)
Url
Comments   
Please add 3 and 6 and type the answer here: