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

hangs in v0.3.0 #109

Closed
matthiaskrgr opened this issue Jul 19, 2023 · 5 comments · Fixed by #221
Closed

hangs in v0.3.0 #109

matthiaskrgr opened this issue Jul 19, 2023 · 5 comments · Fixed by #221

Comments

@matthiaskrgr
Copy link

since the update to v0.3.0, I noticed that treereduce-rust would often start reducing but then just hang in the middle and no longer make any progress.

treereduce-rust  --passes=10  --min-reduction=10 --interesting-exit-code=101 --stats --source  /home/matthias/vcs/github/RUST_CODE/ALL_TESTS/icemaker/04FCCD075E8AFA9FB081E547DEE5329C2F2F0AF68FD1649DF975149BE0F1E10D.rs  -- ~/.rustup/toolchains/local-debug-assertions/bin/rustc   @@.rs
[INFO] Starting pass 1 / 10
[INFO] Original size: 10697
[INFO] Reduced to size: 7836 id=32 kind="delete" priority=2861 size=7836
[INFO] Reduced to size: 5001 id=33 kind="delete" priority=2835 size=5001
[INFO] Reduced to size: 3903 id=34 kind="delete" priority=1098 size=3903
[INFO] Reduced to size: 2893 id=35 kind="delete" priority=1010 size=2893
[INFO] Reduced to size: 2266 id=36 kind="delete" priority=627 size=2266
[INFO] Reduced to size: 1683 id=37 kind="delete" priority=583 size=1683
[INFO] Reduced to size: 1548 id=50 kind="delete" priority=135 size=1548
[INFO] Reduced to size: 1468 id=65 kind="delete" priority=80 size=1468
[INFO] Reduced to size: 1389 id=66 kind="delete" priority=79 size=1389
[INFO] Reduced to size: 1314 id=67 kind="delete" priority=75 size=1314
[INFO] Reduced to size: 1246 id=68 kind="delete" priority=68 size=1246
[INFO] Reduced to size: 1180 id=69 kind="delete" priority=66 size=1180
[INFO] Reduced to size: 1115 id=70 kind="delete" priority=65 size=1115
[INFO] Reduced to size: 1051 id=71 kind="delete" priority=64 size=1051
[INFO] Reduced to size: 987 id=72 kind="delete" priority=64 size=987
[INFO] Reduced to size: 924 id=73 kind="delete" priority=63 size=924
[INFO] Reduced to size: 862 id=74 kind="delete" priority=62 size=862
[INFO] Reduced to size: 805 id=75 kind="delete" priority=57 size=805
[INFO] Reduced to size: 765 id=77 kind="delete" priority=40 size=765
[INFO] Reduced to size: 728 id=79 kind="delete" priority=37 size=728
[INFO] Reduced to size: 692 id=80 kind="delete" priority=36 size=692
[INFO] Reduced to size: 657 id=81 kind="delete" priority=35 size=657
[INFO] Reduced to size: 622 id=82 kind="delete" priority=35 size=622
[INFO] Reduced to size: 588 id=83 kind="delete" priority=34 size=588
[INFO] Reduced to size: 554 id=84 kind="delete" priority=34 size=554
[INFO] Reduced to size: 523 id=86 kind="delete" priority=31 size=523
[INFO] Reduced to size: 497 id=91 kind="delete" priority=26 size=497
[INFO] Reduced to size: 473 id=93 kind="delete" priority=24 size=473
[INFO] Reduced to size: 449 id=94 kind="delete" priority=24 size=449
[INFO] Reduced to size: 425 id=95 kind="delete" priority=24 size=425
[INFO] Reduced to size: 401 id=96 kind="delete" priority=24 size=401
[INFO] Reduced to size: 385 id=98 kind="delete" priority=16 size=385
[INFO] Reduced to size: 370 id=99 kind="delete" priority=15 size=370
[INFO] Reduced to size: 357 id=101 kind="delete" priority=13 size=357

Downgrading to 0.2.2 fixed this for me :/

treereduce_hang.rs.zip

@langston-barrett
Copy link
Owner

@matthiaskrgr Thanks for the report, will look into this!

@vext01
Copy link

vext01 commented Dec 20, 2024

I've encountered the same.

I notice that it terminates fine with -j 1, so I assume it's to do with threading, maybe a deadlock.

@j2kun
Copy link

j2kun commented Dec 22, 2024

I also hit this, with the following repro:

#include <stdio.h>

int main() {
  char * hello = "hello, world!" + 3;
  char * charstring = 'h' + "ello, world!";

  printf("hello=%s, charstring=%s.\n", hello, charstring);
  return 0;
}

test:

#!/bin/bash

set -eoux pipefail

cat <&0 > tmp.c
clang -s tmp.c -o tmp
./tmp | grep -q "=lo, world"

Command:

treereduce-c --fast -s test.c test.sh

Adding -j 1 causes it to finish in 2s, otherwise it hangs for over 30 minutes (at which point I killed the process).

@langston-barrett
Copy link
Owner

Thank you all very much for the reports and for your interest in the project! This looks like a very silly mistake on my part. I have a candidate fix in #221 that fixes @j2kun's test-case for me, though I'm also seeing a debug assertion failing that I'd like to investigate.

@langston-barrett
Copy link
Owner

I've published v0.3.1 with both fixes. Thanks again y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants