Source: rabbitmq-server
Version: 4.0.5-14
Severity: normal
Tags: patch upstream

Dear Maintainer,

I'm planning to update Erlang for Debian 14 (forky) to version 29.
And it appears that rabbitmq-server (4.0.5-14) currently in testing does not 
work
with Erlang 29, and rabbitmq-server (4.3.0-2) currently in unstable
builds fine (with tons of warnings about newly deprecated language
features, which is annoying but harmless) but also doesn't work because
its dependency (horus) uses Erlang internal ASM format which has
been changed in Erlang 29.

The attached patch makes rabbitmq-server working with Erlang 29 while
maintaining compatibility with the currently in unstable Erlang 27.
Please, consider appllying it and/or reporting the bug upstream.

I'm not sure that the patch fixes the bug optimally, it adds the necessary
field to an ASM code just before compiling it, but maybe it'd be
better to add it at the step of constructing the ASM code.

For now I'm setting the severity as normal, I'll bump it after Erlang 29
uploaded to unstable.

Cheers!

-- System Information:
Debian Release: 13.5
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable-debug'), (500, 
'proposed-updates'), (500, 'oldstable-security'), (500, 
'oldstable-proposed-updates'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental'), (1, 'unstable'), (1, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 6.12.90+deb13.1-amd64 (SMP w/24 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
--- a/deps/horus/src/horus.erl
+++ b/deps/horus/src/horus.erl
@@ -767,13 +767,29 @@
       Beam :: binary().
 
 compile(Asm) when is_tuple(Asm) ->
+    Asm1 = case list_to_integer(erlang:system_info(otp_release)) >= 29 of
+               true ->
+                   {GeneratedModuleName,
+                    Exports,
+                    Attributes,
+                    Functions1,
+                    Labels} = Asm,
+                   {GeneratedModuleName,
+                    Exports,
+                    Attributes,
+                    #{},
+                    Functions1,
+                    Labels};
+               _ ->
+                   Asm
+               end,
     CompilerOptions = [from_asm,
                        binary,
                        warnings_as_errors,
                        return_errors,
                        return_warnings,
                        deterministic],
-    case compile:forms(Asm, CompilerOptions) of
+    case compile:forms(Asm1, CompilerOptions) of
         {ok, _Module, Beam, []} -> Beam;
         Error                   -> handle_compilation_error(Asm, Error)
     end;
@@ -1569,6 +1585,11 @@
             pass1_process_instructions(Rest, State, Result)
     end;
 pass1_process_instructions(
+  [{line, _} = Instruction | Rest],
+  State,
+  Result) ->
+    pass1_process_instructions(Rest, State, [Instruction | Result]);
+pass1_process_instructions(
   [{executable_line, Index, _Unknown} = Instruction | Rest],
   #state{lines_in_progress = Lines} = State,
   Result) when is_integer(Index) ->

Reply via email to