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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews