Open hansiflick12 opened 4 months ago
full backtrace:
root@ubuntu-4gb-hel1-1:~/spotify-analyze-v2/pineapple/target/release# RUST_BACKTRACE=full cargo run listen
Finished dev
profile [unoptimized + debuginfo] target(s) in 0.13s
Running /root/spotify-analyze-v2/pineapple/target/debug/pineapple listen
Listening on 0.0.0.0:4070
Accepted connection from 109.192.119.203:50221
thread 'main' panicked at src/proxy/pcap.rs:97:41:
Failed to write interface block: IoError(Custom { kind: Other, error: "Failed to send data to FIFO channel" })
stack backtrace:
0: 0x61de814ea845 - std::backtrace_rs::backtrace::libunwind::trace::hb4d9489fd44693d7
at /rustc/c987ad527540e8f1565f57c31204bde33f63df76/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
1: 0x61de814ea845 - std::backtrace_rs::backtrace::trace_unsynchronized::h9f7a303c564be742
at /rustc/c987ad527540e8f1565f57c31204bde33f63df76/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x61de814ea845 - std::sys_common::backtrace::_print_fmt::h61cec1a0bb227b54
at /rustc/c987ad527540e8f1565f57c31204bde33f63df76/library/std/src/sys_common/backtrace.rs:68:5
3: 0x61de814ea845 -
This is expected for now, pineapple is still in development and I've run into this bug myself a few times. I'll get around to fixing it sometime but if you're comfortable with rust feel free to diagnose it yourself and open a PR.
The reason for this error is how the FIFO is implemented. The main thread which runs the proxy sends any data it has to a channel: https://github.com/charleywright/spotify-analyze-v2/blob/8fbe7a261722750d9ebe8db21bc3f8e57228489f/pineapple/src/proxy/pcap.rs#L253-L256
This will fail if the receiving end of the channel has hung up (Drop is called on Receiver
) which is my guess for the cause of this. The Receiver
is owned by the FIFO thread which just runs the fifo_thread
function:
https://github.com/charleywright/spotify-analyze-v2/blob/8fbe7a261722750d9ebe8db21bc3f8e57228489f/pineapple/src/proxy/pcap.rs#L134
You could try to reproduce with RUST_LOG=debug
set as an environment variable, that should make it clear if the thread is exiting before it should causing the Receiver
to be dropped.
This bug may be fixed by https://github.com/charleywright/spotify-analyze-v2/commit/5b890961a6d230418326548248b9fd1caf8361dc which handles an error when the proxy is trying to write data while Wireshark is opening. Before this commit the FIFO thread would exit which could cause the broken channel error you are seeing.
EDIT: If you test this commit, make sure to run the proxy with -vv
, this will enable all logging and should help narrow down the error e.g. cargo run -- listen -vv
Im trying to run pineapple on ubuntu, now im getting the following error:
root@ubuntu-4gb-hel1-1:~/spotify-analyze-v2/pineapple/target/release# ./pineapple listen --write a.pcapng Accepted connection from x.x.x.x:49995 thread 'main' panicked at src/proxy/pcap.rs:97:41: Failed to write interface block: IoError(Custom { kind: Other, error: "Failed to send data to FIFO channel" }) note: run with
RUST_BACKTRACE=1
environment variable to display a backtrace