Skip to content

Linux binary of v0.33.0 panicks #814

Closed

Description

@beingalink

Introduction

I just updated the provided linux binary (sqlpage github repository) from v0.32.1 to v0.33.0 and since then I can't run sqlpage anymore as it breaks with following error message:

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.18/src/lib.rs:418:13:
assertion `left == right` failed

To Reproduce

Run sqlpage binary without any additional flags.

  • OS: Linux a2f8a 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 GNU/Linux
  • Database SQLite
  • SQLPage Version: 0.33.0

Activity

  1. lovasoa commented on Feb 18, 2025

    @lovasoa
    Collaborator

    That's bad ! I cannot reproduce it. Can you run with RUST_BACKTRACE=1 and paste the backtrace here ?

  2. added a commit that references this issue on Feb 18, 2025
  3. beingalink commented on Feb 18, 2025

    @beingalink
    Author

    Output of RUST_BACKTRACE=full as RUST_BACKTRACE=1 didn't contain any information:

    thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.18/src/lib.rs:418:13:
    assertion `left == right` failed
      left: 2
     right: 0
    stack backtrace:
       0:     0x5611a8957af9 - <unknown>
       1:     0x5611a8175043 - <unknown>
       2:     0x5611a891f382 - <unknown>
       3:     0x5611a8958b33 - <unknown>
       4:     0x5611a895905b - <unknown>
       5:     0x5611a8958c08 - <unknown>
       6:     0x5611a8958b69 - <unknown>
       7:     0x5611a8958b5c - <unknown>
       8:     0x5611a7f17f8f - <unknown>
       9:     0x5611a7f180bc - <unknown>
      10:     0x5611a7f3921c - <unknown>
      11:     0x5611a7f391ab - <unknown>
      12:     0x5611a87e1b3e - <unknown>
      13:     0x5611a8175043 - <unknown>
      14:     0x5611a88082c0 - <unknown>
      15:     0x5611a8175043 - <unknown>
      16:     0x5611a87e1344 - <unknown>
      17:     0x5611a8175043 - <unknown>
      18:     0x5611a87ecce5 - <unknown>
      19:     0x5611a8175043 - <unknown>
      20:     0x5611a87ec975 - <unknown>
      21:     0x5611a8175043 - <unknown>
      22:     0x5611a87eb605 - <unknown>
      23:     0x5611a8175043 - <unknown>
      24:     0x5611a87f3b21 - <unknown>
      25:     0x5611a8175043 - <unknown>
      26:     0x5611a80a2947 - <unknown>
      27:     0x5611a84753b9 - <unknown>
      28:     0x5611a84724ee - <unknown>
      29:     0x5611a8698c50 - <unknown>
      30:     0x5611a868e34c - <unknown>
      31:     0x5611a86d73d2 - <unknown>
      32:     0x5611a7f780d3 - <unknown>
      33:     0x5611a86d4800 - <unknown>
      34:     0x7f2d7ccf4d7a - __libc_start_main
      35:     0x5611a7f3f7de - <unknown>
      36:                0x0 - <unknown>
    Aborted
    
  4. lovasoa commented on Feb 18, 2025

    @lovasoa
    Collaborator

    It does contain the actual value returned by pthread_attr_getstack: https://github.com/rust-lang/stacker/blob/04d334ca6ad8ef942fef80e173c6e34bbb905a6a/src/lib.rs#L418C30-L418C51

    A return value of 2 (ENOENT) is strange and really unexpected.

    In the meantime, here is a build without the bug inducing dependency: sqlpage.bin.gz. Can you confirm it fixes the issue for you ?

    But I'd like to get to the bottom of this.

  5. beingalink commented on Feb 18, 2025

    @beingalink
    Author

    This is on a really restricted linux system with heavily reduced access to the system environment and quite low memory/cpu resources (basically it's managed hosting with ssh access as a goodie). I wouldn't have posted a bug if it didn't work before as my expectancy for this to work there was originally quite low. To my surprise, it worked a lot better than expected, at least enough to experiment. For production, I'd use a different system with more resources and fewer restrictions. :)

  6. lovasoa commented on Feb 18, 2025

    @lovasoa
    Collaborator

    Do you have an idea how we could reproduce this restricted environment locally ? That would help ! stacker is a popular crate in the rust ecosystem, with 17M downloads, so the issue probably affects much more than just sqlpage. Even on a restricted environment, crashing with a cryptic error message is not a desirable behavior.

  7. beingalink commented on Feb 18, 2025

    @beingalink
    Author

    Unfortunately, I don't know how to emulate this specific environment and I'm not really linux savvy. The hoster is netcup and the plan is Webhosting 2000 (https://www.netcup.com/en/hosting).

    Unfortunately, the fixed binary you posted doesn't work because it doesn't seem to be statically linked to glibc:

    ./sqlpage.bin: /lib/libc.so.6: version `GLIBC_2.34' not found (required by ./sqlpage.bin)
    
  8. lovasoa commented on Feb 18, 2025

    @lovasoa
    Collaborator

    Ok, the ENOENT (2) error code and your message put me on the right path, I can reproduce it now !

    ❯ sudo mount -t tmpfs none /proc
    
    ❯ ./sqlpage.bin
    thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.18/src/lib.rs:418:13:
    assertion `left == right` failed
      left: 2
     right: 0
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    Aborted (core dumped)

    In the same environment, sqlpage without the stacker dependency works fine. I reported the issue to stacker, so that they can hopefully fix it: rust-lang/stacker#115

    In the meantime, you can use the following statically linked binary: sqlpage.bin.gz

  9. beingalink commented on Feb 18, 2025

    @beingalink
    Author

    Thank you! This binary works fine. :)

  10. added a commit that references this issue on Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions