| ID |
Date |
Author |
Topic |
Subject |
|
2396
|
04 May 2022 |
Konstantin Olchanski | Bug Fix | mysql history update | the code for writing midas history to mysql has been updated to work against
MYSQL 8.0.23 (CERN ALPHA-2):
- as ever mysql reports inconsistent data types (I create column with type
"integer", mysql reports it has type "int" and so forth), the special kludge to
take care of this had to be tweaked.
- this caused some columns to be marked "inactive" and the code to "reactivate"
them was missing (fixed)
- binary history event data size was computed incorrectly for events with
"inactive" columns (fixed) and caused assert() failure and mlogger crash.
- mysql read of column definitions for history event "system" (as in
/history/links/system) bombed because of incorrect quoting (worked before, why?
why bombed now?). this caused duplicate columns to be created in mysql table
"system" and mlogger bomb-out with complaint about "duplicated columns"
(actually the error message was missing, so it was a silent bomb-out). quoting
fixed, missing error message fixed, but cleanup of duplicate columns has to be
done by hand. in case of alpha-2 the fix was to remove the unused
/history/links/system).
if you are using mysql history please update or patch src/history_schema.cxx.
commit 9d17d2fef233cf457121ca7c2a283c4c76ed33bc
K.O. |
|
1584
|
02 Jul 2019 |
Lukas Gerritzen | Suggestion | my_global.h not present in my linux distribution (needed) | Hey,
while trying to compile Midas under openSUSE 15.0 with mysql support, I was
running into the problem that somehow the mysql header file my_global.h is not
included in the packages. This might be a bug that concerns the suse developers
more, but is it actually needed? Compilation worked fine with the include line
commented out.
If it's not needed, I would like to suggest to remove line 735 of
src/history_schema.cxx (where it's included)
Cheers
Lukas
mysql Ver 15.1 Distrib 10.2.22-MariaDB, for Linux (x86_64) using EditLine wrapper
Also, all mariadb development packages are installed |
|
1585
|
02 Jul 2019 |
Konstantin Olchanski | Suggestion | my_global.h not present in my linux distribution (needed) | Confirmed. my_global.h is removed in MySQL 8.0 (gives a compile error) and deprecated in
MariaDB 10.2 (gives a #warning).
I removed include of my_global.h, it is not needed on el6, el7 and ubuntu.
Also added explicit support for mariadb via mariadb_config if it exists.
Note that the cmake build does not actually enable mysql, sqlite and odbc - it detects them, but
does not do anything about it. We will fix this shortly.
K.O.
> Hey,
>
> while trying to compile Midas under openSUSE 15.0 with mysql support, I was
> running into the problem that somehow the mysql header file my_global.h is not
> included in the packages. This might be a bug that concerns the suse developers
> more, but is it actually needed? Compilation worked fine with the include line
> commented out.
>
> If it's not needed, I would like to suggest to remove line 735 of
> src/history_schema.cxx (where it's included)
>
> Cheers
> Lukas
>
> mysql Ver 15.1 Distrib 10.2.22-MariaDB, for Linux (x86_64) using EditLine wrapper
> Also, all mariadb development packages are installed |
|
1586
|
03 Jul 2019 |
Lukas Gerritzen | Suggestion | my_global.h not present in my linux distribution (needed) | Thanks! |
|
2221
|
18 Jun 2021 |
Konstantin Olchanski | Bug Report | my html modbvalue thing is not working? | I have a web page and I try to use modbvalue, but nothing happens. The best I can tell, I follow the documentation
(https://midas.triumf.ca/MidasWiki/index.php/Custom_Page#modbvalue).
<td id=setv0><div class="modbvalue" data-odb-path="/Equipment/CAEN_hvps01/Settings/VSET[0]" data-odb-editable="1">(ch0)</div></td>
I suppose I could add debug logging to the javascript framework for modbvalue to find out why it is not seeing
or how it is not liking my web page.
But how would a non-expert user (or an expert user in a hurry) would debug this?
Should the modbvalue framework log more error messages to the javascrpt console ("I am ignoring your modbvalue entry because...")?
Should it have a debug mode where it reports to the javascript console all the tags it scanned, all the tags it found, etc
to give me some clue why it does not find my modbvalue tag?
Right now I am not even sure if this framework is activated, perhaps I did something wrong in how I load the page
and the modbvalue framework is not loaded. The documentation gives some magic incantations but does not explain
where and how this framework is loaded and activated. (But I do not see any differences between my page and
the example in the documentation. Except that I do not load control.js, I do not need all the thermometer bars, etc.
If I do load it, still my modbvalue does not work).
K.O. |
|
2232
|
25 Jun 2021 |
Stefan Ritt | Bug Report | my html modbvalue thing is not working? | Can you post your complete page here so that I can have a look?
Stefan |
|
1545
|
10 Jun 2019 |
Konstantin Olchanski | Release | mxml-2019-03-a, midas-2019-03-h | > > > the midas release 2019-03 is ready for general use.
> A bug fix update for midas-2019-03:
> odbedit "ver" should report: Thu Jun 6 18:02:14 2019 -0700 - midas-2019-03-h on branch feature/midas-2019-03
For building this release of MIDAS, please use mxml branch feature/midas-2019-03, tag mxml-2019-03-a:
cd .../mxml
git fetch
git checkout feature/midas-2019-03
Going forward, I will try to remember to tag the mxml version that corresponds to specific midas versions.
K.O. |
|
1415
|
18 Dec 2018 |
Konstantin Olchanski | Info | mxml update | the mxml library was updated to make it thread-safe.
https://bitbucket.org/tmidas/mxml/src/master/
I also take an opportunity to remind all to update your copy to the latest version
as I just stumbled on old bug that I fixed 1 year ago (crash of mlogger)
but forgot to update all and every of my copies of mxml.
I also looked at the xml encoder and I see that it has several places where it may
truncate the data, but none of these places can cause truncation of ODB data
because the fixed-size internal buffers are big enough to hold the longest
values sent by the odb xml encoder.
K.O. |
|
3162
|
01 Dec 2025 |
Konstantin Olchanski | Bug Fix | mvodb updated | I updated mvodb and test_mvodb. MIDAS ODB and JSON ODB now implement all API
functions. ReadKey, ReadDir and ReadKeyLastWritten were previously missing from
some implementations.
I do not remember any other bugs or problems in mvodb, if you want me to add, fix
or change something, please speak up!
K.O. |
|
2434
|
21 Aug 2022 |
Joseph McKenna | Suggestion | mvodb functionality to get the 'LastWritten' property of a key |
I want to read data from the ODB with the mvodb interface in one of my frontends, it's useful to know how old that data is, so I prototyped functionality in a pull request to mvodb:
https://bitbucket.org/tmidas/mvodb/pull-requests/2/add-readkeylastwritten-function-to-extract |
|
2435
|
22 Aug 2022 |
Stefan Ritt | Suggestion | mvodb functionality to get the 'LastWritten' property of a key | > I want to read data from the ODB with the mvodb interface in one of my frontends, it's useful to know how old that data is, so I prototyped functionality in a pull request to mvodb:
>
> https://bitbucket.org/tmidas/mvodb/pull-requests/2/add-readkeylastwritten-function-to-extract
Thanks for raising that point. I realized that the odbxx API was also missing that functionality, so I added it:
https://bitbucket.org/tmidas/midas/commits/6991a92c19292eaf67721cb80f182c61db077f45
Best,
Stefan |
|
3146
|
26 Nov 2025 |
Lars Martin | Suggestion | mvodb WS and family type matching | This is not a bug per se, but I find it a little odd that the MVOdb functions RS,
RSA, RSAI, and WSA use std::string as their type, while WS ans WSAI use const
char*
Seems to me like simple overloading a la
void WS(const char* varname, const std::string v, MVOdbError* error = NULL){
WS(varname, v.c_str(), v.size(), error);
}
should be all that's needed, right? |
|
3151
|
27 Nov 2025 |
Konstantin Olchanski | Suggestion | mvodb WS and family type matching | > This is not a bug per se, but I find it a little odd that the MVOdb functions RS,
> RSA, RSAI, and WSA use std::string as their type, while WS ans WSAI use const
> char*
>
> Seems to me like simple overloading a la
> void WS(const char* varname, const std::string v, MVOdbError* error = NULL){
> WS(varname, v.c_str(), v.size(), error);
> }
>
> should be all that's needed, right?
No short answer to this one.
This situation is an excellent example of c++ bloat. Reduced to bare basics:
1) "naive" c++ code:
void foo(std::string xxx) { ... };
int main() { foo("bar"); }
nominally:
a new string object is created to hold "bar"
a new string object is copy-created to pass it as argument to foo()
result:
two object creations (two calls to malloc + constructors)
plus memcpy() of string data. (compiler may or may not optimize the 2nd string)
2) "advanced" c++ code:
void foo(const std::string& xxx) { ... };
int main() { foo("bar"); }
copy-created 2nd string is avoided, but string object to hold "bar" is still must be
made, 1 malloc(), 1 memcpy().
3) "pure C" code:
void foo(const char xxx) { ... };
int main() { foo("bar"); }
address of "bar" (placed in read-only memory) is passed in a register, no malloc(), no
memcpy(), nada, zilch.
One can argue that bloat does not matter, "just buy a bigger computer".
This ignores the fact that malloc() is quite expensive, nominally requires taking a
mutex, and suddenly multiple threads calling foo() are unexpectedly serialized against
the malloc() internal mutex.
I guess you can have an advanced malloc() that uses per-thread memory pools, but now
instead of deterministic "always take a lock", we have non-deterministic "take a lock
sometimes, when per-thread memory pools decide to jockey for more memory".
This type of non-deterministic behaviour is bad for real-time applications.
Ultimately it boils down to personal style, I prefer "C-like" efficiency and
transparency, when I call foo() it is obvious there will be no hidden malloc(), no
hidden mutex.
I guess mvodb could have "const std::string&" version of each "const char*" function,
as if there is too few functions there already...
This problem is not isolated to mvodb, but pertains to any API, including midas.h.
I would say, if most function calls are foo("abc"); then "const char*" version is
sufficient, if most calls are foo(string + "something"); then "const std::string&" is
more appropriate.
K.O. |
|
3158
|
27 Nov 2025 |
Stefan Ritt | Suggestion | mvodb WS and family type matching | > 2) "advanced" c++ code:
>
> void foo(const std::string& xxx) { ... };
> int main() { foo("bar"); }
>
> copy-created 2nd string is avoided, but string object to hold "bar" is still must be
> made, 1 malloc(), 1 memcpy().
Are you sure about this? I always thought that foo only receives a pointer to xxx which it puts on the stack, so
no additional malloc/free is involved.
Have a look here: https://en.cppreference.com/w/cpp/language/reference.html
It says "References are not objects; they do not necessarily occupy storage".
Stefan |
|
3159
|
28 Nov 2025 |
Konstantin Olchanski | Suggestion | mvodb WS and family type matching | > > 2) "advanced" c++ code:
> >
> > void foo(const std::string& xxx) { ... };
> > int main() { foo("bar"); }
> >
> > copy-created 2nd string is avoided, but string object to hold "bar" is still must be
> > made, 1 malloc(), 1 memcpy().
>
> Are you sure about this? I always thought that foo only receives a pointer to xxx which it puts on the stack, so
> no additional malloc/free is involved.
Yes, "bar" is not an std::string, cannot be used to call foo(), and the c++ compiler has to automagically rewrite
the function call
from: int main() { foo("bar"); }
to: int main() { foo(std::string("bar"); }
the temporary std::string object may be on the stack, but storage for text "bar" is on the heap (unless std::string
is optimized to store short strings internally).
one can put a printf() inside foo() to print the address of xxx (should be on the stack) and xxx.c_str() (should be
on the heap). one could also try to print the address of "bar" (should be in the read-only-constant-strings memory
area). (I am not sure if compiler-linker combines all instances of "bar" into one, this is also easy to check).
K.O. |
|
3160
|
28 Nov 2025 |
Konstantin Olchanski | Suggestion | mvodb WS and family type matching | Just in time, enter std::string_view.
https://stackoverflow.com/questions/40127965/how-exactly-is-stdstring-view-faster-than-const-stdstring
I was looking at https://root.cern/doc/v638/classROOT_1_1Experimental_1_1RFile.html and they use it everywhere instead of
std::string and const char*.
(so now we have 4 string types to deal with, counting ROOT's TString).
P.S. For extra safety, this code compiles, then explodes:
std::string_view get_temporary_string() {
std::string s = "temporary";
return s; // DANGER! 's' is destroyed, view dangles.
}
K.O. |
|
49
|
30 Jun 2004 |
Piotr Zolnierczuk | | mvme167 problems | Hi,
I am really puzzled: I am running the very same as far as sources
are concerned (Dec 12, 2003 snapsot) midas frontend (miniexp + camacnul)
on two different machines (and the same trusted private network):
1) one is an ancient Pentium/100 MHz laptop with RedHat Linux 7.3 and
2) another one is event more ancient MVME167 25MHz running VxWorks 5.4.2
The front end on my Linux PC works just fine, whereas on the MVME167
I get intermittent crashes (most often at the end of the run).
[Correction: the crashes happen, I think, when the frontend wants
to update the ODB]
The crashes happen in db_set_record routines
Any ideas what might be wrong?
Except that MVME167 is a piece of ...#@!%
Piotr |
|
50
|
30 Jun 2004 |
Piotr Zolnierczuk | | mvme167 problems | A followup: I traced back the problem to version 1.9.2.
Version 1.9.1 does not have this problem but 1.9.2 does.
For now I stick with 1.9.1
Piotr
|
|
897
|
02 Aug 2013 |
Konstantin Olchanski | Bug Fix | multithreaded run transitions work! | As of commit
https://bitbucket.org/tmidas/midas/commits/dfa5fb1a93cae11a2960d441044c7fd277e1f0ec
(we are now liberated from the tyranny of SVN IDs),
multithreaded run transitions seem to work reliably and are now the default in mhttpd.
In odbedit and mtransition, the default is the old sequential transitions. "-m" and "-a" flags activate
the new multithread run transitions. mhttpd now uses the equivalent of "mtransition -a"
(mutithreaded asynchronous).
This is one of the new features implemented by Stefan while at TRIUMF.
K.O.
(We hope to write up all the recent changes soon). |
|
2842
|
13 Sep 2024 |
Konstantin Olchanski | Bug Fix | mstrcpy, was: strlcpy and strlcat added to glibc 2.38 | for the record, as ultimate solution, strlcpy() and strlcat() were wholesale
replaced by mstrlcpy() and mstrlcat(). this should fix "missing strlcpy()"
problem for good and make midas more consistent across all platforms (including
non-linux, non-unix). on my side, I continue replacing these function with proper
std::string operations. K.O. |
|