1

I have a project that I would like to run on an AWS server but it fails at linking. I have previously tried installing the mentioned libraries in the error message, and no help. It is able to run the unit-tests that are included in the project just fine with cargo test.

I have previously asked this question on the discord and a user helped me explore the possibility that this had to due with memory shortage on the server while compiling, but we ultimately found no evidence of this.

Any help in how to go about debugging issues like this in general would be appreciated.

Included is the error message and the dependencies of the project.

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/ubuntu/central_user_discovery/target/debug/deps/agnostic_auth_conn_server-b9813303e3bef938.10abp5uw1ql546qf.rcgu.o"
// ...
"/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-88083985464b6af5.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-83ed8731003cd087.rlib" "-Wl,--end-group" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d61dbae1fa88f6f5.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: collect2: fatal error: ld terminated with signal 9 [Killed]
          compilation terminated.
[package]
name = ""
version = "0.1.0"
authors = [""]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "0.2.22", features = ["full"] }
warp = { version = "0.2.5", features = ["tls"] }
serde = { version = "1.0.116", features = ["derive"] }
serde_json = "1.0.58"
async-trait = "0.1.41"
sled = "0.34.4"
rand = "0.7.3"
openssl = "0.10.30"
hex = "0.4.2"
chrono = "0.4.19"
log = "0.4.11"
E_net4
  • 27,810
  • 13
  • 101
  • 139
gelox
  • 11
  • 2
  • 1
    Signal 9 almost invariably results from memory shortage, so I think you should revisit that. How did you rule it out? Did you look in the system log files - there should be messages about "OOM killer" or something like that. – Nate Eldredge Dec 09 '20 at 22:18
  • Since this is AWS after all, you can also throw money at the problem and just try with a larger instance with more RAM temporarily and see if needing more RAM or a RAM shortage really is the case. You also might want to look at `dmesg` after the process is killed. – nelsonjchen Dec 10 '20 at 09:11
  • dmesg indeed tells me there is an OOM issue. That part was solved by the comments so I'll mark this as solved. However, aside from throwing money at the problem, I'm faced with the issue that I can not create a swap file in my AWS environment. Unless there is a compilation flag that allows rust to utilize less memory then I'll have to find another solution. – gelox Dec 10 '20 at 11:44

0 Answers0