Hello community, here is the log from the commit of package yast2-core for openSUSE:Factory checked in at 2020-06-27 23:21:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-core (Old) and /work/SRC/openSUSE:Factory/.yast2-core.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-core" Sat Jun 27 23:21:37 2020 rev:186 rq:815970 version:4.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-core/yast2-core.changes 2020-05-13 22:59:06.491363268 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-core.new.3060/yast2-core.changes 2020-06-27 23:21:45.845661276 +0200 @@ -1,0 +2,7 @@ +Fri Jun 19 07:53:36 UTC 2020 - Martin Vidner <[email protected]> + +- Save memory by SCR.UnmountAgent telling other-process agents + to terminate (bsc#1172139) +- 4.3.1 + +------------------------------------------------------------------- Old: ---- yast2-core-4.3.0.tar.bz2 New: ---- yast2-core-4.3.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-core.spec ++++++ --- /var/tmp/diff_new_pack.S4X6OA/_old 2020-06-27 23:21:46.613663801 +0200 +++ /var/tmp/diff_new_pack.S4X6OA/_new 2020-06-27 23:21:46.617663815 +0200 @@ -27,7 +27,7 @@ %bcond_with werror Name: yast2-core -Version: 4.3.0 +Version: 4.3.1 Release: 0 Url: https://github.com/yast/yast-core ++++++ yast2-core-4.3.0.tar.bz2 -> yast2-core-4.3.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.3.0/liby2/src/Y2CCProgram.cc new/yast2-core-4.3.1/liby2/src/Y2CCProgram.cc --- old/yast2-core-4.3.0/liby2/src/Y2CCProgram.cc 2020-05-12 18:02:52.000000000 +0200 +++ new/yast2-core-4.3.1/liby2/src/Y2CCProgram.cc 2020-06-19 16:08:53.000000000 +0200 @@ -94,6 +94,13 @@ if (S_ISREG (buf.st_mode) && ((buf.st_mode & S_IXOTH) == S_IXOTH)) { if (!root.empty ()) file = file.substr (root.length ()); + // NOTE(ownership/memory management) + // + // Y2ComponentCreator says that we should own the components + // that we create. Notably Y2CCAgentComp does + // but this class doesn't, leaking memory. + // For a quick win, SCRSubAgent deletes its Y2ProgramComponent. + // If this class ever owns the comp, revert SCRSubAgent. return new Y2ProgramComponent (root, file.c_str (), name, creates_non_y2, level); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.3.0/package/yast2-core.changes new/yast2-core-4.3.1/package/yast2-core.changes --- old/yast2-core-4.3.0/package/yast2-core.changes 2020-05-12 18:02:52.000000000 +0200 +++ new/yast2-core-4.3.1/package/yast2-core.changes 2020-06-19 16:08:53.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Jun 19 07:53:36 UTC 2020 - Martin Vidner <[email protected]> + +- Save memory by SCR.UnmountAgent telling other-process agents + to terminate (bsc#1172139) +- 4.3.1 + +------------------------------------------------------------------- Tue May 12 11:15:20 UTC 2020 - Josef Reidinger <[email protected]> - Fixed building with new bison 3.6 (bsc#1171505) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.3.0/package/yast2-core.spec new/yast2-core-4.3.1/package/yast2-core.spec --- old/yast2-core-4.3.0/package/yast2-core.spec 2020-05-12 18:02:52.000000000 +0200 +++ new/yast2-core-4.3.1/package/yast2-core.spec 2020-06-19 16:08:53.000000000 +0200 @@ -26,7 +26,7 @@ %bcond_with werror Name: yast2-core -Version: 4.3.0 +Version: 4.3.1 Release: 0 Url: https://github.com/yast/yast-core diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.3.0/scr/src/SCRSubAgent.cc new/yast2-core-4.3.1/scr/src/SCRSubAgent.cc --- old/yast2-core-4.3.0/scr/src/SCRSubAgent.cc 2020-05-12 18:02:52.000000000 +0200 +++ new/yast2-core-4.3.1/scr/src/SCRSubAgent.cc 2020-06-19 16:08:53.000000000 +0200 @@ -16,6 +16,7 @@ #include <ycp/y2log.h> #include <y2/Y2ComponentBroker.h> +#include <y2/Y2ProgramComponent.h> #include "SCRSubAgent.h" int @@ -112,5 +113,17 @@ void SCRSubAgent::unmount () { - my_comp = 0; + // In general, a Y2Component is owned by its Y2ComponentCreator. + // In practice, only some subclasses of Y2ComponentCreator + // delete the components they own; the others leak. + // Also it prevents UnmountAgent from working. + // Here we cheat and steal Y2ProgramComponent from Y2CCProgram, + // which is fine since that class does not delete the component it creates. + auto prog_comp = dynamic_cast<Y2ProgramComponent *>(my_comp); + if (prog_comp) { + prog_comp->result(YCPNull()); + delete prog_comp; + } + + my_comp = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.3.0/scr/src/SCRSubAgent.h new/yast2-core-4.3.1/scr/src/SCRSubAgent.h --- old/yast2-core-4.3.0/scr/src/SCRSubAgent.h 2020-05-12 18:02:52.000000000 +0200 +++ new/yast2-core-4.3.1/scr/src/SCRSubAgent.h 2020-06-19 16:08:53.000000000 +0200 @@ -71,6 +71,13 @@ /** * The component. 0 means not created (mounted). + * + * FIXME: all components are supposed to be owned + * by their respective Y2ComponentCreator, but in practice + * many creators don't care, + * so this class takes a vigilante approach to delete my_comp + * if the component is_a Y2ProgramComponent whose Y2CCProgram + * is known not to care. */ Y2Component *my_comp;
