alanj853

alanj853

Erlinit: Erlang terminated due to signal 11

Hi,

I am currently working on an embedded Armv7 device that runs an image built from the nerves project.

In my firmware, I replaced the standard /sbin/init of erlang’s with nerves’s erlinit.

My device was running fine for 9 whole days, and then it crashed. Luckily, I had the dmesg output from the time the erlang VM exited, and this was the message: “erlinit: Erlang terminated due to signal 11”.

From reading online, I think this is a segmentation fault.

I am looking for help on how to debug this, as it is very hard to reproduce, and no error messages appear to be printed when it happens… It just seems to happen out of nowhere. Also, the fact that is takes several days to occur makes it very impractical to debug by sitting there watching the device.

Any help or ideas on how to go about this, or what tools to use would be greatly appreciated.

OTP Version: 24.1.3
Elixir Version: 1.12.1-otp-24
Linux Kernel: 5.4

Most Liked

fhunleth

fhunleth

Co-author of Nerves

In this case, this probably won’t give you much more information, but erlinit can provide a shutdown report that’s saved to /data. Add this to your config.exs:

config :nerves, :erlinit, shutdown_report: "/data/last_shutdown.txt"

If you want to get a crash dump from Erlang, then environment variables can be used to control that. You might already have this or something like it in your Nerves system’s rootfs_overlay/etc/erlinit.config, so check that first:

# Enable crash dumps (set ERL_CRASH_DUMP_SECONDS=0 to disable)
-e ERL_CRASH_DUMP=/data/erl_crash.dump;ERL_CRASH_DUMP_SECONDS=5

I feel like the sad part is that this is going to end up being an issue with a NIF. Take a look at this blog post for working with core dumps with Nerves.

The only other idea I have is that if you have a suspicion on a possibly sketchy NIF, perhaps there’s a way of calling it a lot that can make the crash happen more quickly.

milangupta

milangupta

A shot in the dark, but for what its worth …
Feels like it may be due to some resource (storage/IO buffers etc.) filling up over time ?
Have you checked log files or terminal output (stdio/stderr) from daemons that aren’t directed to /dev/null ?

Where Next?

Popular in Questions Top

polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
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
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
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
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement