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

BorrowMutError with async block event handler on Android #3464

Open
tdomhan opened this issue Dec 28, 2024 · 3 comments
Open

BorrowMutError with async block event handler on Android #3464

tdomhan opened this issue Dec 28, 2024 · 3 comments

Comments

@tdomhan
Copy link

tdomhan commented Dec 28, 2024

Problem

When typing on Android one sometimes runs into BorrowMutError. I was not able to reproduce this on MacOS yet, only on Android via the emulator (which may also be connected to execution via the emulator being slower).

Steps To Reproduce

Steps to reproduce the behavior:

  • Create an app with a textarea that registers an onkeydown event handler with an async block like the one below
  • quickly type. It takes a while to trigger the error, especially with an empty async block, but it can be reproduced consistently.
#[component]
pub fn Hero() -> Element {
    rsx! {
        div {
            id: "hero",
            img { src: HEADER_SVG, id: "header" }
            textarea {
                onkeydown: |e| {tracing::debug!("onkeydown: {:?}", e); async move {}},
            }
        }
    }
}

The exact error is:

12-28 10:34:47.054 22253 22298 I RustStdoutStderr: thread '<unnamed>' panicked at /Users/tdomhan/Projects/outliner_rs/dioxus/packages/core/src/tasks.rs:288:22:
12-28 10:34:47.054 22253 22298 I RustStdoutStderr: already borrowed: BorrowMutError
12-28 10:34:47.054 22253 22298 I RustStdoutStderr: stack backtrace:

Link to the relevant code:

.borrow_mut()

When this error occurs there's also a second error in the log:

12-28 10:34:47.118 22253 22298 I RustStdoutStderr: thread '<unnamed>' panicked at /Users/tdomhan/Projects/outliner_rs/dioxus/packages/html/src/events/form.rs:337:1:
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: called `Result::unwrap()` on an `Err` value: Dropped(ValueDroppedError { created_at: Location { file: "/Users/tdomhan/Projects/outliner_rs/dioxus/packages/core/src/events.rs", line: 375, col: 9 } })

The full log is:

