Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash related to selection in editing pane #3413

Open
1 task
mnlrsn opened this issue Jan 31, 2025 · 0 comments
Open
1 task

Crash related to selection in editing pane #3413

mnlrsn opened this issue Jan 31, 2025 · 0 comments

Comments

@mnlrsn
Copy link
Contributor

mnlrsn commented Jan 31, 2025

Summary

When using the code pad at uiua.org, there is a crash related when double clicking in the editor pane. Not 100% reproducible, but it happens "all the time".

Operating system

Linux

Steps to reproduce

  1. Go to https://www.uiua.org/pad?src=0_15_0-dev_1__4oehMTAKKzEKLgriip7Dlwo=
  2. Double click in the editor window to select a line of code
  3. Double click on a different row to deselect the first one and select the second one

It also seems to occur if the line is selected by clicking and dragging the mouse over a line of code, then clicking on a different line.

Expected behavior

It should select the second line of text without crashing.

Actual behavior

In more than half the cases it will produce a crash

This has been verified on macOS 14.7.2 M1

URL for a reduced test case

https://www.uiua.org/pad?src=0_15_0-dev_1__4oehMTAKKzEKLgriip7Dlwo=

HTML/SVG/etc. source for a reduced test case

N/A

Log output and (if possible) backtrace

UNEXPECTED ERROR: [IndexSizeError]: Selection.collapse() with offset longer than node's length at /Users/xxx/Workspace/Ladybird/ladybird/Libraries/LibWeb/DOM/EditingHostManager.cpp:83
0   liblagom-ak.0.0.0.dylib             0x00000001032de904 ak_trap + 56
1   liblagom-web.0.0.0.dylib            0x0000000104dab948 Web::DOM::EditingHostManager::set_selection_anchor(GC::Ref<Web::DOM::Node>, unsigned long) + 296
2   liblagom-web.0.0.0.dylib            0x0000000104ecaebc non-virtual thunk to Web::HTML::FormAssociatedTextControlElement::set_selection_anchor(GC::Ref<Web::DOM::Node>, unsigned long) + 76
3   liblagom-web.0.0.0.dylib            0x00000001050aec00 Web::EventHandler::handle_doubleclick(Gfx::Point<Web::CSSPixels>, Gfx::Point<Web::CSSPixels>, unsigned int, unsigned int, unsigned int) + 1048
4   WebContent                          0x0000000102627104 WebContent::ConnectionFromClient::process_next_input_event() + 476
5   liblagom-web.0.0.0.dylib            0x0000000104b90c10 AK::Function<void (Web::CSS::CSSRule const&)>::operator()(Web::CSS::CSSRule const&) const + 76
6   liblagom-core.0.0.0.dylib           0x00000001030f3a7c AK::Function<void (AK::Error&)>::operator()(AK::Error&) const + 76
7   liblagom-core.0.0.0.dylib           0x00000001030f2f98 Core::EventReceiver::dispatch_event(Core::Event&, Core::EventReceiver*) + 112
8   liblagom-core.0.0.0.dylib           0x0000000103103b28 Core::ThreadEventQueue::process() + 424
9   liblagom-core.0.0.0.dylib           0x0000000103107950 Core::EventLoopImplementationUnix::exec() + 44
10  liblagom-core.0.0.0.dylib           0x00000001030f0b10 Core::EventLoop::exec() + 72
11  WebContent                          0x0000000102622eec serenity_main(Main::Arguments) + 4376
12  WebContent                          0x00000001026c4fb0 main + 196
13  dyld                                0x000000019be6b154 start + 2476

Screenshots or screen recordings

No response

Build flags or config settings

No response

Contribute a patch?

  • I’ll contribute a patch for this myself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant