Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2026-11-05 18:27:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.3759290 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Thu Nov 5 18:27:44 2026 rev:361 rq:1394755 version:4.5.368 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2026-10-31 23:06:40.834733336 +0100 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.3759290/libstorage-ng.changes 2026-11-05 18:27:47.270391662 +0100 @@ -1,0 +2,6 @@ +Tue Nov 3 15:12:52 UTC 2026 - [email protected] + +- Translated using Weblate (Russian) (bsc#1149754) +- 4.5.368 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.5.366.tar.xz libstorage-ng-4.5.367.tar.xz New: ---- libstorage-ng-4.5.368.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.295cpl/_old 2026-11-05 18:27:48.166428977 +0100 +++ /var/tmp/diff_new_pack.295cpl/_new 2026-11-05 18:27:48.169429102 +0100 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.5.367 +Version: 4.5.368 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.5.366.tar.xz -> libstorage-ng-4.5.368.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.366/VERSION new/libstorage-ng-4.5.368/VERSION --- old/libstorage-ng-4.5.366/VERSION 2026-10-27 14:47:27.000000000 +0100 +++ new/libstorage-ng-4.5.368/VERSION 2026-11-03 18:13:54.000000000 +0100 @@ -1 +1 @@ -4.5.366 +4.5.368 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.366/bindings/ruby/storage-ruby.i new/libstorage-ng-4.5.368/bindings/ruby/storage-ruby.i --- old/libstorage-ng-4.5.366/bindings/ruby/storage-ruby.i 2026-10-27 14:47:27.000000000 +0100 +++ new/libstorage-ng-4.5.368/bindings/ruby/storage-ruby.i 2026-11-03 18:13:54.000000000 +0100 @@ -4,8 +4,86 @@ %{ #include <sstream> + +#include "storage/Utils/Logger.h" + +namespace storage +{ + + /** + * Logger that is set as the current logger instead of the logger set from Ruby (usually a + * director object). + * + * Since SWIG 4.5 the destructor of a wrapped object, e.g. of a Storage, can be run by the + * garbage collector of Ruby while sweeping. Destructors can log and, since the logger is + * implemented in Ruby, that executes Ruby code, which is not allowed during the garbage + * collection (Ruby aborts with "object allocation during garbage collection phase"). + * + * So during the garbage collection nothing is logged and the logger from Ruby is not called. + */ + class GcSafeLogger : public Logger + { + public: + + Logger* get_target() const { return target; } + void set_target(Logger* target) { this->target = target; } + + virtual bool test(LogLevel log_level, const std::string& component) override + { + if (!target || rb_during_gc()) + return false; + + return target->test(log_level, component); + } + + virtual void write(LogLevel log_level, const std::string& component, const std::string& file, + int line, const std::string& function, const std::string& content) override + { + if (!target || rb_during_gc()) + return; + + target->write(log_level, component, file, line, function, content); + } + + private: + + Logger* target = nullptr; + + }; + + + static GcSafeLogger gc_safe_logger; + + + Logger* get_ruby_logger() + { + return gc_safe_logger.get_target(); + } + + + void set_ruby_logger(Logger* logger) + { + gc_safe_logger.set_target(logger); + + set_logger(logger ? &gc_safe_logger : nullptr); + } + +} %} +// Storage.logger and Storage.logger= use the GcSafeLogger. The wrapper code (argument +// conversion, return value) is not changed, only the called function. + +%feature("action") storage::get_logger +{ + result = storage::get_ruby_logger(); +} + +%feature("action") storage::set_logger +{ + storage::set_ruby_logger(arg1); +} + %rename("empty?") "empty"; %rename("%(regex:/^(get_)(.*)/\\2/)s") ""; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.366/bindings/ruby/testsuite/Makefile.am new/libstorage-ng-4.5.368/bindings/ruby/testsuite/Makefile.am --- old/libstorage-ng-4.5.366/bindings/ruby/testsuite/Makefile.am 2026-10-27 14:47:27.000000000 +0100 +++ new/libstorage-ng-4.5.368/bindings/ruby/testsuite/Makefile.am 2026-11-03 18:13:54.000000000 +0100 @@ -3,7 +3,7 @@ # check_SCRIPTS = polymorphism.rb sid.rb all-types.rb logger.rb function-call.rb \ - to_s.rb + to_s.rb logger-gc.rb TESTS = $(check_SCRIPTS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.366/bindings/ruby/testsuite/logger-gc.rb new/libstorage-ng-4.5.368/bindings/ruby/testsuite/logger-gc.rb --- old/libstorage-ng-4.5.366/bindings/ruby/testsuite/logger-gc.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.5.368/bindings/ruby/testsuite/logger-gc.rb 2026-11-03 18:13:54.000000000 +0100 @@ -0,0 +1,80 @@ +#!/usr/bin/ruby + +require 'test/unit' +require 'tmpdir' +require 'storage' + + +# Destructors of wrapped objects can be run by the garbage collector (since SWIG 4.5 even +# while sweeping) and they can log, e.g. the destructor of Storage logs if the temporary +# directory cannot be removed. The logger is implemented in Ruby and Ruby code must not be run +# during the garbage collection. + +class MyLogger < Storage::Logger + + attr_reader :lines + + def initialize + super + @lines = 0 + end + + def write(level, component, filename, line, function, content) + @lines += 1 + end + +end + + +class TestLoggerGc < Test::Unit::TestCase + + def new_storage + environment = Storage::Environment.new(true, Storage::ProbeMode_NONE, Storage::TargetMode_DIRECT) + Storage::Storage.new(environment) + end + + def test_logging_in_destructor_during_gc + + Dir.mktmpdir do |tmpdir| + + old_tmpdir = ENV['TMPDIR'] + ENV['TMPDIR'] = tmpdir + + begin + + logger = MyLogger.new + Storage::logger = logger + + # The storage objects are kept in a list so that the garbage collector cannot destroy any of + # them before all temporary directories are removed. + storages = Array.new(20) { new_storage } + + # The temporary directories of the storage objects are removed so that their destructors + # log an error. + Dir.children(tmpdir).each { |name| Dir.rmdir(File.join(tmpdir, name)) } + + storages.clear + + # The storage objects are destroyed by the garbage collector. + GC.start + + # Logging still works after the garbage collection. + + assert_not_nil(Storage::logger) + + lines = logger.lines + storage = new_storage + assert(logger.lines > lines) + + ensure + + Storage::logger = nil + ENV['TMPDIR'] = old_tmpdir + + end + + end + + end + +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.366/po/ru.po new/libstorage-ng-4.5.368/po/ru.po --- old/libstorage-ng-4.5.366/po/ru.po 2026-10-27 14:47:27.000000000 +0100 +++ new/libstorage-ng-4.5.368/po/ru.po 2026-11-03 18:13:54.000000000 +0100 @@ -5,7 +5,7 @@ "Project-Id-Version: libstorage.ru\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-09-10 09:59+0200\n" -"PO-Revision-Date: 2026-02-16 16:04+0000\n" +"PO-Revision-Date: 2026-11-03 17:13+0000\n" "Last-Translator: Aleksey Fedorov <[email protected]>\n" "Language-Team: Russian <https://l10n.opensuse.org/projects/libstorage/ng-" "master/ru/>\n" @@ -15,7 +15,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.15.2\n" +"X-Generator: Weblate 2026.11\n" msgid "" "\n" @@ -1956,7 +1956,7 @@ #. TRANSLATORS: name of partition type msgid "Extended Boot Loader" -msgstr "" +msgstr "Расширенный загрузчик" #. TRANSLATORS: name of partition type msgid "Extended Partition"