12-28 10:34:46.965 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:46.964860Z DEBUG outlinerrs_dioxus::views::block_edit_view: oninput: sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd u UiEvent { bubble_state: true, prevent_default: false, data: FormEvent { value: "sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd u", values: {}, valid: false, selection_start: Some(377), selection_end: Some(377) } }
12-28 10:34:47.016 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.016543Z DEBUG outlinerrs_dioxus::views::block_edit_view: on_keydown: UiEvent { bubble_state: true, prevent_default: false, data: KeyboardData { key: Character("i"), code: KeyI, modifiers: Modifiers(0x0), location: Standard, is_auto_repeating: false, is_composing: false } }
12-28 10:34:47.017 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.017286Z DEBUG outlinerrs_dioxus::views::block_edit_view: on_keydown took: 741.542µs
12-28 10:34:47.022 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.022771Z DEBUG outlinerrs_dioxus::views::block_edit_view: oninput: sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd ui UiEvent { bubble_state: true, prevent_default: false, data: FormEvent { value: "sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd ui", values: {}, valid: false, selection_start: Some(378), selection_end: Some(378) } }
12-28 10:34:47.053 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.053717Z DEBUG outlinerrs_dioxus::views::block_edit_view: on_keydown: UiEvent { bubble_state: true, prevent_default: false, data: KeyboardData { key: Character("h"), code: KeyH, modifiers: Modifiers(0x0), location: Standard, is_auto_repeating: false, is_composing: false } }
12-28 10:34:47.054 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.054322Z DEBUG outlinerrs_dioxus::views::block_edit_view: on_keydown took: 610.125µs
12-28 10:34:47.054 22253 22298 I RustStdoutStderr: thread '<unnamed>' panicked at /Users/tdomhan/Projects/outliner_rs/dioxus/packages/core/src/tasks.rs:288:22:
12-28 10:34:47.054 22253 22298 I RustStdoutStderr: already borrowed: BorrowMutError
12-28 10:34:47.054 22253 22298 I RustStdoutStderr: stack backtrace:
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    0:       0x7b9cb3fb98 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    1:       0x7b9cb686b8 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    2:       0x7b9cb33c70 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    3:       0x7b9cb421f8 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    4:       0x7b9cb41d0c - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    5:       0x7b9cb42f88 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    6:       0x7b9cb42cac - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    7:       0x7b9cb40094 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    8:       0x7b9cb4297c - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:    9:       0x7b9cb651ec - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   10:       0x7b9cb62238 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   11:       0x7b9cabb5d0 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   12:       0x7b9ca783a4 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   13:       0x7b9caa4250 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   14:       0x7b9ca1701c - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   15:       0x7b9ca12870 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   16:       0x7b9ca11d8c - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   17:       0x7b9c279da0 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   18:       0x7b9c279c54 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   19:       0x7b9c2440b8 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   20:       0x7b9c243e60 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   21:       0x7b9c2566d4 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   22:       0x7b9c2a74bc - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   23:       0x7b9c249fd4 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   24:       0x7b9c259e98 - <unknown>
12-28 10:34:47.055 22253 22298 I RustStdoutStderr:   25:       0x7b9c25af60 - <unknown>
12-28 10:34:47.056 22253 22298 I RustStdoutStderr:   26:       0x7b9c2ac48c - <unknown>
12-28 10:34:47.056 22253 22298 I RustStdoutStderr:   27:       0x7b9c250c74 - <unknown>
12-28 10:34:47.056 22253 22298 I RustStdoutStderr:   28:       0x7b9c24a530 - <unknown>
12-28 10:34:47.056 22253 22298 I RustStdoutStderr:   29:       0x7b9c244444 - <unknown>
12-28 10:34:47.056 22253 22298 I RustStdoutStderr:   30:       0x7b9c2443c4 - <unknown>
12-28 10:34:47.056 22253 22298 I RustStdoutStderr:   31:       0x7b9c272e70 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   32:       0x7b9c27230c - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   33:       0x7b9c271f78 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   34:       0x7b9c2678cc - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   35:       0x7b9c276224 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   36:       0x7b9c267840 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   37:       0x7b9c28e768 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   38:       0x7b9c28ea14 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   39:       0x7b9c250eac - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   40:       0x7b9c2511cc - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   41:       0x7b9bff3254 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   42:       0x7b9c6e550c - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   43:       0x7b9c6f4398 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   44:       0x7b9c6ff2fc - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   45:       0x7b9c6ecb10 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   46:       0x7b9c6ecea8 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   47:       0x7b9c6ff768 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   48:       0x7b9c6fee3c - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   49:       0x7b9c6e1100 - <unknown>
12-28 10:34:47.057 22253 22298 I RustStdoutStderr:   50:       0x7b9cb4b7d0 - <unknown>
12-28 10:34:47.058 22253 22298 I RustStdoutStderr:   51:       0x7ee9ecd358 - <unknown>
12-28 10:34:47.058 22253 22298 I RustStdoutStderr:   52:       0x7ee9ebffc8 - <unknown>
12-28 10:34:47.068 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.065076Z DEBUG outlinerrs_dioxus::views::block_edit_view: BlockContentEditingView dropped 6224f7bb-ea43-4d92-8bbe-51ac6a75252a
12-28 10:34:47.078 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.078787Z  INFO outlinerrs_dioxus::app_state: handle_block_event from thread Unnamed thread
12-28 10:34:47.079 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.079848Z  INFO outlinerrs_dioxus::model::sync: Adding entry: ValueEntry { value: "sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd ui", timestamp: LogicalTimestamp { lamport: 48, peer_id: ActorId(2304bbaf-3208-4074-9be7-ac24110ad9c3) } } current: ValueEntry { value: "sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasj", timestamp: LogicalTimestamp { lamport: 46, peer_id: ActorId(2304bbaf-3208-4074-9be7-ac24110ad9c3) } } true true
12-28 10:34:47.094 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.094006Z  INFO outlinerrs_dioxus::model::signal: multi_set3 called (interior mut) {} [Plain { elements: [Text("sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd ui", None)] }] "sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd ui"
12-28 10:34:47.095 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.095087Z  INFO outlinerrs_dioxus::model::reactive_block: Old refs: {} new refs: {}
12-28 10:34:47.096 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.096297Z  INFO outlinerrs_dioxus::model::signal: Calling notify
12-28 10:34:47.096 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.096648Z  WARN dioxus_signals::warnings::__signal_write_in_component_body: Write on signal at src/model/signal.rs:396:46 happened while a component was running. Writing to signals during a render can cause infinite rerenders when you read the same signal in the component. Consider writing to the signal in an effect, future, or event handler if possible.
12-28 10:34:47.096 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.096714Z  INFO outlinerrs_dioxus::model::signal: Calling notify
12-28 10:34:47.096 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.096859Z  WARN dioxus_signals::warnings::__signal_write_in_component_body: Write on signal at src/model/signal.rs:396:46 happened while a component was running. Writing to signals during a render can cause infinite rerenders when you read the same signal in the component. Consider writing to the signal in an effect, future, or event handler if possible.
12-28 10:34:47.096 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.096906Z  INFO outlinerrs_dioxus::model::signal: Calling notify
12-28 10:34:47.097 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.097067Z  WARN dioxus_signals::warnings::__signal_write_in_component_body: Write on signal at src/model/signal.rs:396:46 happened while a component was running. Writing to signals during a render can cause infinite rerenders when you read the same signal in the component. Consider writing to the signal in an effect, future, or event handler if possible.
12-28 10:34:47.097 22253 22298 I RustStdoutStderr: 2024-12-28T09:34:47.097667Z  INFO outlinerrs_dioxus::app_state: Stored operation: StoredOp { op: ContentUpdate { block_id: BlockId(6224f7bb-ea43-4d92-8bbe-51ac6a75252a), content: "sd ssssssssssdsdsddddsdfsdfsdfsdfnnnnnnnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnjnuhuihiuhiuhiuhuihuihuihiuhiuhiuhiuhiuhiuhiuhiuhiuhiuhasdfuihasjhasdijasdoiajsdijasdijasidjaisdjiasjdiajsdiajsidjaisdjiasjdiajsdiajsdiajsdiajsdijasdijaisdjaisjdiasjdiasjdiajsdijasidjaisdjiasjdiasjdiajdiaj asd asd ui" }, vclock: VClock { c: {ActorId(2304bbaf-3208-4074-9be7-ac24110ad9c3): 46} } }
12-28 10:34:47.098 22253 22298 I RustStdoutStderr: global_clock_clone: {len: 1, weight: 47, max: {"2304bbaf-3208-4074-9be7-ac24110ad9c3": 46}}
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: thread '<unnamed>' panicked at /Users/tdomhan/Projects/outliner_rs/dioxus/packages/html/src/events/form.rs:337:1:
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: called `Result::unwrap()` on an `Err` value: Dropped(ValueDroppedError { created_at: Location { file: "/Users/tdomhan/Projects/outliner_rs/dioxus/packages/core/src/events.rs", line: 375, col: 9 } })
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: stack backtrace:
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    0:       0x7b9cb3fb98 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    1:       0x7b9cb686b8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    2:       0x7b9cb33c70 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    3:       0x7b9cb421f8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    4:       0x7b9cb41d0c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    5:       0x7b9cb42f88 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    6:       0x7b9cb42cac - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    7:       0x7b9cb40094 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    8:       0x7b9cb4297c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    9:       0x7b9cb651ec - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   10:       0x7b9cb6568c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   11:       0x7b9b8b17dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   12:       0x7b9b84f2d4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   13:       0x7b9b84a098 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   14:       0x7b9b900478 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   15:       0x7b9b851f58 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   16:       0x7b9caa0bbc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   17:       0x7b9ca28930 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   18:       0x7b9caa43d4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   19:       0x7b9ca28894 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   20:       0x7b9ca193d4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   21:       0x7b9ca18148 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   22:       0x7b9c254b9c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   23:       0x7b9c253684 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   24:       0x7b9c253374 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   25:       0x7b9c296298 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   26:       0x7b9c2dc058 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   27:       0x7b9c606aa0 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   28:       0x7b9c572468 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   29:       0x7b9c606b08 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   30:       0x7b9c6130f8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   31:       0x7b9c6144e0 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   32:       0x7b9bff35c8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   33:       0x7c38578f74 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   34:       0x7c38562778 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   35:       0x7c3855bd20 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   36:       0x7c3896da4c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   37:       0x7c3857b5dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   38:       0x7c3854e220 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   39:       0x7c3855c5b4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   40:       0x7c3896da4c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   41:       0x7c3857b5dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   42:       0x7c3854e220 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   43:       0x7c3855c5b4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   44:       0x7c3896da4c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   45:       0x7c3857b5dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   46:       0x7c3854d5ac - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   47:       0x7c3857909c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   48:       0x7c38562778 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   49:       0x7c385610a4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   50:       0x7c38950aa4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   51:       0x7c387a491c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   52:       0x7c387a72a8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   53:       0x7bacd3a258 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   54:       0x7bae2c67e8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   55:       0x7bae2c7684 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   56:       0x7bae2c7744 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   57:       0x7bac5252c4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   58:       0x7bad3e9fa0 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   59:       0x7bad3e9f64 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   60:       0x7bacd141d8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   61:       0x7bacd15428 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   62:       0x7bacd15098 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   63:       0x7bacd14e20 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   64:       0x7bacd15244 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   65:       0x7bacd0ef00 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   66:       0x7bacd393ac - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   67:       0x7bacd39308 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   68:       0x7bacd08134 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   69:       0x7ee9ecd358 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   70:       0x7ee9ebffc8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: thread '<unnamed>' panicked at library/core/src/panicking.rs:221:5:
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: panic in a function that cannot unwind
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: stack backtrace:
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    0:       0x7b9cb3fb98 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    1:       0x7b9cb686b8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    2:       0x7b9cb33c70 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    3:       0x7b9cb421f8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    4:       0x7b9cb41d0c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    5:       0x7b9cb42f88 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    6:       0x7b9cb42c84 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    7:       0x7b9cb40094 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    8:       0x7b9cb4297c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:    9:       0x7b9cb6521c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   10:       0x7b9cb65294 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   11:       0x7b9cb6540c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   12:       0x7b9bff35d4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   13:       0x7c38578f74 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   14:       0x7c38562778 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   15:       0x7c3855bd20 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   16:       0x7c3896da4c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   17:       0x7c3857b5dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   18:       0x7c3854e220 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   19:       0x7c3855c5b4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   20:       0x7c3896da4c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   21:       0x7c3857b5dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   22:       0x7c3854e220 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   23:       0x7c3855c5b4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   24:       0x7c3896da4c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   25:       0x7c3857b5dc - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   26:       0x7c3854d5ac - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   27:       0x7c3857909c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   28:       0x7c38562778 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   29:       0x7c385610a4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   30:       0x7c38950aa4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   31:       0x7c387a491c - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   32:       0x7c387a72a8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   33:       0x7bacd3a258 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   34:       0x7bae2c67e8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   35:       0x7bae2c7684 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   36:       0x7bae2c7744 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   37:       0x7bac5252c4 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   38:       0x7bad3e9fa0 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   39:       0x7bad3e9f64 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   40:       0x7bacd141d8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   41:       0x7bacd15428 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   42:       0x7bacd15098 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   43:       0x7bacd14e20 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   44:       0x7bacd15244 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   45:       0x7bacd0ef00 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   46:       0x7bacd393ac - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   47:       0x7bacd39308 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   48:       0x7bacd08134 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   49:       0x7ee9ecd358 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr:   50:       0x7ee9ebffc8 - <unknown>
12-28 10:34:47.118 22253 22298 I RustStdoutStderr: thread caused non-unwinding panic. aborting.
12-28 10:34:47.430 22253 22298 I RustStdoutStderr: [1228/103447.428730:ERROR:elf_dynamic_array_reader.h(64)] tag not found
12-28 10:36:11.235 22499 22566 I RustStdoutStderr: [ERROR:variations_seed_loader.cc(37)] Seed missing signature.
12-28 10:36:11.307 22499 22566 I RustStdoutStderr: [INFO:variations_seed_loader.cc(66)] Failed to open file for reading.: No such file or directory (2)
12-28 10:36:11.649 22499 22566 I RustStdoutStderr: [WARNING:dns_config_service_android.cc(81)] Failed to read DnsConfig.
12-28 10:36:11.963 22499 22566 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 0 name position
12-28 10:36:11.963 22499 22566 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 1 name color
12-28 10:36:12.322 22499 22566 I RustStdoutStderr: 2024-12-28T09:36:12.321852Z  INFO outlinerrs_dioxus: Initializing the app state.

