Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  16 Sep 2024, Marius Köppel, Bug Report, Crash using ODB watch test_fe.cpp
    Reply  16 Sep 2024, Stefan Ritt, Bug Report, Crash using ODB watch 
       Reply  16 Sep 2024, Marius Koeppel, Bug Report, Crash using ODB watch 
          Reply  16 Sep 2024, Stefan Ritt, Bug Report, Crash using ODB watch 
             Reply  16 Sep 2024, Marius Koeppel, Bug Report, Crash using ODB watch 
                Reply  16 Sep 2024, Mark Grimes, Bug Report, Crash using ODB watch 
       Reply  17 Sep 2024, Konstantin Olchanski, Bug Report, Crash using ODB watch 
          Reply  18 Sep 2024, Marius Koeppel, Bug Report, Crash using ODB watch 
             Reply  20 Sep 2024, Stefan Ritt, Bug Report, Crash using ODB watch 
Message ID: 2853     Entry time: 20 Sep 2024     In reply to: 2852
Author: Stefan Ritt 
Topic: Bug Report 
Subject: Crash using ODB watch 
The problem has been fixed in the current version. Here is my analysis:

- the midas::odb object *can* go out of scope in the function, since the odb::watch() function creates a deep copy of the object. 
This does not cause a memory leak if one call odb::unwatch_all() at the end of a program.

- The creation from XML had a flaw where the ODB key handle ("hKey") is not initialized since it is not passed by the db_copy_xml() function.
I added code to db_copy_xml() to also fetch the key handle in the XML file, which now fixes the issue. Please note that you have to
update both the server and client side of midas to get this functionality if you are using it by a remote client.

- I saw the flag MK added on his pull request to the constructor of odb::odb(). This is a way to fight the symptoms (by creating an
object the "old" way if not otherwise needed, but how we have the cause cured. Nevertheless I added that parameter, but set to to true by default:

   odb::odb(const std::string &str, bool init_via_xml = true);

since this should be fully working now and should always be faster than the old method. I only keep it for debugging should we observe
another flaw in odb_from_xml(). 

Best regards,
Stefan
ELOG V3.1.4-2e1708b5