Back Midas Rome Roody Rootana
  Midas DAQ System, Page 1 of 151  Not logged in ELOG logo
ID Date Author Topic Subject
  3055   10 Jun 2025 Konstantin OlchanskiBug ReportMemory leak in mhttpd binary RPC code
I confirm that MJSON_ARRAYBUFFER does not work correctly for zero-size buffers, 
buffer is leaked in the destructor and copied as NULL in MJsonNode::Copy().

I also confirm memory leak in mjsonrpc "brpc" error path (already fixed).

Affected by the MJSON_ARRAYBUFFER memory leak are "brpc" (where user code returns 
a zero-size data buffer) and "js_read_binary_file" (if reading from an empty 
file, return of "new char[0]" is never freed).

"receive_event" and "read_history" RPCs never use zero-size buffers and are not 
affected by this bug.

mjson commit c798c1f0a835f6cea3e505a87bbb4a12b701196c
midas commit 576f2216ba2575b8857070ce7397210555f864e5
rootana commit a0d9bb4d8459f1528f0882bced9f2ab778580295

Please post bug reports a plain-text so I can quote from them.

K.O.
  3054   10 Jun 2025 Nik BergerBug ReportHistory variables with leading spaces
By accident we had history variables with leading spaces. The history schema check then decides that this is a new variable (the leading space is not read from the history file) and starts a new file. We found this because the run start became slow due to the many, many history files created. It would be nice to just get an error if one has a malformed variable name like this.

How to reproduce: Try to put a variable with a leading space in the name into the history, repeatedly start runs.
Sugested fix: Produce an error if a history variable has a leading space.
  3053   10 Jun 2025 Stefan RittInfouse of modified image showing MIDAS data format?
> Hello, I'm currently writing a paper about making a dataset publicly available 
> from the University of Minnesota and it's a MIDAS dataset.
> 
> I'd like to use an image that shows the MIDAS data format (that's been slightly 
> modified to fit in the paper) and am wondering (1) if I could get permission to do 
> so and (2) what the preferred attribution would be. 

Feel free to use whatever you like, the documentation is on the same open source license as midas itself.

Stefan
  3052   10 Jun 2025 Amy RobertsInfouse of modified image showing MIDAS data format?
Hello, I'm currently writing a paper about making a dataset publicly available 
from the University of Minnesota and it's a MIDAS dataset.

I'd like to use an image that shows the MIDAS data format (that's been slightly 
modified to fit in the paper) and am wondering (1) if I could get permission to do 
so and (2) what the preferred attribution would be. 
Attachment 1: MIDAS_format.png
MIDAS_format.png
  3051   07 Jun 2025 Mark GrimesBug ReportMemory leak in mhttpd binary RPC code

Hi,

We applied an intermediate fix for this locally and it seems to have fixed our issue.  The attached plot shows the percentage memory use on our machine with 128 Gb memory, as a rough proxy for mhttpd memory use.  After applying our fix mhttpd seems to be happy using ~7% of the memory after being up for 2.5 days.

Our fix to mjson was:

diff --git a/mjson.cxx b/mjson.cxx

index 17ee268..2443510 100644

--- a/mjson.cxx

+++ b/mjson.cxx

@@ -654,8 +654,7 @@ MJsonNode::~MJsonNode() // dtor

       delete subnodes[i];

    subnodes.clear();

 

