Skip to content

DivideByZero in process_rectangle #10685

@yanshay

Description

@yanshay

Bug Description

Upgraded an application (ESP32S3) from 1.11.0 .
I use take_screenshot to take screenshot of the display.
With 1.11.0 it work.
Tried 1.13.1 and the latest 1.15.0 as of today and it panic:

====================== PANIC ======================
panicked at /Users/yanshay/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/esp-hal-1.0.0/src/exception_handler/mod.rs:10:5:


Exception occurred on ProCpu 'DivideByZero'
Context { PC: 1112300407, PS: 396848, A0: 2186038766, A1: 1070424944, A2: 0, A3: 1070425464, A4: 1070425436, A5: 2, A6: 383, A7: 65505, A8: 383, A9: 0, A10: 0, A11: 0, A12: 1070429104, A13: 37995, A14: 3276800, A15: 0, SAR: 5, EXCCAUSE: 6, EXCVADDR: 0, LBEG: 1074088944, LEND: 1074088975, LCOUNT: 0, THREADPTR: 0, SCOMPARE1: 1, BR: 0, ACCLO: 0, ACCHI: 0, M0: 0, M1: 0, M2: 0, M3: 0, F64R_LO_CPENABLE: 0, F64R_HI: 0, F64S: 0, FCR: 0, FSR: 1152, F0: 959653562, F1: 1007416904, F2: 868697836, F3: 2991880408, F4: 3225944073, F5: 937178491, F6: 245618435, F7: 261996544, F8: 1136623616, F9: 3338666240, F10: 1112014848, F11: 1191182336, F12: 1127481344, F13: 1136630170, F14: 0, F15: 1112014848 }


Backtrace:

0x42461a6e
core::panicking::panic_fmt
    at /Users/yanshay/.rustup/toolchains/esp1/lib/rustlib/src/rust/library/core/src/panicking.rs:75
0x40378f47
__user_exception
    at /Users/yanshay/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/esp-hal-1.0.0/src/exception_handler/mod.rs:10
0x4037a702
__default_exception
    at /Users/yanshay/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/xtensa-lx-rt-0.21.0/src/exception/context.rs:135
0x403789a8
0x40040000
0x424c5b74
euclid::rect::Rect<T,U>::min_y
    at /Users/yanshay/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/euclid-0.22.11/src/rect.rs:173
0x424c8fe9
<i_slint_renderer_software::RenderToBuffer<B> as i_slint_renderer_software::ProcessScene>::process_rectangle
    at /Users/yanshay/.cargo/git/checkouts/slint-774a37e469fae6bf/854711d/internal/renderers/software/lib.rs:1744
0x424c8c5e
<i_slint_core::partial_renderer::PartialRenderer<T> as i_slint_core::item_rendering::ItemRenderer>::draw_rectangle::{{closure}}
    at /Users/yanshay/.cargo/git/checkouts/slint-774a37e469fae6bf/854711d/internal/core/partial_renderer.rs:628
0x424aae7c
<i_slint_core::items::Rectangle as i_slint_core::items::Item_vtable_mod::Item>::render
    at /Users/yanshay/.cargo/git/checkouts/slint-774a37e469fae6bf/854711d/internal/core/items.rs:380
0x424b9c01
i_slint_core::items::Item_vtable_mod::ItemTO::render
    at /Users/yanshay/.cargo/git/checkouts/slint-774a37e469fae6bf/854711d/internal/core/items.rs:121

It is pretty simple code, I'm just doing:

self.ui_weak.unwrap().window().take_snapshot()

Reproducible Code (if applicable)

Environment Details

  • Slint Version: 1.13.1 and 1.15.0
  • Platform/OS: ESP32 (develop on Mac)
  • Programming Language: Rust
  • Backend/Renderer: Software Renderer

Product Impact

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions