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

Fix segmentation fault on submit by update prettytable-rs #200

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

yosuke-oka
Copy link
Contributor

@yosuke-oka yosuke-oka commented Feb 21, 2023

Updates prettytable-rs to 0.10.0

Segmentation fault occurs on cargo compete submit.
prettytable-rs causes this error, fix it by updating.

The following is my console this error occurred.

$ cargo compete submit practice-a
     Running `/Users/yosuke/.cargo/bin/cargo-compete compete t --src /Users/yosuke/study/procon/atcoder/abs/src/bin/practice-a.rs --display-limit '4 KiB' --manifest-path /Users/yosuke/study/procon/atcoder/abs/Cargo.toml --color auto`
     Running `/Users/yosuke/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo build --bin abs-practice-a --manifest-path /Users/yosuke/study/procon/atcoder/abs/Cargo.toml`
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
1/2 ("sample1") Accepted (2 ms)
2/2 ("sample2") Accepted (2 ms)

1/2 ("sample1") Accepted (2 ms)
stdin:
1
2 3
test
expected:
6 test
actual:
6 test

2/2 ("sample2") Accepted (2 ms)
stdin:
72
128 256
myonmyon
expected:
456 myonmyon
actual:
456 myonmyon
fish: Job 1, 'cargo compete submit practice-a' terminated by signal SIGSEGV (Address boundary error)

Environment

M1 Mac (macOS: 13.1)

$ cargo --version
cargo 1.67.1 (8ecd4f20a 2023-01-10)

@qryxip qryxip self-requested a review February 21, 2023 11:44
@mizar
Copy link

mizar commented Apr 5, 2023

A tentative segfault workaround might be to build with 1.66.1.

1.66.1 will work cargo compete submit:

rustup install 1.66.1
cargo +1.66.1 install cargo-compete --locked --force

Note that 1.67.1 will cause a segfault.

rustup install 1.67.1
cargo +1.67.1 install cargo-compete --locked --force

@bjin
Copy link

bjin commented May 20, 2023

I met the same error, and here is the backtrace:

#0  0x0000555fe2e06af0 in prettytable::TableSlice::get_all_column_width::hf643685f428da65c ()
#1  0x0000555fe2e0719f in <prettytable::TableSlice as core::fmt::Display>::fmt::hbb990547bd587e0e ()
#2  0x0000555fe32e8a2e in core::fmt::write () at library/core/src/fmt/mod.rs:1232
#3  0x0000555fe2c47205 in std::io::Write::write_fmt::hd8d4ef6e1f600e97 ()
#4  0x0000555fe2c5914a in cargo_compete::commands::submit::print_status::h6b8dadaf3c0018b0 ()
#5  0x0000555fe2c57c22 in cargo_compete::commands::submit::run::haeb8ea3df6498a76 ()
#6  0x0000555fe2a87c76 in cargo_compete::run::ha50f05372f69dd39 ()
#7  0x0000555fe2a62509 in cargo_compete::main::h7f89b54875f6d7ce ()

My environment is zsh 5.9 on archlinux.

I can confirm updating prettytable-rs to 0.10.0 fixed the issue for me.

@acevif
Copy link

acevif commented Jun 21, 2023

Same problem

@qryxip
Copy link
Owner

qryxip commented Aug 12, 2023

Merging. Thank you.

@qryxip qryxip merged commit 8fb73ec into qryxip:master Aug 12, 2023
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 this pull request may close these issues.

5 participants