Skip to content

Commit

Permalink
fix(storage): avoid segmentation fault when generating actions (#1379)
Browse files Browse the repository at this point in the history
## Problem

In the Agama ISO there is a segmentation fault when generating the
storage actions, see #1377.

## Solution

Keep a reference to the used actiongraph to avoid the gargabe collector
to kill it.
  • Loading branch information
joseivanlopez authored Jun 26, 2024
2 parents 9720a29 + c5a2e0f commit 3428c4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 7 additions & 4 deletions service/lib/agama/storage/actions_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class ActionsGenerator
# param target_graph [Y2Storage::Devicegraph]
def initialize(system_graph, target_graph)
@system_graph = system_graph
@target_graph = target_graph
# It is important to keep a reference to the actiongraph. Otherwise, the gargabe collector
# could kill the actiongraph, leaving the compound actions orphan.
# See https://github.com/openSUSE/agama/issues/1377.
@actiongraph = target_graph.actiongraph
end

# All actions properly sorted.
Expand All @@ -44,8 +47,8 @@ def generate
# @return [Y2Storage::Devicegraph]
attr_reader :system_graph

# @return [Y2Storage::Devicegraph]
attr_reader :target_graph
# @return [Y2Storage::Actiongraph]
attr_reader :actiongraph

# Sorted main actions (everything except subvolume actions).
#
Expand All @@ -67,7 +70,7 @@ def subvolume_actions
#
# @return [Array<Action>]
def actions
@actions ||= target_graph.actiongraph.compound_actions.map do |action|
@actions ||= actiongraph.compound_actions.map do |action|
Action.new(action, system_graph)
end
end
Expand Down
10 changes: 8 additions & 2 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 26 09:12:33 UTC 2024 - José Iván López González <jlopez@suse.com>

- Fix segmentation fault in the storage actions
(gh#openSUSE/agama#1377).

-------------------------------------------------------------------
Wed Jun 26 08:25:56 UTC 2024 - Ladislav Slezák <lslezak@suse.com>

Expand Down Expand Up @@ -142,7 +148,7 @@ Wed Feb 7 11:49:02 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>
-------------------------------------------------------------------
Thu Feb 1 13:08:39 UTC 2024 - Josef Reidinger <jreidinger@suse.com>

- Log if multipath probing is misconfigured (bsc#1215598)
- Log if multipath probing is misconfigured (bsc#1215598)

-------------------------------------------------------------------
Mon Jan 29 13:51:30 UTC 2024 - José Iván López González <jlopez@suse.com>
Expand All @@ -165,7 +171,7 @@ Thu Jan 18 08:35:01 UTC 2024 - Ancor Gonzalez Sosa <ancor@suse.com>
Tue Jan 16 10:49:14 UTC 2024 - Michal Filka <mfilka@suse.com>

- bsc#1210541, gh#openSUSE/agama#516
- copy NM's runtime config created on dracut's request to the target
- copy NM's runtime config created on dracut's request to the target
-------------------------------------------------------------------
Thu Jan 11 15:32:44 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down

0 comments on commit 3428c4e

Please sign in to comment.