[GH-ISSUE #539] Signal SIGXCPU on Linux when I build it myself #323

Closed
opened 2026-02-28 14:32:09 +03:00 by kerem · 9 comments
Owner

Originally created by @Fruitsalad on GitHub (Oct 9, 2024).
Original GitHub issue: https://github.com/jpochyla/psst/issues/539

Describe the bug
After compiling the program myself, I get a SIGXCPU signal (CPU time limit exceeded) whenever I try to play a track. The program then crashes. This did not happen when I used a prebuilt binary.

To Reproduce
I presume this does not happen on your device, which makes it rather difficult to reproduce. I simply ran:

sudo apt-get install libssl-dev libgtk-3-dev libcairo2-dev libasound2-dev
cargo build
cargo run --bin psst-gui

Of course that makes the process seem a bit cleaner than it really was since at first I missed out on the apt-get install step. Nevertheless I don't believe I did anything particularly out of the ordinary, and after properly ensuring all packages are installed (only libssl-dev wasn't already installed) a cargo clean && cargo run --bin psst-gui yields the same results.

Environment

  • OS: Linux Mint 21.2 Cinnamon (with kernel 5.15.0-122-generic)
Originally created by @Fruitsalad on GitHub (Oct 9, 2024). Original GitHub issue: https://github.com/jpochyla/psst/issues/539 **Describe the bug** After compiling the program myself, I get a SIGXCPU signal (CPU time limit exceeded) whenever I try to play a track. The program then crashes. **This did not happen when I used a prebuilt binary.** **To Reproduce** I presume this does not happen on your device, which makes it rather difficult to reproduce. I simply ran: ``` sudo apt-get install libssl-dev libgtk-3-dev libcairo2-dev libasound2-dev cargo build cargo run --bin psst-gui ``` Of course that makes the process seem a bit cleaner than it really was since at first I missed out on the `apt-get install` step. Nevertheless I don't believe I did anything particularly out of the ordinary, and after properly ensuring all packages are installed (only `libssl-dev` wasn't already installed) a `cargo clean && cargo run --bin psst-gui` yields the same results. **Environment** - OS: Linux Mint 21.2 Cinnamon (with kernel 5.15.0-122-generic)
kerem 2026-02-28 14:32:09 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Fruitsalad commented on GitHub (Oct 9, 2024):

This issue isn't very important to me by the way, but I thought it was good to make record of it.

<!-- gh-comment-id:2402695621 --> @Fruitsalad commented on GitHub (Oct 9, 2024): This issue isn't very important to me by the way, but I thought it was good to make record of it.
Author
Owner

@SO9010 commented on GitHub (Oct 10, 2024):

Heya, I'm pretty sure that this happens as a protection for your computer not to crash, so only the program crashes. This is because you are only building the "developer" build, add --release after your command, then it will remove this issue ;)

So try: cargo run --bin psst-gui --release

<!-- gh-comment-id:2404703853 --> @SO9010 commented on GitHub (Oct 10, 2024): Heya, I'm pretty sure that this happens as a protection for your computer not to crash, so only the program crashes. This is because you are only building the "developer" build, add --release after your command, then it will remove this issue ;) So try: `cargo run --bin psst-gui --release`
Author
Owner

@jacksongoode commented on GitHub (Oct 10, 2024):

This is still a little bit weird that this happens. I don't know exactly what the resolution here is.

<!-- gh-comment-id:2405957805 --> @jacksongoode commented on GitHub (Oct 10, 2024): This is still a little bit weird that this happens. I don't know exactly what the resolution here is.
Author
Owner

@SO9010 commented on GitHub (Oct 10, 2024):

Ah ok so I have been looking through documentation, I think the way to fix this is through checking your current CPU time limit:

ulimit -t

Then you can set it to unlimited though this:

ulimit -t unlimited

This may be wrong I haven't tested it yet.

<!-- gh-comment-id:2406045917 --> @SO9010 commented on GitHub (Oct 10, 2024): Ah ok so I have been looking through documentation, I think the way to fix this is through checking your current CPU time limit: `ulimit -t` Then you can set it to unlimited though this: `ulimit -t unlimited` This may be wrong I haven't tested it yet.
Author
Owner

@SO9010 commented on GitHub (Oct 11, 2024):

No this isn't the answer, mine is already set to unlimited... wierd!

<!-- gh-comment-id:2407269629 --> @SO9010 commented on GitHub (Oct 11, 2024): No this isn't the answer, mine is already set to unlimited... wierd!
Author
Owner

@Fruitsalad commented on GitHub (Oct 12, 2024):

I tried a couple of things just now:

  1. Release builds work just fine for me. No problems at all.
  2. All of the following commands give "unlimited" for me:
ulimit -R
ulimit -SR
ulimit -HR
ulimit -t
ulimit -St
ulimit -Ht
  1. I also injected the following bit of code into psst-gui (specifically route_widget()):
let realtime_limit = rlimit::getrlimit(Resource::RTTIME).unwrap();
let cputime_limit = rlimit::getrlimit(Resource::CPU).unwrap();
println!("Realtime: {realtime_limit:?}");
println!("CPU time: {cputime_limit:?}");

In a debug build this gives:

Realtime: (18446744073709551615, 18446744073709551615)
CPU time: (18446744073709551615, 18446744073709551615)

Where 18446744073709551615 is 2**64 - 1 (presumably unlimited).

I honestly don't think this bug is viable to fix without a kernel developer butting in. If you want to close this as wontfix that would be fine by me.

<!-- gh-comment-id:2408516020 --> @Fruitsalad commented on GitHub (Oct 12, 2024): I tried a couple of things just now: 1. Release builds work just fine for me. No problems at all. 2. All of the following commands give "unlimited" for me: ```sh ulimit -R ulimit -SR ulimit -HR ulimit -t ulimit -St ulimit -Ht ``` 3. I also injected the following bit of code into `psst-gui` (specifically `route_widget()`): ```rust let realtime_limit = rlimit::getrlimit(Resource::RTTIME).unwrap(); let cputime_limit = rlimit::getrlimit(Resource::CPU).unwrap(); println!("Realtime: {realtime_limit:?}"); println!("CPU time: {cputime_limit:?}"); ``` In a debug build this gives: ``` Realtime: (18446744073709551615, 18446744073709551615) CPU time: (18446744073709551615, 18446744073709551615) ``` Where `18446744073709551615` is `2**64 - 1` (presumably unlimited). I honestly don't think this bug is viable to fix without a kernel developer butting in. If you want to close this as `wontfix` that would be fine by me.
Author
Owner

@SO9010 commented on GitHub (Oct 14, 2024):

Thank you so much for your help!

<!-- gh-comment-id:2410528404 --> @SO9010 commented on GitHub (Oct 14, 2024): Thank you so much for your help!
Author
Owner

@SO9010 commented on GitHub (Oct 16, 2024):

@jacksongoode should we close this now, I do want to note that building with these optimisations does make it take a bit longer to build.

<!-- gh-comment-id:2418098002 --> @SO9010 commented on GitHub (Oct 16, 2024): @jacksongoode should we close this now, I do want to note that building with these optimisations does make it take a bit longer to build.
Author
Owner

@jacksongoode commented on GitHub (Oct 16, 2024):

I think it's ok to close, if this needs to be reopened if someone wants to figure out more optimal dev settings I believe that's fine.

<!-- gh-comment-id:2418099795 --> @jacksongoode commented on GitHub (Oct 16, 2024): I think it's ok to close, if this needs to be reopened if someone wants to figure out more optimal dev settings I believe that's fine.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#323
No description provided.