-   if (arraybuffer_size > 0) {

-      assert(arraybuffer_ptr != NULL);

+   if (arraybuffer_ptr != NULL) {

       free(arraybuffer_ptr);

       arraybuffer_size = 0;

       arraybuffer_ptr = NULL;

We also applied the following in midas for good measure, although I don't think it contributed to the leak we were seeing:

diff --git a/src/mjsonrpc.cxx b/src/mjsonrpc.cxx

index 2201d228..38f0b99b 100644

--- a/src/mjsonrpc.cxx

+++ b/src/mjsonrpc.cxx

@@ -3454,6 +3454,7 @@ static MJsonNode* brpc(const MJsonNode* params)

    status = cm_connect_client(name.c_str(), &hconn);

 

    if (status != RPC_SUCCESS) {

+      free(buf);

       return mjsonrpc_make_result("status", MJsonNode::MakeInt(status));

    }

I hope this is useful to someone.  As previously mentioned we make heavy use of binary RPC, so maybe other experiments don't run into the same problem.

Thanks,

Mark.

Attachment 1: msysmon-mu3ebe-20250601-042124-20250606-122124.png
msysmon-mu3ebe-20250601-042124-20250606-122124.png
  3050   04 Jun 2025 Konstantin OlchanskiBug ReportMemory leak in mhttpd binary RPC code
Noted. I will look at this asap. K.O.

[quote="Mark Grimes"]Hi,
During an evening of running we noticed that memory usage of mhttpd grew to 
close to 100Gb.  We think we've traced this to the following issue when making 
RPC calls.

[LIST]
[*] The brpc method allocates memory for the response at 
[URL=https://bitbucket.org/tmidas/midas/src/67db8627b9ae381e5e28800dfc4c350c5bd0
5e3f/src/mjsonrpc.cxx#lines-3449]src/mjsonrpc.cxx#lines-3449[/URL].
[*] It then makes the call at 
[URL=https://bitbucket.org/tmidas/midas/src/67db8627b9ae381e5e28800dfc4c350c5bd0
5e3f/src/mjsonrpc.cxx#lines-3460]src/mjsonrpc.cxx#lines-3460[/URL], which may 
set `buf_length` to zero if the response was empty.
[*] It then uses `MJsonNode::MakeArrayBuffer` to pass ownership of the memory to 
an `MJsonNode`, providing `buf_length` as the size.
[*] When the `MJsonNode` is destructed at 
[URL=https://bitbucket.org/tmidas/mjson/src/9d01b3f72722bbf7bcec32ae218fcc0825cc
9e7f/mjson.cxx#lines-657]mjson.cxx#lines-657[/URL], it only calls `free` on the 
buffer if the size is greater than zero.
[/LIST]

Hence, mhttpd will leak at least 1024 bytes for every binary RPC call that 
returns an empty response.
I tried to submit a pull request to fix this but I don't have permission to push 
to https://bitbucket.org/tmidas/mjson.git.  Could somebody take a look?

Thanks,

Mark.[/quote]
  3049   04 Jun 2025 Mark GrimesBug ReportMemory leak in mhttpd binary RPC code
Hi,
During an evening of running we noticed that memory usage of mhttpd grew to close to 100Gb. We think we've traced this to the following issue when making RPC calls.

  • The brpc method allocates memory for the response at src/mjsonrpc.cxx#lines-3449.
  • It then makes the call at src/mjsonrpc.cxx#lines-3460, which may set `buf_length` to zero if the response was empty.
  • It then uses `MJsonNode::MakeArrayBuffer` to pass ownership of the memory to an `MJsonNode`, providing `buf_length` as the size.
  • When the `MJsonNode` is destructed at mjson.cxx#lines-657, it only calls `free` on the buffer if the size is greater than zero.

Hence, mhttpd will leak at least 1024 bytes for every binary RPC call that returns an empty response.
I tried to submit a pull request to fix this but I don't have permission to push to https://bitbucket.org/tmidas/mjson.git. Could somebody take a look?

Thanks,

Mark.
  3048   03 Jun 2025 Thomas LindnerInfoMIDAS workshop (online) Sept 22-23, 2025
Dear all,

We have setup an indico page for the MIDAS workshop on Sept 22-23.  The page is here

https://indico.psi.ch/event/17580/overview

As I mentioned, we are keen to hear reports from any users or developers; we want to hear  
how MIDAS is working for you and what improvements you would like to see.  If you or your 
experiment would like to give a talk about your MIDAS experiences then please submit an 
abstract through the indico page.  

Also, feel free to also register for the workshop (no fees).  Registration is not 
mandatory, but it would be useful for us to have an idea how many people will connect.

Thanks,
Thomas


> Dear MIDAS enthusiasts,
> 
> We are planning a fifth MIDAS workshop, following on from previous successful 
> workshops in 2015, 2017, 2019 and 2023.  The goals of the workshop include:
> 
> - Getting updates from MIDAS developers on new features, bug fixes and planned 
> changes.
> - Getting reports from MIDAS users on how they are using MIDAS and what problems 
> they are facing.
> - Making plans for future MIDAS changes and improvements
> 
> We are planning to have an online workshop on Sept 22-23, 2025 (it will coincide 
> with a visit of Stefan to TRIUMF).  We are tentatively planning to have a four 
> hour session on each day, with the sessions timed for morning in Vancouver and 
> afternoon/evening in Europe.  Sorry, the sessions are likely to again not be well 
> timed for our colleagues in Asia.  
> 
> We will provide exact times and more details closer to the date.  But I hope 
> people can mark the dates in their calendars; we are keen to hear from as much of 
> the MIDAS community as possible.  
> 
> Best Regards,
> Thomas Lindner
  3047   27 May 2025 Pavel MuratSuggestionhandling of 2+ like-long messages
Dear MIDAS experts, 

currently, the MIDAS messaging system is optimized for one-line long messages, 
so the content of 2+liners shows up in the message log in the reverse order, 
with the first line on the bottom of the message. 

I wonder if printing the message content in the reverse order, starting from the last line, 
would make sense ? - that wouldn't affect one-line long messages, but could make longer 
messages more useful. 

--thanks, regards, Pasha
  3046   26 May 2025 Stefan RittForumReading two devices in parallel
> Dear experts,
>       in the CYGNO experiment, we readout CMOS cameras for optical readout of GEM-TPCs. So far, we only developed the readout for a single camera. In the future, we will have multiple cameras to read out (up to 18 in the next phase of the experiment), and we are investigating how to optimize the readout by exploiting parallelization.
> 
> One idea is to start parallel threads within a single equipment. Alternatively, one could associate different equipment with each camera and run an Event Builder. Perhaps other solutions did not come to mind. Which one would you regard as the most effective and elegant?
> 
> Thank you very much,
>            Francesco

In principle both will work. It's kind of matter of taste. In the multi-threaded approach one has a single frontend to start and stop, and in the second case you have to start 18 individual frontends and make sure that they are running. 

For the multi-threaded frontend you have to ensure proper synchronization between the threads (like common run start/stop), and in the end you also have to do some event building, sending all 18 streams into a single buffer. As you know, multi-thread programming can be a bit of an art, using mutexes or semaphores, but it can be more flexible as the event builder which is a given piece of software.

Best,
Stefan
  3045   26 May 2025 Francesco RengaForumReading two devices in parallel
Dear experts,
      in the CYGNO experiment, we readout CMOS cameras for optical readout of GEM-TPCs. So far, we only developed the readout for a single camera. In the future, we will have multiple cameras to read out (up to 18 in the next phase of the experiment), and we are investigating how to optimize the readout by exploiting parallelization.

One idea is to start parallel threads within a single equipment. Alternatively, one could associate different equipment with each camera and run an Event Builder. Perhaps other solutions did not come to mind. Which one would you regard as the most effective and elegant?

Thank you very much,
           Francesco
  3044   25 May 2025 Pavel MuratBug Reportsubdirectory ordering in ODB browser ?
Dear MIDAS experts, 

I'm running into a minor but annoying issue with the subdirectory name ordering by the ODB browser. 
I have a straw-man hash map which includes ODB subdirectories named "000", "010", ... "300", 
and I'm yet to succeed to have them displayed in a "natural" order: the subdirectories with names 
starting from "0" always show up on the bottom of the list - see attached .png file. 

Neither interactive re-ordering nor manual ordering of the items in the input .json file helps. 

I have also attached a .json file which can be loaded with odbedit to reproduce the issue. 

Although I'm using a relatively recent - ~ 20 days old - commit, 'db1819ac', is it possible 
that this issue has already been sorted out ?

-- many thanks, regards, Pasha  
Attachment 1: panel_map.json
{
  "/MIDAS version" : "2.1",
  "/MIDAS git revision" : "Sat May 3 17:22:36 2025 +0200 - midas-2025-01-a-192-gdb1819ac-dirty on branch HEAD",
  "/filename" : "PanelMap.json",
  "/ODB path" : "/Test/PanelMap",
  "000" : {
  },
  "020" : {
  },
  "030" : {
  },
  "040" : {
  },
  "090" : {
  },
  "100" : {
  },
  "200" : {
  }
}
Attachment 2: panel_map.png
panel_map.png
  3043   24 May 2025 Pavel MuratInfoROOT scripting for MIDAS seems to work pretty much out of the box
Dear All, 

I'm pretty sure many know this already, however I found this feature by a an accident 
and want to share with those who don't know about it yet - seems very useful. 

- it looks that one can use ROOT scripting with rootcling and call from the 
  interactive ROOT prompt any function defined in midas.h and access ODB seemingly 
  WITHOUT DOING anything special 

- more surprisingly, that also works for odbxx, with one minor exception in handling 
  the 64-bit types - the proof is in attachment. The script test_odbxx.C loaded 
  interactively is Stefan's

 https://bitbucket.org/tmidas/midas/src/develop/examples/odbxx/odbxx_test.cxx 

with one minor change - the line 
 
   o[Int64 Key] = -1LL;

is replaced with

   int64_t x = -1LL;
   o["Int64 Key"] = x;

- apparently the interpeter has its limitations. 

My rootlogon.C file doesn't load any libraries, it only defines the appropriate 
include paths. So it seems that everything works pretty much out of the box. 

One issue has surfaced however. All that worked despite my experiment 
had its name="test_025", while the example specifies experiment="test". 
Is it possible that that only first 4 characters are being tested ? 

-- regards, Pasha
Attachment 1: log.txt
mu2etrk@mu2edaq22:~/test_stand/daquser_001>root.exe
   ------------------------------------------------------------------
  | Welcome to ROOT 6.32.06                        https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on May 04 2025, 19:16:31                 |
  | From tags/6-32-06@6-32-06                                        |
  | With g++ (Spack GCC) 13.1.0                                      |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

05-24 23:26:22.397661                       MetricManager:31     INFO MetricManager(): MetricManager CONSTRUCTOR
root [0] .L test_odbxx.C 
root [1] main()
Delete key /Test/Settings not found in ODB
Created ODB key "/Test/Settings"
Created ODB key "/Test/Settings/Int32 Key"
Set ODB key "/Test/Settings/Int32 Key" = 42
Created ODB key "/Test/Settings/Bool Key"
Set ODB key "/Test/Settings/Bool Key" = true
Created ODB key "/Test/Settings/Subdir"
Created ODB key "/Test/Settings/Subdir/Int32 key"
Set ODB key "/Test/Settings/Subdir/Int32 key" = 123
Created ODB key "/Test/Settings/Subdir/Double Key"
Set ODB key "/Test/Settings/Subdir/Double Key" = 1.200000
Created ODB key "/Test/Settings/Subdir/Subsub"
Created ODB key "/Test/Settings/Subdir/Subsub/Float key"
Set ODB key "/Test/Settings/Subdir/Subsub/Float key" = 1.200000
Created ODB key "/Test/Settings/Subdir/Subsub/String Key"
Set ODB key "/Test/Settings/Subdir/Subsub/String Key" = "Hello"
Created ODB key "/Test/Settings/Int Array"
Set ODB key "/Test/Settings/Int Array[0...2]" = [1,2,3]
Created ODB key "/Test/Settings/Double Array"
Set ODB key "/Test/Settings/Double Array[0...2]" = [1.200000,2.300000,3.400000]
Created ODB key "/Test/Settings/String Array"
Set ODB key "/Test/Settings/String Array[0...2]" = ["Hello1","Hello2","Hello3"]
Created ODB key "/Test/Settings/Large Array"
Set ODB key "/Test/Settings/Large Array[0...9]" = [0,0,0,0,0,0,0,0,0,0]
Created ODB key "/Test/Settings/Large String"
Set ODB key "/Test/Settings/Large String" = ""
Created ODB key "/Test/Settings/String Array 10"
Set ODB key "/Test/Settings/String Array 10[0...9]" = ["","","","","","","","","",""]
Created ODB key "/Test/Settings/Large String Array 10"
Set ODB key "/Test/Settings/Large String Array 10[0...9]" = ["","","","","","","","","",""]
Get definition for ODB key "/Test/Settings"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get ODB key "/Test/Settings/Int32 Key": 42
Get definition for ODB key "/Test/Settings/Bool Key"
Get definition for ODB key "/Test/Settings/Bool Key"
Get ODB key "/Test/Settings/Bool Key": true
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Int Array"
Get definition for ODB key "/Test/Settings/Int Array"
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Get definition for ODB key "/Test/Settings/Double Array"
Get definition for ODB key "/Test/Settings/Double Array"
Get ODB key "/Test/Settings/Double Array[0...2]": [1.200000,2.300000,3.400000]
Get definition for ODB key "/Test/Settings/String Array"
Get definition for ODB key "/Test/Settings/String Array"
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Get definition for ODB key "/Test/Settings/Large Array"
Get definition for ODB key "/Test/Settings/Large Array"
Get ODB key "/Test/Settings/Large Array[0...9]": [0,0,0,0,0,0,0,0,0,0]
Get definition for ODB key "/Test/Settings/Large String"
Get definition for ODB key "/Test/Settings/Large String"
Get ODB key "/Test/Settings/Large String": ""
Get definition for ODB key "/Test/Settings/String Array 10"
Get definition for ODB key "/Test/Settings/String Array 10"
Get ODB key "/Test/Settings/String Array 10[0...9]": [",,,,,,,,,"]
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get ODB key "/Test/Settings/Large String Array 10[0...9]": [",,,,,,,,,"]
Get definition for ODB key "/Test/Settings"
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get definition for ODB key "/Test/Settings/Int32 Key"
Get ODB key "/Test/Settings/Int32 Key": 42
Get definition for ODB key "/Test/Settings/Bool Key"
Get definition for ODB key "/Test/Settings/Bool Key"
Get ODB key "/Test/Settings/Bool Key": true
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get definition for ODB key "/Test/Settings/Subdir/Int32 key"
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get definition for ODB key "/Test/Settings/Subdir/Double Key"
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Subdir/Subsub"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/Float key"
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get definition for ODB key "/Test/Settings/Subdir/Subsub/String Key"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get definition for ODB key "/Test/Settings/Int Array"
Get definition for ODB key "/Test/Settings/Int Array"
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Get definition for ODB key "/Test/Settings/Double Array"
Get definition for ODB key "/Test/Settings/Double Array"
Get ODB key "/Test/Settings/Double Array[0...2]": [1.200000,2.300000,3.400000]
Get definition for ODB key "/Test/Settings/String Array"
Get definition for ODB key "/Test/Settings/String Array"
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Get definition for ODB key "/Test/Settings/Large Array"
Get definition for ODB key "/Test/Settings/Large Array"
Get ODB key "/Test/Settings/Large Array[0...9]": [0,0,0,0,0,0,0,0,0,0]
Get definition for ODB key "/Test/Settings/Large String"
Get definition for ODB key "/Test/Settings/Large String"
Get ODB key "/Test/Settings/Large String": ""
Get definition for ODB key "/Test/Settings/String Array 10"
Get definition for ODB key "/Test/Settings/String Array 10"
Get ODB key "/Test/Settings/String Array 10[0...9]": [",,,,,,,,,"]
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get definition for ODB key "/Test/Settings/Large String Array 10"
Get ODB key "/Test/Settings/Large String Array 10[0...9]": [",,,,,,,,,"]
Get ODB key "/Test/Settings/Int32 Key": 42
Get ODB key "/Test/Settings/Bool Key": true
Get ODB key "/Test/Settings/Subdir/Int32 key": 123
Get ODB key "/Test/Settings/Subdir/Double Key": 1.200000
Get ODB key "/Test/Settings/Subdir/Subsub/Float key": 1.200000
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Get ODB key "/Test/Settings/Double Array[0...2]": [1.200000,2.300000,3.400000]
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Get ODB key "/Test/Settings/Large Array[0...9]": [0,0,0,0,0,0,0,0,0,0]
Get ODB key "/Test/Settings/Large String": ""
Get ODB key "/Test/Settings/String Array 10[0...9]": [",,,,,,,,,"]
Get ODB key "/Test/Settings/Large String Array 10[0...9]": [",,,,,,,,,"]
"Settings": {
   "Int32 Key": 42,
   "Bool Key": true,
   "Subdir": {
      "Int32 key": 123,
      "Double Key": 1.200000,
      "Subsub": {
         "Float key": 1.200000,
         "String Key": "Hello"
      }
   },
   "Int Array": [1,2,3],
   "Double Array": [1.200000,2.300000,3.400000],
   "String Array": ["Hello1","Hello2","Hello3"],
   "Large Array": [0,0,0,0,0,0,0,0,0,0],
   "Large String": "",
   "String Array 10": ["","","","","","","","","",""],
   "Large String Array 10": ["","","","","","","","","",""]
}
Set ODB key "/Test/Settings/Int32 Key" = 42
Get ODB key "/Test/Settings/Int32 Key": 42
Set ODB key "/Test/Settings/Int32 Key" = 43
Get ODB key "/Test/Settings/Int32 Key": 43
Set ODB key "/Test/Settings/Int32 Key" = 44
Get ODB key "/Test/Settings/Int32 Key": 44
Set ODB key "/Test/Settings/Int32 Key" = 57
Should be 57: Get ODB key "/Test/Settings/Int32 Key": 57
57
Created ODB key "/Test/Settings/Int64 Key"
Set ODB key "/Test/Settings/Int64 Key" = -1
Get ODB key "/Test/Settings/Int64 Key": -1
AAAA:0xffffffffffffffff
Created ODB key "/Test/Settings/UInt64 Key"
Set ODB key "/Test/Settings/UInt64 Key" = 1311768465173141112
Get ODB key "/Test/Settings/UInt64 Key": 1311768465173141112
0x1234567812345678
Set ODB key "/Test/Settings/Bool Key" = false
Get ODB key "/Test/Settings/Bool Key": false
Set ODB key "/Test/Settings/Bool Key" = true
Set ODB key "/Test/Settings/Subdir/Subsub/String Key" = "Hello"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello"
Set ODB key "/Test/Settings/Subdir/Subsub/String Key" = "Hello world!"
Get ODB key "/Test/Settings/Subdir/Subsub/String Key": "Hello world!"
Set ODB key "/Test/Settings/Int32 Key" = 43
Get ODB key "/Test/Settings/Int Array[0...2]": [1,2,3]
Set ODB key "/Test/Settings/Int Array[0...2]" = [10,10,10]
Get ODB key "/Test/Settings/Int Array[1]": [10]
Set ODB key "/Test/Settings/Int Array[1]" = 2
Get ODB key "/Test/Settings/Int Array[1]": [2]
Get ODB key "/Test/Settings/Int Array[0...4]": [10,2,10,0,0]
Set ODB key "/Test/Settings/Int Array[0...4]" = [11,3,11,1,1]
Arrays size is 5
Set ODB key "/Test/Settings/Int Array[10]" = 0
Get ODB key "/Test/Settings/Int Array[10]": [0]
Set ODB key "/Test/Settings/Int Array[10]" = 10
Get ODB key "/Test/Settings/String Array[0...2]": ["Hello1,Hello2,Hello3"]
Set ODB key "/Test/Settings/String Array[0...2]" = ["Hello1","New String","Hello3"]
Get ODB key "/Test/Settings/String Array[2]": ["Hello3"]
Set ODB key "/Test/Settings/String Array[2]" = "Another String"
Set ODB key "/Test/Settings/String Array[3]" = ""
Get ODB key "/Test/Settings/String Array[3]": [""]
Set ODB key "/Test/Settings/String Array[3]" = "One more"
... 468 more lines ...
  3042   19 May 2025 Jonas A. KriegerSuggestionmanalyzer root output file with custom filename including run number
Hi all,

Would it be possible to extend manalyzer to support custom .root file names that include the run number? 

As far as I understand, the current behavior is as follows:
The default filename is ./root_output_files/output%05d.root , which can be customized by the following two command line arguments.

-Doutputdirectory: Specify output root file directory
-Ooutputfile.root: Specify output root file filename

If an output file name is specified with -O, -D is ignored, so the full path should be provided to -O. 

I am aiming to write files where the filename contains sufficient information to be unique (e.g., experiment, year, and run number). However, if I specify it with -O, this would require restarting manalyzer after every run; a scenario that I would like to avoid if possible.

Please find a suggestion of how manalyzer could be extended to introduce this functionality through an additional command line argument at
https://bitbucket.org/krieger_j/manalyzer/commits/24f25bc8fe3f066ac1dc576349eabf04d174deec

Above code would allow the following call syntax: ' ./manalyzer.exe -O/data/experiment1_%06d.root --OutputNumbered '
But note that as is, it would fail if a user specifies an incompatible format such as -Ooutput%s.root . 

So a safer, but less flexible option might be to instead have the user provide only a prefix, and then attach %05d.root in the code.

Thank you for considering these suggestions!
  3041   16 May 2025 Konstantin OlchanskiBug Reporthistory_schema.cxx fails to build
> > we have a CI setup which fails since 06.05.2025 to build the history_schema.cxx.
> > There was a major change in this code in the commits fe7f6a6 and 159d8d3.
> 
> Missing from this report is critical information: HAVE_PGSQL is set.
> 
> I will have to check why it is not set in my development account.
> 

The following is needed to build MySQL and PgSQL support in MIDAS,
they were missing on my development machine. MySQL support was enabled
by accident because kde-bloat packages pull in the MySQL (not the MariaDB)
client and server. Fixed now, added to standard list of Ubuntu packages:
https://daq00.triumf.ca/DaqWiki/index.php/Ubuntu#install_missing_packages

apt -y install mariadb-client libmariadb-dev ### mysql client for MIDAS
apt -y install postgresql-common libpq-dev ### postgresql client for MIDAS

>
> I will have to check why it is not set in our bitbucket build.
> 

Added MySQL and PgSQL to bitbucket Ubuntu-24 build (sqlite was already enabled).

>
> Thank you for reporting this problem.
> 

Fix committed. Sorry about this problem.

K.O.
  3040   16 May 2025 Konstantin OlchanskiBug Reporthistory_schema.cxx fails to build
> we have a CI setup which fails since 06.05.2025 to build the history_schema.cxx.
> There was a major change in this code in the commits fe7f6a6 and 159d8d3.

Missing from this report is critical information: HAVE_PGSQL is set.

I will have to check why it is not set in my development account.

I will have to check why it is not set in our bitbucket build.

Thank you for reporting this problem.

K.O.
  3039   16 May 2025 Marius KoeppelBug Reporthistory_schema.cxx fails to build
Hi all,

we have a CI setup which fails since 06.05.2025 to build the history_schema.cxx. There was a major change in this code in the commits fe7f6a6 and 159d8d3.

image: rootproject/root:latest

pipelines:
  default:
    - step:
        name: 'Build and test'
        runs-on:
          - self.hosted
          - linux
        script:
          - apt-get update
          - DEBIAN_FRONTEND=noninteractive apt-get -y install python3-all python3-pip python3-pytest-dependency python3-pytest
          - DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ cmake git python3-all libssl-dev libz-dev libcurl4-gnutls-dev sqlite3 libsqlite3-dev libboost-all-dev linux-headers-generic
          - gcc -v
          - cmake --version
          - git clone https://marius_koeppel@bitbucket.org/tmidas/midas.git
          - cd midas
          - git submodule update --init --recursive
          - mkdir build
          - cd build
          - cmake ..
          - make -j4 install


Error is:

/opt/atlassian/pipelines/agent/build/midas/src/history_schema.cxx:5991:10: error: ‘class HsSqlSchema’ has no member named ‘table_name’; did you mean ‘fTableName’?

 5991 |       s->table_name = xtable_name;

      |          ^~~~~~~~~~

      |          fTableName

/opt/atlassian/pipelines/agent/build/midas/src/history_schema.cxx: In member function ‘virtual int PgsqlHistory::read_column_names(HsSchemaVector*, const char*, const char*)’:

/opt/atlassian/pipelines/agent/build/midas/src/history_schema.cxx:6034:14: error: ‘class HsSqlSchema’ has no member named ‘table_name’; did you mean ‘fTableName’?

 6034 |       if (s->table_name != table_name)

      |              ^~~~~~~~~~

      |              fTableName

/opt/atlassian/pipelines/agent/build/midas/src/history_schema.cxx:6065:16: error: ‘struct HsSchemaEntry’ has no member named ‘fNumBytes’

 6065 |             se.fNumBytes = 0;

      |                ^~~~~~~~~

/opt/atlassian/pipelines/agent/build/midas/src/history_schema.cxx:6140:30: error: ‘__gnu_cxx::__alloc_traits<std::allocator<HsSchemaEntry>, HsSchemaEntry>::value_type’ {aka ‘struct HsSchemaEntry’} has no member named ‘fNumBytes’

 6140 |             s->fVariables[j].fNumBytes = tid_size;

      |                              ^~~~~~~~~

At global scope:

cc1plus: note: unrecognized command-line option ‘-Wno-vla-cxx-extension’ may have been intended to silence earlier diagnostics

make[2]: *** [CMakeFiles/objlib.dir/build.make:384: CMakeFiles/objlib.dir/src/history_schema.cxx.o] Error 1

make[2]: *** Waiting for unfinished jobs....

make[1]: *** [CMakeFiles/Makefile2:404: CMakeFiles/objlib.dir/all] Error 2

make: *** [Makefile:136: all] Error 2
  3038   05 May 2025 Stefan RittInfodb_delete_key(TRUE)
I would handle this actually like symbolic links are handled under linux. If you delete a symbolic link, the link gets 
detected and NOT the file the link is pointing to.

So I conclude that the "follow links" is a misconception and should be removed.

Stefan
  3037   05 May 2025 Stefan RittBug Reportabort and core dump in cm_disconnect_experiment()
I would be in favor of not curing the symptoms, but fixing the cause of the problem. I guess you put the watchdog disable into mhist, right? Usually mhist is called locally, so no mserver should be 
involved. If not, I would prefer to propagate the watchdog disable to the mserver side as well, if that's not been done already. Actually I never would disable the watchdog, but set it to a reasonable 
maximal value, like a few minutes or so. In that case, the client gets still removed if it crashes for some reason.

My five cents,
Stefan 
  3036   05 May 2025 Konstantin OlchanskiBug Reportabort and core dump in cm_disconnect_experiment()
I noticed that some programs like mhist, if they take too long, there is an abort and core dump at the very end. This is because they forgot to 
set/disable the watchdog timeout, and they got remove from odb and from the SYSMSG event buffer.

mhist is easy to fix, just add the missing call to disable the watchdog, but I also see a similar crash in the mserver which of course requires 
the watchdog.

In either case, the crash is in cm_disconnect_experiment() where we know we are shutting down and we know there is no useful information in the 
core dump.

I think I will fix it by adding a flag to bm_close_buffer() to bypass/avoid the crash from "we are already removed from this buffer".

Stack trace from mhist:

[mhist,ERROR] [midas.cxx:5977:bm_validate_client_index,ERROR] My client index 6 in buffer 'SYSMSG' is invalid: client name '', pid 0 should be my 
pid 3113263
[mhist,ERROR] [midas.cxx:5980:bm_validate_client_index,ERROR] Maybe this client was removed by a timeout. See midas.log. Cannot continue, 
aborting...
bm_validate_client_index: My client index 6 in buffer 'SYSMSG' is invalid: client name '', pid 0 should be my pid 3113263
bm_validate_client_index: Maybe this client was removed by a timeout. See midas.log. Cannot continue, aborting...

Program received signal SIGABRT, Aborted.
Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
warning: 44	./nptl/pthread_kill.c: No such file or directory
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff71df27e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff71c28ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00005555555768b4 in bm_validate_client_index_locked (pbuf_guard=...) at /home/olchansk/git/midas/src/midas.cxx:5993
#6  0x000055555557ed7a in bm_get_my_client_locked (pbuf_guard=...) at /home/olchansk/git/midas/src/midas.cxx:6000
#7  bm_close_buffer (buffer_handle=1) at /home/olchansk/git/midas/src/midas.cxx:7162
#8  0x000055555557f101 in cm_msg_close_buffer () at /home/olchansk/git/midas/src/midas.cxx:490
#9  0x000055555558506b in cm_disconnect_experiment () at /home/olchansk/git/midas/src/midas.cxx:2904
#10 0x000055555556d2ad in main (argc=<optimized out>, argv=<optimized out>) at /home/olchansk/git/midas/progs/mhist.cxx:882
(gdb) 

Stack trace from mserver:

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=138048230684480) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=138048230684480) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=138048230684480) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=138048230684480, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007d8ddbc4e476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007d8ddbc347f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x000059beb439dab0 in bm_validate_client_index_locked (pbuf_guard=...) at /home/dsdaqdev/packages_common/midas/src/midas.cxx:5993
#6  0x000059beb43a859c in bm_get_my_client_locked (pbuf_guard=...) at /home/dsdaqdev/packages_common/midas/src/midas.cxx:6000
#7  bm_close_buffer (buffer_handle=<optimized out>) at /home/dsdaqdev/packages_common/midas/src/midas.cxx:7162
#8  0x000059beb43a89af in bm_close_all_buffers () at /home/dsdaqdev/packages_common/midas/src/midas.cxx:7256
#9  bm_close_all_buffers () at /home/dsdaqdev/packages_common/midas/src/midas.cxx:7243
#10 0x000059beb43afa20 in cm_disconnect_experiment () at /home/dsdaqdev/packages_common/midas/src/midas.cxx:2905
#11 0x000059beb43afdd8 in rpc_check_channels () at /home/dsdaqdev/packages_common/midas/src/midas.cxx:16317
#12 0x000059beb43b0cf5 in rpc_server_loop () at /home/dsdaqdev/packages_common/midas/src/midas.cxx:15858
#13 0x000059beb4390982 in main (argc=9, argv=0x7ffc07e5bed8) at /home/dsdaqdev/packages_common/midas/progs/mserver.cxx:387

K.O.
ELOG V3.1.4-2e1708b5