fix: Android signal thread stack overflow + add version marker to UI
Some checks failed
Mirror to GitHub / mirror (push) Failing after 40s
Build Release Binaries / build-amd64 (push) Failing after 3m47s

- Spawn signaling on dedicated thread with 4MB stack instead of using
  Android's IO dispatcher thread (insufficient stack for tokio + QUIC)
- Add "direct-call-v1" version marker to home screen subtitle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-09 07:10:07 +04:00
parent 30a893a73f
commit 4fbf6770c4
3 changed files with 16 additions and 10 deletions

1
Cargo.lock generated
View File

@@ -4370,6 +4370,7 @@ dependencies = [
"async-trait",
"axum 0.7.9",
"bytes",
"chrono",
"dirs",
"futures-util",
"prometheus",

View File

@@ -165,7 +165,7 @@ fun InCallScreen(
color = Color.White
)
Text(
text = "ENCRYPTED VOICE",
text = "ENCRYPTED VOICE \u2022 direct-call-v1",
style = MaterialTheme.typography.labelSmall.copy(letterSpacing = 3.sp),
color = TextDim
)

View File

@@ -272,14 +272,19 @@ impl WzpEngine {
info!(fingerprint = %fp, relay = %addr, "starting signaling");
// Create runtime for signaling (separate from call runtime)
let rt = tokio::runtime::Builder::new_multi_thread()
.worker_threads(1)
.enable_all()
.build()?;
self.state.running.store(true, Ordering::Release);
let signal_state = state.clone();
rt.spawn(async move {
// Spawn on a dedicated thread with sufficient stack (Android IO dispatcher stack is too small)
std::thread::Builder::new()
.name("wzp-signal".into())
.stack_size(4 * 1024 * 1024) // 4MB stack
.spawn(move || {
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.expect("tokio runtime");
rt.block_on(async move {
let _ = rustls::crypto::ring::default_provider().install_default();
let bind: SocketAddr = "0.0.0.0:0".parse().unwrap();
let endpoint = match wzp_transport::create_endpoint(bind, None) {
@@ -371,9 +376,9 @@ impl WzpEngine {
let mut stats = signal_state.stats.lock().unwrap();
stats.state = crate::stats::CallState::Closed;
});
}); // block_on
})?; // thread spawn
self.tokio_runtime = Some(rt);
Ok(())
}