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

debug_assert hit during debug builds gives no indication of where issue is #5230

Open
flukejones opened this issue May 13, 2024 · 2 comments
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working needs info Further information from the reporter is requested

Comments

@flukejones
Copy link
Contributor

I hit this last night, the i_slint_compiler::passes::default_geometry::fix_percent_size gave me a hint of what the issue might be, but not where. I essentially had to grep on my codebase and comment various points where a percentage was specified for layouting. I wonder if there might be some additional message that could be provided?

error: failed to run custom build command for `rog-control-center v6.0.7 (/home/luke/Projects/asus-linux/asusctl/rog-control-center)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/home/luke/Projects/asus-linux/asusctl/target/debug/build/rog-control-center-88dbcc5d076bd4e7/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /home/luke/.cargo/git/checkouts/slint-8153123e5dffa129/7b3e2fcf32d2/internal/compiler/passes/default_geometry.rs:281:9:
  assertion `left == right` failed
    left: Invalid
   right: LogicalLength
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
     1: core::panicking::panic_fmt
               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
     2: core::panicking::assert_failed_inner
               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:343:17
     3: core::panicking::assert_failed
     4: i_slint_compiler::passes::default_geometry::fix_percent_size
     5: i_slint_compiler::object_tree::recurse_elem
     6: i_slint_compiler::object_tree::recurse_elem_including_sub_components
     7: i_slint_compiler::object_tree::recurse_elem
     8: i_slint_compiler::object_tree::recurse_elem
     9: i_slint_compiler::object_tree::recurse_elem
    10: i_slint_compiler::object_tree::recurse_elem
    11: i_slint_compiler::object_tree::recurse_elem
    12: i_slint_compiler::object_tree::recurse_elem
    13: i_slint_compiler::object_tree::recurse_elem
    14: i_slint_compiler::object_tree::recurse_elem
    15: i_slint_compiler::object_tree::recurse_elem_including_sub_components
    16: i_slint_compiler::passes::default_geometry::default_geometry
    17: i_slint_compiler::passes::run_passes::{{closure}}
    18: i_slint_compiler::compile_syntax_node::{{closure}}
    19: spin_on::spin_on
    20: slint_build::compile_with_config
    21: build_script_build::main
    22: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...

@tronical
Copy link
Member

Thanks for the bug report. This is clearly a case of "should not happen" :). This would happen if you're using either width: 10%;" or height: 10%" (or some other number, just with a percent suffix) and the parent element would declare a width or height property that's not a (logical) length. However before hitting this, there should be an error about the inability to declare a "width" or "height" property in the first place (since those are reserved).

Do you know anything about the surrounding code that triggers this?

@tronical tronical added bug Something isn't working a:compiler Slint compiler internal (not the codegen, not the parser) labels May 14, 2024
@ogoffart
Copy link
Member

Would it be possible to get a reproducible example?

@ogoffart ogoffart added needs info Further information from the reporter is requested labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working needs info Further information from the reporter is requested
Projects
None yet
Development

No branches or pull requests

3 participants