Closed Bug 623606 Opened 11 years ago Closed 11 years ago

Crash [@ nsDisplayClip::nsDisplayClip ] when dragging selected text

Categories

(Core :: Layout, defect)

x86
All
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: scoobidiver, Assigned: tnikkel)

References

Details

(Keywords: crash, regression)

Crash Data

Attachments

(2 files)

It is a new crash signature that first appears in 4.0b9pre/20110106.
It happens on Linux and Mac OS X.
It is probably a regression from bug 615794.

Signature	nsDisplayClip::nsDisplayClip
UUID	8bf15215-e776-4d6a-852a-e54722110106
Time 	2011-01-06 07:13:07.72300
Uptime	2095
Install Age	3035 seconds (50.6 minutes) since version was first installed.
Product	Firefox
Version	4.0b9pre
Build ID	20110106030349
Branch	2.0
OS	Linux
OS Version	0.0.0 Linux 2.6.35.10-74.fc14.i686 #1 SMP Thu Dec 23 16:17:40 UTC 2010 i686
CPU	x86
CPU Info	GenuineIntel family 6 model 23 stepping 6
Crash Reason	SIGSEGV
Crash Address	0x8

Frame 	Module 	Signature [Expand] 	Source
0 	libxul.so 	nsDisplayClip::nsDisplayClip 	nsIPresShell.h:269
1 	libxul.so 	PresShell::ClipListToRange 	nsPresShell.cpp:5468
2 	libxul.so 	PresShell::CreateRangePaintInfo 	nsPresShell.cpp:5584
3 	libxul.so 	PresShell::RenderSelection 	nsPresShell.cpp:5799
4 	libxul.so 	nsBaseDragService::DrawDrag 	nsBaseDragService.cpp:498
5 	libxul.so 	nsDragService::InvokeDragSession 	nsDragService.cpp:248
6 	libxul.so 	nsBaseDragService::InvokeDragSessionWithSelection 	nsBaseDragService.cpp:318
7 	libxul.so 	nsEventStateManager::DoDefaultDragStart 	nsEventStateManager.cpp:2310
8 	libxul.so 	nsEventStateManager::GenerateDragGesture 	nsEventStateManager.cpp:2092
9 	libxul.so 	nsEventStateManager::PreHandleEvent 	nsEventStateManager.cpp:1170
10 	libxul.so 	PresShell::HandleEventInternal 	nsPresShell.cpp:6937
11 	libxul.so 	PresShell::HandlePositionedEvent 	nsPresShell.cpp:6788
12 	libxul.so 	PresShell::HandleEvent 	nsPresShell.cpp:6638
13 	libxul.so 	nsViewManager::HandleEvent 	nsViewManager.cpp:1092
14 	libxul.so 	nsViewManager::DispatchEvent 	nsViewManager.cpp:1070
15 	libxul.so 	HandleEvent 	nsView.cpp:161
16 	libxul.so 	nsWindow::DispatchEvent 	nsWindow.cpp:571
17 	libxul.so 	nsWindow::OnMotionNotifyEvent 	nsWindow.cpp:2613
18 	libxul.so 	motion_notify_event_cb 	nsWindow.cpp:5644
19 	libgtk-x11-2.0.so.0.2200.0 	libgtk-x11-2.0.so.0.2200.0@0x14b717 	
20 	libgobject-2.0.so.0.2600.0 	libgobject-2.0.so.0.2600.0@0xbbe2 	
21 	libgobject-2.0.so.0.2600.0 	libgobject-2.0.so.0.2600.0@0x1e0ef 	
22 	libgobject-2.0.so.0.2600.0 	libgobject-2.0.so.0.2600.0@0x26fcc 	
23 	libgobject-2.0.so.0.2600.0 	libgobject-2.0.so.0.2600.0@0x27402 	
24 	libgtk-x11-2.0.so.0.2200.0 	libgtk-x11-2.0.so.0.2200.0@0x29bb1d 	
25 	libgtk-x11-2.0.so.0.2200.0 	libgtk-x11-2.0.so.0.2200.0@0x149444 	
26 	libgtk-x11-2.0.so.0.2200.0 	libgtk-x11-2.0.so.0.2200.0@0x149856 	
27 	libgdk-x11-2.0.so.0.2200.0 	libgdk-x11-2.0.so.0.2200.0@0x5c38a 	
28 	libglib-2.0.so.0.2600.0 	libglib-2.0.so.0.2600.0@0x40191 	
29 	libglib-2.0.so.0.2600.0 	libglib-2.0.so.0.2600.0@0x40977 	
30 	libglib-2.0.so.0.2600.0 	libglib-2.0.so.0.2600.0@0x40c34 	
31 	libxul.so 	nsAppShell::ProcessNextNativeEvent 	nsAppShell.cpp:144
32 	libxul.so 	nsBaseAppShell::DoProcessNextNativeEvent 	nsBaseAppShell.cpp:173
33 	libxul.so 	nsBaseAppShell::OnProcessNextEvent 	nsBaseAppShell.cpp:333
34 	libxul.so 	nsThread::ProcessNextEvent 	nsThread.cpp:597
35 	libxul.so 	NS_ProcessNextEvent_P 	nsThreadUtils.cpp:250
36 	libxul.so 	mozilla::ipc::MessagePump::Run 	MessagePump.cpp:134
37 	libxul.so 	MessageLoop::RunInternal 	message_loop.cc:219
38 	libxul.so 	MessageLoop::Run 	message_loop.cc:202
39 	libxul.so 	nsBaseAppShell::Run 	nsBaseAppShell.cpp:192
40 	libxul.so 	nsAppStartup::Run 	nsAppStartup.cpp:191
41 		@0x23b011b 	
42 	libxul.so 	XRE_main 	nsAppRunner.cpp:3695
43 	firefox-bin 	main 	nsBrowserApp.cpp:158
44 	libc-2.12.90.so 	libc-2.12.90.so@0x16e15 	
45 	firefox-bin 	firefox-bin@0x1390 	
46 	firefox-bin 	Output 	nsBrowserApp.cpp:77
47 		@0x0 	

