Closed Bug 1884096 Opened 8 months ago Closed 7 months ago

Assertion failure: startSet (The start of the range should've been set already)

Categories

(Core :: DOM: Selection, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: emilio, Unassigned)

References

()

Details

I hit it consistently with these steps to reproduce, on Linux:

  • ./mach run about:preferences
  • Type "c" in the search field.

Stack:

#0  0x00007ae5298f2335 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7ffc06198930, rem=rem@entry=0x7ffc06198930)
    at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48
#1  0x00007ae5298fd3e7 in __GI___nanosleep (req=req@entry=0x7ffc06198930, rem=rem@entry=0x7ffc06198930) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#2  0x00007ae52990e3de in __sleep (seconds=0) at ../sysdeps/posix/sleep.c:55
#3  0x00007ae51df2f340 in common_crap_handler (signum=11, aFirstFramePC=<optimized out>) at /home/emilio/src/moz/gecko-9/toolkit/xre/nsSigHandlers.cpp:100
#4  0x00007ae51df2f42d in ah_crap_handler (signum=0) at /home/emilio/src/moz/gecko-9/toolkit/xre/nsSigHandlers.cpp:108
#5  0x00007ae51df03431 in nsProfileLock::FatalSignalHandler (signo=11, info=0x7ffc06198c30, context=0x7ffc06198b00) at /home/emilio/src/moz/gecko-9/toolkit/profile/nsProfileLock.cpp:183
#6  0x00007ae51f592969 in WasmTrapHandler (signum=11, info=0x7ffc06198c30, context=0x7ffc06198b00) at /home/emilio/src/moz/gecko-9/js/src/wasm/WasmSignalHandlers.cpp:794
#7  0x00007ae52985a770 in <signal handler called> () at /usr/lib/libc.so.6
#8  mozilla::ContentEventHandler::ConvertFlatTextOffsetToDOMRangeBase<mozilla::ContentEventHandler::SimpleRangeBase<RefPtr<nsINode>, mozilla::RangeBoundaryBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent> > >, RefPtr<mozilla::dom::Text> > (this=this@entry=0x7ffc061996d0, aOffset=4294967295, aLength=1, aLineBreakType=aLineBreakType@entry=mozilla::LINE_BREAK_TYPE_NATIVE, aExpandToClusterBoundaries=true)
    at /home/emilio/src/moz/gecko-9/dom/events/ContentEventHandler.cpp:1287
#9  0x00007ae51a602404 in mozilla::ContentEventHandler::ConvertFlatTextOffsetToDOMRange
    (this=0x7ffc061996d0, aOffset=698316131, aLength=355493888, aExpandToClusterBoundaries=true, aLineBreakType=<optimized out>) at /home/emilio/src/moz/gecko-9/dom/events/ContentEventHandler.h:406
#10 mozilla::ContentEventHandler::OnQueryTextRect (this=this@entry=0x7ffc061996d0, aEvent=aEvent@entry=0x7ffc06199520) at /home/emilio/src/moz/gecko-9/dom/events/ContentEventHandler.cpp:2492
#11 0x00007ae51a601ca7 in mozilla::ContentEventHandler::OnQueryCaretRect (this=0x7ffc061996d0, aEvent=aEvent@entry=0x7ffc06199e60)
    at /home/emilio/src/moz/gecko-9/dom/events/ContentEventHandler.cpp:2874
#12 0x00007ae51a6009ac in mozilla::ContentEventHandler::HandleQueryContentEvent (this=0x7ae5299f8700 <_IO_stdfile_2_lock>, aEvent=0x7ffc06199e60)
    at /home/emilio/src/moz/gecko-9/dom/events/ContentEventHandler.cpp:1428
#13 0x00007ae51a65687c in mozilla::IMEContentObserver::HandleQueryContentEvent (this=0x7ae4e7574430, aEvent=0x7ffc06199e60) at /home/emilio/src/moz/gecko-9/dom/events/IMEContentObserver.cpp:711
#14 0x00007ae51a5daef2 in mozilla::EventStateManager::HandleQueryContentEvent (this=this@entry=0x7ae4eb104ee0, aEvent=0x7ffc06199e60)
    at /home/emilio/src/moz/gecko-9/dom/events/EventStateManager.cpp:1247
#15 0x00007ae51a5da17f in mozilla::EventStateManager::PreHandleEvent
    (this=0x7ae4eb104ee0, aPresContext=0x7ae4ebf61100, aEvent=0x7ffc06199e60, aTargetFrame=0x7ae4ea033388, aTargetContent=0x7ae4f54116a0, aStatus=0x7ffc06199dcc, aOverrideClickTarget=0x0)
    at /home/emilio/src/moz/gecko-9/dom/events/EventStateManager.cpp:700
#16 0x00007ae51c52cf0e in mozilla::PresShell::EventHandler::DispatchEvent
    (this=this@entry=0x7ffc06199bf0, aEventStateManager=aEventStateManager@entry=0x7ae4eb104ee0, aEvent=aEvent@entry=0x7ffc06199e60, aTouchIsNew=false, aEventStatus=aEventStatus@entry=0x7ffc06199dcc, aOverrideClickTarget=aOverrideClickTarget@entry=0x0) at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:8449
#17 0x00007ae51c526f90 in mozilla::PresShell::EventHandler::HandleEventWithCurrentEventInfo
    (this=this@entry=0x7ffc06199bf0, aEvent=aEvent@entry=0x7ffc06199e60, aEventStatus=aEventStatus@entry=0x7ffc06199dcc, aIsHandlingNativeEvent=true, aOverrideClickTarget=aOverrideClickTarget@entry=0x0) at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:8418
#18 0x00007ae51c5276bb in mozilla::PresShell::EventHandler::HandleEventAtFocusedContent (this=0x7ffc06199bf0, aGUIEvent=aGUIEvent@entry=0x7ffc06199e60, aEventStatus=aEventStatus@entry=0x7ffc06199dcc)
    at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:8164
#19 0x00007ae51c5251fd in mozilla::PresShell::EventHandler::HandleEvent
    (this=this@entry=0x7ffc06199bf0, aFrameForPresShell=aFrameForPresShell@entry=0x7ae4e9aed020, aGUIEvent=aGUIEvent@entry=0x7ffc06199e60, aDontRetargetEvents=true, aEventStatus=aEventStatus@entry=0x7ffc06199dcc) at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:7092
#20 0x00007ae51c5247cc in mozilla::PresShell::HandleEvent
    (this=this@entry=0x7ae4f667c000, aFrameForPresShell=aFrameForPresShell@entry=0x7ae4e9aed020, aGUIEvent=aGUIEvent@entry=0x7ffc06199e60, aDontRetargetEvents=true, aEventStatus=aEventStatus@entry=0x7ffc06199dcc) at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:7010
#21 0x00007ae51c525cfe in mozilla::PresShell::EventHandler::MaybeHandleEventWithAnotherPresShell
    (this=this@entry=0x7ffc06199d10, aFrameForPresShell=aFrameForPresShell@entry=0x7ae4f0cbd020, aGUIEvent=aGUIEvent@entry=0x7ffc06199e60, aEventStatus=aEventStatus@entry=0x7ffc06199dcc, aRv=aRv@entry=0x7ffc06199ca8) at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:7842
#22 0x00007ae51c525197 in mozilla::PresShell::EventHandler::HandleEvent
--Type <RET> for more, q to quit, c to continue without paging--c
    (this=this@entry=0x7ffc06199d10, aFrameForPresShell=aFrameForPresShell@entry=0x7ae4f0cbd020, aGUIEvent=aGUIEvent@entry=0x7ffc06199e60, aDontRetargetEvents=false, aEventStatus=aEventStatus@entry=0x7ffc06199dcc) at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:7054
#23 0x00007ae51c5247cc in mozilla::PresShell::HandleEvent (this=0x7ae4f27a7000, aFrameForPresShell=0x7ae4f0cbd020, aGUIEvent=0x7ffc06199e60, aDontRetargetEvents=false, aEventStatus=0x7ffc06199dcc)
    at /home/emilio/src/moz/gecko-9/layout/base/PresShell.cpp:7010
#24 0x00007ae51c0a141f in nsViewManager::DispatchEvent (this=<optimized out>, aEvent=aEvent@entry=0x7ffc06199e60, aView=aView@entry=0x7ae4f2761480, aStatus=aStatus@entry=0x7ffc06199dcc)
    at /home/emilio/src/moz/gecko-9/view/nsViewManager.cpp:653
#25 0x00007ae51c0a117a in nsView::HandleEvent (this=<optimized out>, aEvent=0x7ffc06199e60, aUseAttachedEvents=<optimized out>) at /home/emilio/src/moz/gecko-9/view/nsView.cpp:1136
#26 0x00007ae51c15fb62 in nsWindow::DispatchEvent (this=0x7ae512313500, aEvent=0x7ffc06199e60, aStatus=@0x7ffc06199e5c: nsEventStatus_eIgnore)
    at /home/emilio/src/moz/gecko-9/widget/gtk/nsWindow.cpp:544
#27 0x00007ae51c19f853 in mozilla::widget::IMContextWrapper::SetCursorPosition (this=this@entry=0x7ae4fcdf2710, aContext=aContext@entry=0x7ae4fbfc5560 [GtkIMMulticontext])
    at /home/emilio/src/moz/gecko-9/widget/gtk/IMContextWrapper.cpp:2999
#28 0x00007ae51c19ea30 in mozilla::widget::IMContextWrapper::OnKeyEvent (this=0x7ae4fcdf2710, aCaller=<optimized out>, aEvent=0x7ae4e7732de0, aKeyboardEventWasDispatched=false)
    at /home/emilio/src/moz/gecko-9/widget/gtk/IMContextWrapper.cpp:804
#29 0x00007ae51c1f6c16 in mozilla::widget::KeymapWrapper::HandleKeyPressEvent (aWindow=0x7ae512313500, aGdkKeyEvent=0x7ae4e7732de0) at /home/emilio/src/moz/gecko-9/widget/gtk/nsGtkKeyUtils.cpp:1515
#30 0x00007ae51c17c6d1 in nsWindow::OnKeyPressEvent (this=0x7ae512313500, aEvent=0x7ae4e7732de0) at /home/emilio/src/moz/gecko-9/widget/gtk/nsWindow.cpp:5040
#31 key_press_event_cb (widget=widget@entry=0x7ae4fcd6e410 [MozContainer], event=0x7ae4e7732de0) at /home/emilio/src/moz/gecko-9/widget/gtk/nsWindow.cpp:8382
#32 0x00007ae52528c6cd in _gtk_marshal_BOOLEAN__BOXED
    (closure=0x7ae4fcdde210, return_value=0x7ffc0619a4b0, param_values=0x7ffc0619a540, marshal_data=<optimized out>, invocation_hint=<optimized out>, n_param_values=<optimized out>)
    at gtk/gtkmarshalers.c:84
#33 0x00007ae5270236c0 in g_closure_invoke (closure=0x7ae4fcdde210, return_value=0x7ffc0619a4b0, n_param_values=2, param_values=0x7ffc0619a540, invocation_hint=0x7ffc0619a490)
    at ../glib/gobject/gclosure.c:832
#34 0x00007ae527051a36 in signal_emit_unlocked_R.isra.0
    (node=node@entry=0x7ffc0619a630, detail=detail@entry=0, instance=instance@entry=0x7ae4fcd6e410, emission_return=emission_return@entry=0x7ffc0619a6b0, instance_and_params=instance_and_params@entry=0x7ffc0619a540) at ../glib/gobject/gsignal.c:3980
#35 0x00007ae527042335 in signal_emit_valist_unlocked (instance=instance@entry=0x7ae4fcd6e410, signal_id=signal_id@entry=86, detail=detail@entry=0, var_args=var_args@entry=0x7ffc0619a790)
    at ../glib/gobject/gsignal.c:3625
#36 0x00007ae527042c77 in g_signal_emit_valist (instance=0x7ae4fcd6e410, signal_id=86, detail=0, var_args=var_args@entry=0x7ffc0619a790) at ../glib/gobject/gsignal.c:3355
#37 0x00007ae527042d34 in g_signal_emit (instance=instance@entry=0x7ae4fcd6e410, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3675
#38 0x00007ae525554cd5 in gtk_widget_event_internal.part.0.lto_priv.0 (widget=0x7ae4fcd6e410 [MozContainer], event=0x7ae4e7732de0) at ../gtk/gtk/gtkwidget.c:7812
#39 0x00007ae525563fcc in gtk_window_propagate_key_event (window=window@entry=0x7ae51199b360 [GtkWindow], event=event@entry=0x7ae4e7732de0) at ../gtk/gtk/gtkwindow.c:8259
#40 0x00007ae5255666b4 in gtk_window_key_press_event (widget=0x7ae51199b360 [GtkWindow], event=0x7ae4e7732de0) at ../gtk/gtk/gtkwindow.c:8292
#45 0x00007ae527042d34 in <emit signal '???' on instance 0x7ae51199b360 [GtkWindow]> (instance=instance@entry=0x7ae51199b360, signal_id=<optimized out>, detail=detail@entry=0)
    at ../glib/gobject/gsignal.c:3675
    #41 0x00007ae525287829 in _gtk_marshal_BOOLEAN__BOXEDv
    (closure=0x7ae5296fee20, return_value=0x7ffc0619aab0, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x7ae52191d158)
    at gtk/gtkmarshalers.c:130
    #42 0x00007ae527042b73 in _g_closure_invoke_va
    (param_types=0x7ae52191d158, n_params=<optimized out>, args=0x7ffc0619ab90, instance=0x7ae51199b360, return_value=0x7ffc0619aab0, closure=0x7ae5296fee20) at ../glib/gobject/gclosure.c:895
    #43 signal_emit_valist_unlocked (instance=instance@entry=0x7ae51199b360, signal_id=signal_id@entry=86, detail=detail@entry=0, var_args=var_args@entry=0x7ffc0619ab90)
    at ../glib/gobject/gsignal.c:3516
    #44 0x00007ae527042c77 in g_signal_emit_valist (instance=0x7ae51199b360, signal_id=86, detail=0, var_args=var_args@entry=0x7ffc0619ab90) at ../glib/gobject/gsignal.c:3355
#46 0x00007ae525554cd5 in gtk_widget_event_internal.part.0.lto_priv.0 (widget=0x7ae51199b360 [GtkWindow], event=0x7ae4e7732de0) at ../gtk/gtk/gtkwidget.c:7812
#47 0x00007ae5253eed2a in propagate_event (widget=widget@entry=0x7ae51199b360 [GtkWindow], event=event@entry=0x7ae4e7732de0, captured=captured@entry=0, topmost=topmost@entry=0x0)
    at ../gtk/gtk/gtkmain.c:2681
#48 0x00007ae5253eeda2 in gtk_propagate_event (event=0x7ae4e7732de0, widget=0x7ae51199b360 [GtkWindow]) at ../gtk/gtk/gtkmain.c:2725
#49 0x00007ae5253ef797 in gtk_main_do_event (event=0x7ae4e7732de0) at ../gtk/gtk/gtkmain.c:1921
#50 gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1691
#51 0x00007ae526739b77 in _gdk_event_emit (event=0x7ae4e7732de0) at ../gtk/gdk/gdkevents.c:73
#52 _gdk_event_emit (event=0x7ae4e7732de0) at ../gtk/gdk/gdkevents.c:67
#53 0x00007ae526772218 in gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:124
#54 0x00007ae52510df69 in g_main_dispatch (context=0x7ae5296cc920) at ../glib/glib/gmain.c:3476
#55 0x00007ae52516c3a7 in g_main_context_dispatch_unlocked (context=0x7ae5296cc920) at ../glib/glib/gmain.c:4284
#56 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7ae5296cc920, block=block@entry=0, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
#57 0x00007ae52510c162 in g_main_context_iteration (context=0x7ae5296cc920, may_block=0) at ../glib/glib/gmain.c:4414
#58 0x00007ae51c1cfd18 in nsAppShell::ProcessNextNativeEvent (this=<optimized out>, mayWait=<optimized out>) at /home/emilio/src/moz/gecko-9/widget/gtk/nsAppShell.cpp:492
#59 0x00007ae51c10cc1d in nsBaseAppShell::DoProcessNextNativeEvent (this=0x7ae521948600, mayWait=false) at /home/emilio/src/moz/gecko-9/widget/nsBaseAppShell.cpp:131
#60 nsBaseAppShell::OnProcessNextEvent (this=0x7ae521948600, thr=0x7ae52968cc80, mayWait=false) at /home/emilio/src/moz/gecko-9/widget/nsBaseAppShell.cpp:250
#61 0x00007ae51c10ce3d in non-virtual thunk to nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal*, bool) () at /home/emilio/src/moz/gecko-9/widget/nsBaseAppShell.cpp:287
#62 0x00007ae5174d6d03 in nsThread::ProcessNextEvent (this=0x7ae52968cc80, aMayWait=false, aResult=0x7ffc0619b11f) at /home/emilio/src/moz/gecko-9/xpcom/threads/nsThread.cpp:1114
#63 0x00007ae5174dd68e in NS_ProcessNextEvent (aThread=0x7ae5299f8700 <_IO_stdfile_2_lock>, aThread@entry=0x7ae52968cc80, aMayWait=false)
    at /home/emilio/src/moz/gecko-9/xpcom/threads/nsThreadUtils.cpp:480
#64 0x00007ae518025277 in mozilla::ipc::MessagePump::Run (this=0x7ae5219645c0, aDelegate=0x7ae529623d40) at /home/emilio/src/moz/gecko-9/ipc/glue/MessagePump.cpp:85
#65 0x00007ae517f5f872 in MessageLoop::RunHandler (this=0x7ae5299f8700 <_IO_stdfile_2_lock>) at /home/emilio/src/moz/gecko-9/ipc/chromium/src/base/message_loop.cc:363
#66 MessageLoop::Run (this=0x7ae5299f8700 <_IO_stdfile_2_lock>) at /home/emilio/src/moz/gecko-9/ipc/chromium/src/base/message_loop.cc:345
#67 0x00007ae51c10c999 in nsBaseAppShell::Run (this=0x7ae521948600) at /home/emilio/src/moz/gecko-9/widget/nsBaseAppShell.cpp:148
#68 0x00007ae51c1cfbd9 in nsAppShell::Run (this=0x7ae521948600) at /home/emilio/src/moz/gecko-9/widget/gtk/nsAppShell.cpp:470
#69 0x00007ae51dd977f5 in nsAppStartup::Run (this=0x7ae510fce380) at /home/emilio/src/moz/gecko-9/toolkit/components/startup/nsAppStartup.cpp:296
#70 0x00007ae51df24e71 in XREMain::XRE_mainRun (this=this@entry=0x7ffc0619b430) at /home/emilio/src/moz/gecko-9/toolkit/xre/nsAppRunner.cpp:5738
#71 0x00007ae51df261a1 in XREMain::XRE_main (this=this@entry=0x7ffc0619b430, argc=argc@entry=5, argv=argv@entry=0x7ffc0619c738, aConfig=...)
    at /home/emilio/src/moz/gecko-9/toolkit/xre/nsAppRunner.cpp:5950
#72 0x00007ae51df26e23 in XRE_main (argc=5, argv=0x7ffc0619c738, aConfig=...) at /home/emilio/src/moz/gecko-9/toolkit/xre/nsAppRunner.cpp:6007
#73 0x00005ccb1522efca in do_main (argc=5, argv=0x7ffc0619c738, envp=0x7ffc0619c768) at /home/emilio/src/moz/gecko-9/browser/app/nsBrowserApp.cpp:227
#74 main (argc=5, argv=0x7ffc0619c738, envp=0x7ffc0619c768) at /home/emilio/src/moz/gecko-9/browser/app/nsBrowserApp.cpp:445

Masayuki, can you take a look? not be super urgent in any case...

Add NI for comment 0.

Flags: needinfo?(masayuki)

Well, I have no idea right now. And I have some pending issues, so I'll take a look after a while.

I cannot reproduce this bug on Ubuntu with ibus. Emilio, which distro are you using? And which input method is set to default on your system?

Flags: needinfo?(masayuki) → needinfo?(emilio)

Hmm, I read the loop, but I don't get it yet.

Looks like that only when endOffset is less than aOffset, we hit the assertion. It may happen if aLength is too big, but it shouldn't in this case...

I don't reproduce this on Debian 11, Kubuntu, MX-21 too.

I cannot repro this on latest central, maybe it got fixed?

Status: NEW → RESOLVED
Closed: 7 months ago
Flags: needinfo?(emilio)
Resolution: --- → WORKSFORME

Nothing was changed in ContentEventHandler side. Could be fixed by a UI change if it did tricky things...

You need to log in before you can comment on or make changes to this bug.