vlx

vlx

Hello,

first a bit of context:

I am using Elixir with Kafka extensively.

Lib for connecting to Kafka I am using is GitHub - silviucpp/erlkaf: Erlang kafka driver based on librdkafka · GitHub

It depends on a well known C++ Kafka driver GitHub - confluentinc/librdkafka: The Apache Kafka C/C++ library · GitHub

librdkafka works great most of the time, but sometimes on startup it throws Segmentation fault errors, and I would like to debug the C++ code.

Question:

Is there a way to compile the BEAM VM with C debug flags and connect it to some C debugger (prob not gdb but something for LLVM, right?)

I am using Mac with i7 Intel proc, installed Erlang and Elixir with asdf.

Tnx in advance,
Vlx

Showing Posts 1 to 4

jhogberg

jhogberg

Erlang Core Team

If I’m reading the docs right, asdf uses kerl under the hood, so you should be able to pass kerl options when installing:

$ export KERL_BUILD_DEBUG_VM="true"
$ asdf install erlang <version>

You should then be able to use cerl -debug -lldb to start LLDB with the debug emulator.

vlx

vlx OP

False alarm, I mistakenly used openssl@3 for compile

uuuugh, now my asdf installation doesn’t work. OpenSSL issues

$ echo $KERL_BUILD_DEBUG_VM
true
$ echo $KERL_CONFIGURE_OPTIONS 
--without-javac --with-ssl=/usr/local/opt/openssl@3
$ asdf install erlang 24.1.7 
asdf_24.1.7 is not a kerl-managed Erlang/OTP installation
No build named asdf_24.1.7
Downloading 24.1.7 to /Users/y/.asdf/plugins/erlang/kerl-home/archives...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   654  100   654    0     0   6812      0 --:--:-- --:--:-- --:--:--  6812
100  102M  100  102M    0     0  27.9M      0  0:00:03  0:00:03 --:--:-- 37.0M
Extracting source code
Building Erlang/OTP 24.1.7 (asdf_24.1.7), please wait...
APPLICATIONS DISABLED (See: /Users/y/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1.7/otp_build_24.1.7.log)
 * jinterface     : Java compiler disabled by user

Build failed.
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/opt/openssl@3/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
25 warnings generated.
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2
vlx

vlx OP

I successfully compiled erlang with debug flags, thank you very much!

Now I am really struggling with runnig the Elixir app in interactive mode (iex -S mix) and connecting it to the lldb

I suppose I should run the lldb first, then run BEAM machine and then point it to the Elixir project to run it?

jhogberg

jhogberg

Erlang Core Team

Sorry, I’m afraid I can’t be of much help with the Elixir side of things. :frowning:

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
thiagogsr
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews