fix: Android signal thread stack overflow + add version marker to UI
- 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:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -4370,6 +4370,7 @@ dependencies = [
|
||||
"async-trait",
|
||||
"axum 0.7.9",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"dirs",
|
||||
"futures-util",
|
||||
"prometheus",
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user