Expected behavior

No panic.

Screenshots

BorrowMutAndroidTyping1080.mp4

Environment:

  • Dioxus version: 0.6.1 (commit c2952a7)
  • Rust version: 1.82.0-nightly
  • OS info: MacO
  • App platform: Android
@tdomhan
Copy link
Author

tdomhan commented Dec 28, 2024

I enabled -Zbuild-std -Zbuild-std-features=core/debug_refcell to find the cause. Seeing the following:

12-28 16:55:59.513  9270  9322 I RustStdoutStderr: 2024-12-28T15:55:59.513784Z ERROR dioxus_core::tasks: BorrowMutError handle_task_wakeup poll_result: BorrowMutError { location: Location { file: "/Users/tdomhan/Projects/outliner_rs/dioxus/packages/core/src/scope_context.rs", line: 361, col: 28 } }

Note: the lines don't match with the lines on github as I added some code for debugging. The following line holds the borrow:

self.spawned_tasks.borrow_mut().insert(id);

While we try to get the borrow here:
.borrow_mut()

It's not clear why these two locations can conflict as the borrow is only held for a single modification. However, when printing the current thread id via

        tracing::debug!("spawn current thread ID: {:?}", std::thread::current().id());

in these two locations we see:

12-28 17:20:12.995 10870 10939 I RustStdoutStderr: 2024-12-28T16:20:12.995579Z ERROR dioxus_core::tasks: handle_task_wakeup thread_id: ThreadId(3)
12-28 17:20:12.995 10870 10939 I RustStdoutStderr: 2024-12-28T16:20:12.995956Z DEBUG dioxus_core::scope_context: spawn current thread ID: ThreadId(8)

namely that the RefCell is access from two different threads. 😮 This shouldn't be possible, so I'm not sure what is going on here. 🤯

@tdomhan
Copy link
Author

tdomhan commented Dec 28, 2024

Note: On MacOS both locations are only accessed from the same thread, which is why we may not be running into this error.

@tdomhan
Copy link
Author

tdomhan commented Dec 28, 2024

Might be related to: tauri-apps/wry#1379

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