Re: RFA: Fix potential memory leak in gen-sframe.c

Project / Subsystem

binutils / gas

Date

2026-07-29

Proposer

Jens Remus <jremus@linux.ibm.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Fixes a critical bug leading to crashes and data corruption.
  • • May involve a slight overhead for initializing/clearing structure fields.

All attributes

project
binutils
subsystem
gas
patch_id
—
discussion_id
cec32933-c3b6-4b28-8745-9a3d738a2bed@linux.ibm.com
source_type
public_inbox
title
Re: RFA: Fix potential memory leak in gen-sframe.c
headline
RFA: Fix potential memory leak in gen-sframe.c
tldr
Fixes a memory leak in gas/gen-sframe.c that could lead to a segmentation fault by properly cleaning up context structures.
proposer
Jens Remus <jremus@linux.ibm.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Fixes a critical bug leading to crashes and data corruption.
  • • May involve a slight overhead for initializing/clearing structure fields.
series_id
—
series_role
reply
series_parts
[]
tags
  • • assembler
  • • memory management
  • • debugging
  • • binutils
bugzilla_url
—
date
2026-07-29T00:00:00.000Z

Re: RFA: Fix potential memory leak in gen-sframe.c

This discussion addresses a potential memory leak and subsequent segmentation fault in the SFrame handling within GAS (GNU Assembler). The issue arises when an error occurs during signal frame processing, leading to sframe_xlate_ctx_cleanup freeing memory but not resetting pointers and counts. This results in dangling pointers being copied to the output FDE structure, causing a crash when that data is written. A proposed patch and a related series aim to fix this by properly nullifying structure fields during cleanup.