More reports at:
http://crash-stats.mozilla.com/report/list?product=Firefox&query_search=signature&query_type=exact&query=&range_value=4&range_unit=weeks&hang_type=any&process_type=any&plugin_field=&plugin_query_type=&plugin_query=&do_query=1&admin=&signature=nsDisplayClip%3A%3AnsDisplayClip
blocking2.0: --- → ?
It is currently #2 top crasher in today's build.
Assignee: nobody → tnikkel
Easy to reproduce on Linux. Load page, select some text and try to drag it - immediate crash.
Updating summary per comment 2. (Confirmed those STR myself.)
Summary: Crash [@ nsDisplayClip::nsDisplayClip ] → Crash [@ nsDisplayClip::nsDisplayClip ] when selecting & dragging text
Duplicate of this bug: 623683
Summary: Crash [@ nsDisplayClip::nsDisplayClip ] when selecting & dragging text → Crash [@ nsDisplayClip::nsDisplayClip ] when dragging selected text
Doesn't seem to affect Windows builds, for what it's worth.
The problem is that we are creating display items (clips) in ClipListToRange after we have called LeavePresShell.
Attached patch patchSplinter Review
I'd like to land a fix for this top crasher today.
Attachment #501782 - Flags: review?
Attachment #501782 - Flags: approval2.0?
Attachment #501782 - Flags: review? → review?(dbaron)
I will create a mochitest for this later.
Flags: in-testsuite?
I think the Windows version of this crash is [@ xul.dll@0x38357b] since many of the 248 reports mention dragging text someplace in the browser.
I think this should probably block Beta 9.
Comment on attachment 501782 [details] [diff] [review]
patch

I'll trust you on that being bad.  r=dbaron
Attachment #501782 - Flags: review?(dbaron)
Attachment #501782 - Flags: review+
Attachment #501782 - Flags: approval2.0?
Attachment #501782 - Flags: approval2.0+
The reason for the crash is bug 615794 introduced a call to CurrentPresContext on the display list builder when creating a nsDisplayClip. CurrentPresContext calls CurrentPresShellState() which returns the top of the mPresShellStates stack. And the mPresShellStates stack is pushed to/popped from in EnterPresShell/LeavePresShell. So if we've left the last presshell then the stack is empty and we return a bad pointer.
http://hg.mozilla.org/mozilla-central/rev/9f3abbbfed8d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Duplicate of this bug: 623833
Duplicate of this bug: 624145
I wrote a test for this. Unfortunately it doesn't pass on try server on Windows for some reason. I haven't had much time to figure out why.
Crash Signature: [@ nsDisplayClip::nsDisplayClip ]
You need to log in before you can comment on or make changes to this bug.