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

Compiler panic: 'assertion failed: min <= max' #1370

Closed
1 task done
cherryblossom000 opened this issue May 30, 2023 · 1 comment
Closed
1 task done

Compiler panic: 'assertion failed: min <= max' #1370

cherryblossom000 opened this issue May 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@cherryblossom000
Copy link

Description

I came across this bug when using typst-slides.

#set page(paper: "presentation-16-9")
#set text(size: 24pt)
#for _ in range(6) {
	block(stroke: (bottom: 1mm))
	[0]
}

Compiling this with Typst v0.4 (with RUSTC_BACKTRACE=full which doesn't seem to be very useful here) results in

thread 'main' panicked at 'assertion failed: min <= max', /private/tmp/nix-build-rustc-1.69.0.drv-0/rustc-1.69.0-src/library/core/src/cmp.rs:857:9
stack backtrace:
   0:        0x1088e75ea - __mh_execute_header
   1:        0x1086bd92a - __mh_execute_header
   2:        0x108902d5c - __mh_execute_header
   3:        0x1088e73c6 - __mh_execute_header
   4:        0x1088fd6e3 - __mh_execute_header
   5:        0x1088fd3f6 - __mh_execute_header
   6:        0x1088fe1aa - __mh_execute_header
   7:        0x1088e7a68 - __mh_execute_header
   8:        0x1088e76e9 - __mh_execute_header
   9:        0x1088fdcc2 - __mh_execute_header
  10:        0x108d8a733 - __mh_execute_header
  11:        0x108d8a7c7 - __mh_execute_header
  12:        0x108a4477d - __mh_execute_header
  13:        0x108a43378 - __mh_execute_header
  14:        0x108a343ac - __mh_execute_header
  15:        0x108c2ec0a - __mh_execute_header
  16:        0x108c78399 - __mh_execute_header
  17:        0x108be08b9 - __mh_execute_header
  18:        0x108c35548 - __mh_execute_header
  19:        0x108c78399 - __mh_execute_header
  20:        0x108c49bc3 - __mh_execute_header
  21:        0x108ca7bd1 - __mh_execute_header
  22:        0x108c6dfea - __mh_execute_header
  23:        0x108b5c9a5 - __mh_execute_header
  24:        0x108ac6659 - __mh_execute_header
  25:        0x108acae00 - __mh_execute_header
  26:        0x108b17617 - __mh_execute_header
  27:        0x108b0aaee - __mh_execute_header
  28:        0x108b07601 - __mh_execute_header
  29:        0x108adbcf6 - __mh_execute_header
  30:        0x108adce5c - __mh_execute_header
  31:        0x1088fc97c - __mh_execute_header
  32:        0x108b1b9dc - __mh_execute_header
  33:     0x7ff80899241f - <unknown>

This also crashes the compiler when using the web app.

core/src/cmp.rs:857 in Rust 1.69 is the assert!(min <= max) in clamp:

fn clamp(self, min: Self, max: Self) -> Self
where
    Self: Sized,
    Self: ~const Destruct,
    Self: ~const PartialOrd,
{
    assert!(min <= max);
    if self < min {
        min
    } else if self > max {
        max
    } else {
        self
    }
}

Reproduction URL

https://typst.app/project/pNX38uXtE_Ku20kTTXnAvk

Operating system

macOS

Typst version

  • I am using the latest version of Typst
@cherryblossom000 cherryblossom000 added the bug Something isn't working label May 30, 2023
@laurmaedje
Copy link
Member

Already fixed on main: 363836a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants