https://linen.dev logo
SIGSEGV Address boundary error with Actix
# help
w
Is anyone successfully using actix-web with Shuttle? Even the initial template isn't working for me.
Copy code
sh
$ cargo shuttle init --actix-web
$ cargo shuttle run
    Compiling ...
    Compiling ...
    Compiling ...
    Finished dev [unoptimized + debuginfo] target(s) in 1m 08s

Starting canac-actix on http://127.0.0.1:8000
fish: Job 1, 'cargo shuttle run' terminated by signal SIGSEGV (Address boundary error)
The error is just a segfault, not even a stack trace, so I'm at a loss of how to debug further. It works fine with the Rocket and Axum templates. I was hoping to use actix because I've used it before. Thanks in advance for any help!
w
OS / Rust Version?
w
Intel MacOS 12.6.2, Rust v1.66.0
Switching to Rust v1.63.0 fixes the SEGFAULT, there's just a
Error: Secret error:
now.
w
Does
cargo shuttle deploy
SEGFAULT?
w
cargo shuttle deploy
works on v1.63.0. Going to try latest Rust next.
w
I think the toolchain is set by the runtime and not what you have locally when you deploy @stocky-kangaroo-53672 or @kind-area-3810 can confirm this one
w
I can reproduce the same segfault on an M1 Mac with Rust 1.66.0 running
cargo shuttle run
@worried-airplane-91571 Do you think this is a legitimate bug that I should report on GitHub so it can be tracked and fixed? Being able to deploy is a good workaround, but obviously it would be nice to be able to run locally.
k
Yes, although we have a bug where project dependencies will override the toolchain, but we're fixing that in the next release. I don't think you will be able to set an override yourself though, since I the override file won't be included in the tarball (I'd have to double-check this). Either way we set an override ourself in the next release, and that will trump
rust-toolchain.toml
overrides.
Sounds good, thanks! So is it just actix, but on both m1 and intel? Our actix integration is a bit hacky, it may not be as sound as we had hoped. Either way, I'll try to reproduce on monday and take a closer look.
w
Correct, I've only seen it on Actix, and it happens on both M1 and Intel with Rust 1.66. I haven't tried all the frameworks, but Axum and Rocket work.
s
Hmm, seg faults usually means something is crossing the FFI with a new / different shape 🤔 What version of Actix is in your
Cargo.toml
?
k
I can't reproduce it unfortunately, using rust 1.66 on ubuntu x86. Could it be an issue with your cargo cache trying to use incompatible versions of dependencies (for example, we require tokio to be =1.22)?
w
actix-web
version is pinned to 4.2.1 in
Cargo.toml
and
Cargo.lock
I deleted
~/.cargo
, reinstalled shuttle, recreated the project via
cargo shuttle new
, and it still segfaults when I try to run it.
k
Thanks for trying this. I'll spin up a mac tomorrow and try again to reproduce. By the way, did you try 1.65 as well? If that works, it's also the version the project containers are pinned to, so you won't be able to use 1.66 features either way. Although 1.66 also comes with improved compile times, it may be a good alternative until we can figure this out.
We just had a reproduction on m1 mac now, so it's not something to do with your system. I'll let you know when we learn more.
w
Oh good, I'm glad you could reproduce. Thanks for looking into this!
i
HI, I ran into same problem, is there any update?
k
Hello and welcome Leonz! Unfortunately not yet, but we are hoping to make progress on it next week. We are making some changes to our backend in the upcoming release that should make it more robust, and we might be able to integrate
actix-web
without relying on
ServiceConfig
.
w
I tried it again today with v0.10.0, and now it fails with a
SIGBUS (Misaligned address error)
error
k
Thanks for the report! 🙏 We have a similar report in our issues (but using axum), with a brave user who is digging into it and trying to figure it out: