Fix crash on subscriptions
When the subscription limit is hit, there is Subscription events
generated when Subscription objects are constructed. Unfortunately, we
make an accidental copy of the Subscription object in
include/persistent_data.hpp
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/72670
Is lined up to fix that issue, but we need to fix the underlying problem
where we have memory safety issues in global variables.
This commit is something to fix the issue, by simply destroying the
object causing the problem before more events can be received.
Tested:
Followed instructions on the aforementioned commit to create the max
number of subscriptions.
Called systemctl restart bmcweb
Observed no more crash on shutdown.
Change-Id: Ie52545f5cb8a044c186d0e9db47362e170b1fdb5
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/src/webserver_run.cpp b/src/webserver_run.cpp
index 29683b9..5013669 100644
--- a/src/webserver_run.cpp
+++ b/src/webserver_run.cpp
@@ -110,5 +110,8 @@
crow::connections::systemBus = nullptr;
+ // TODO(ed) Make event log monitor an RAII object instead of global vars
+ redfish::EventServiceManager::stopEventLogMonitor();
+
return 0;
}