Hermanverschooten

Hermanverschooten

Rustler precompiled segfaults in GH action

My typst package was recently updated, and I wanted to release a new version. I am using rustler precompiled to precompile the rust bindings to typst.

although the change to the code was minimal, the compilation for 2 targets fails with a segfault.

Compiling typst_nif v0.1.1 (/home/runner/work/typst/typst/native/typst_nif)
error: rustc interrupted by SIGSEGV, printing backtrace
...
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
error: could not compile `typst_nif` (lib)
Caused by:
  process didn't exit successfully: `rustc --crate-name typst_nif --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --emit=dep-info,link -C opt-level=3 -C lto --cfg 'feature="default"' --cfg 'feature="nif_version_2_15"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nif_version_2_15", "nif_version_2_16", "nif_version_2_17"))' -C metadata=684f38727e91bcf8 --out-dir /target/aarch64-unknown-linux-gnu/release/deps --target aarch64-unknown-linux-gnu -C linker=aarch64-linux-gnu-gcc -C strip=debuginfo -L dependency=/target/aarch64-unknown-linux-gnu/release/deps -L dependency=/target/release/deps --extern comemo=/target/aarch64-unknown-linux-gnu/release/deps/libcomemo-c278774ab144f6c8.rlib --extern rustler=/target/aarch64-unknown-linux-gnu/release/deps/librustler-c7f63b2eafc93dbf.rlib --extern tar=/target/aarch64-unknown-linux-gnu/release/deps/libtar-5166b6795e27638f.rlib --extern time=/target/aarch64-unknown-linux-
Done.

Full log

I followed the directions and added a step to the workflow to set the RUST_MIN_STACK env var,

- name: Set Rust stack size
  shell: bash
  run: |
    echo "RUST_MIN_STACK=16777216" >> $GITHUB_ENV

But alas this doesn’t make a difference.

Has anyone encountered something similar and know how to resolve this?

Thanks,

Herman

Marked As Solved

Hermanverschooten

Hermanverschooten

I changed the workflow to use:

- name: Install Rust
  uses: dtolnay/rust-toolchain@stable
  with:
    toolchain: 1.86.0  # Specify your desired Rust version
    targets: ${{ matrix.job.target }}

instead of

- name: Add target
  shell: bash
  run: |
    rustup target add ${{ matrix.job.target }}

Now it uses rust 1.86 and that works!

Thanks for the assist!

Where Next?

Popular in Questions Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New

We're in Beta

About us Mission Statement