From 5e83aaecfc2524e968f93826b691535ef0b5cede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Iv=C3=A1n=20L=C3=B3pez=20Gonz=C3=A1lez?= Date: Thu, 27 Jun 2024 09:35:12 +0100 Subject: [PATCH] fix(storage): avoid error in storage actions (hot-fix) --- service/lib/agama/storage/manager.rb | 21 ++++++++++++++++++++- service/package/rubygem-agama-yast.changes | 6 ++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/service/lib/agama/storage/manager.rb b/service/lib/agama/storage/manager.rb index a880adf3cc..a91f4c141a 100644 --- a/service/lib/agama/storage/manager.rb +++ b/service/lib/agama/storage/manager.rb @@ -171,7 +171,26 @@ def actions probed = Y2Storage::StorageManager.instance.probed staging = Y2Storage::StorageManager.instance.staging - ActionsGenerator.new(probed, staging).generate + # FIXME: This is a hot-fix to avoid segmentation fault in the actions, see + # https://github.com/openSUSE/agama/issues/1396. + # + # Source of the problem: + # * An actiongraph is generated from the target devicegraph. + # * The list of compound actions is recovered from the actiongraph. + # * No refrence to the actiongraph is kept, so the object is a candidate to be cleaned by + # the ruby GC. + # * Accessing to the generated actions raises a segmentation fault if the actiongraph was + # cleaned. + # + # There was a previous attempt of fixing the issue by keeping a reference to the + # actiongraph in the ActionsGenerator object. But that solution is not enough because + # the ActionGenerator object is also cleaned up. + # + # As a hot-fix, the generator is kept in an instance variable to avoid the GC to kill it. + # A better solution is needed, for example, by avoiding to store an instance of a compound + # action in the Action object. + @generator = ActionsGenerator.new(probed, staging) + @generator.generate end # Changes the service's locale diff --git a/service/package/rubygem-agama-yast.changes b/service/package/rubygem-agama-yast.changes index 8d358c5ca1..c267b7ce6b 100644 --- a/service/package/rubygem-agama-yast.changes +++ b/service/package/rubygem-agama-yast.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 27 08:36:13 UTC 2024 - José Iván López González + +- Avoid error in storage actions (hot-fix) + (gh#openSUSE/agama#1400). + ------------------------------------------------------------------- Wed Jun 26 13:54:28 UTC 2024 - José Iván López González