Skip to content

Fix bugs for the beam_debug_info option#10735

Merged
bjorng merged 4 commits intoerlang:masterfrom
bjorng:bjorn/beam_debug_info/GH-10557/OTP-19991
Feb 26, 2026
Merged

Fix bugs for the beam_debug_info option#10735
bjorng merged 4 commits intoerlang:masterfrom
bjorng:bjorn/beam_debug_info/GH-10557/OTP-19991

Conversation

@bjorng
Copy link
Copy Markdown
Contributor

@bjorng bjorng commented Feb 19, 2026

Fix bugs where the compiler could generate invalid BEAM files when the beam_debug_info option was given.

Also ensure that that loading will fail (instead of crashing the runtime system) when BEAM files lack the "DbgB" or "Recs" chunks when they are referenced by BEAM instructions.

Fixes #10557

@bjorng bjorng self-assigned this Feb 19, 2026
@bjorng bjorng added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Feb 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 19, 2026

CT Test Results

     5 files     548 suites   2h 0m 53s ⏱️
 4 440 tests  4 338 ✅ 102 💤 0 ❌
10 444 runs  10 318 ✅ 126 💤 0 ❌

Results for commit 0f25922.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@bjorng bjorng force-pushed the bjorn/beam_debug_info/GH-10557/OTP-19991 branch from 0e19f2a to 8d4644f Compare February 19, 2026 08:51
lucioleKi
lucioleKi previously approved these changes Feb 19, 2026
@bjorng bjorng force-pushed the bjorn/beam_debug_info/GH-10557/OTP-19991 branch 2 times, most recently from cff68a1 to 1cf2885 Compare February 20, 2026 09:26
If a module is compiled with the `beam_debug_info` option, the
corresponding chunk for BEAM debug info ("DbgB") should not be
removed by the `slim` option for the compiler or by stripping
using `beam_lib`. That implies that the chunk should be essential
and also included in the calculation of MD5 for the module.
There could be a memory leak when attempting to load
invalid BEAM files.
@bjorng bjorng force-pushed the bjorn/beam_debug_info/GH-10557/OTP-19991 branch from 1cf2885 to 0f25922 Compare February 20, 2026 12:46
@bjorng bjorng requested a review from lucioleKi February 23, 2026 05:45
@jhogberg jhogberg added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Feb 25, 2026
@bjorng bjorng merged commit 25e2957 into erlang:master Feb 26, 2026
31 of 33 checks passed
@bjorng bjorng deleted the bjorn/beam_debug_info/GH-10557/OTP-19991 branch February 26, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid code can be generated with +beam_debug_info

3 participants