Back Midas Rome Roody Rootana
  Midas DAQ System, Page 27 of 46  Not logged in ELOG logo
Entry  14 Nov 2013, Konstantin Olchanski, Bug Report, MacOS10.9 strlcpy() problem 
On MacOS 10.9 MIDAS will crashes in strlcpy() somewhere inside odb.c. We think this is because strlcpy() 
in MacOS 10.9 was changed to abort() if input and output strings overlap. For overlapping memory one is 
supposed to use memmove(). This is fixed in current midas, for older versions, you can try this patch:
Entry  09 Nov 2013, Razvan Stefan Gornea, Forum, Installation problem output.log
Hi,

I run into problems while trying to install Midas on Slackware 14.0. In the past
    Reply  10 Nov 2013, Stefan Ritt, Forum, Installation problem 
Seems to me a problem with the ODBC library, so maybe Konstantin can comment.

/Stefan
    Reply  11 Nov 2013, Konstantin Olchanski, Forum, Installation problem 
> I run into problems while trying to install Midas on Slackware 14.0.

Thank you for reporting this. We do not have any slackware computers so we cannot see these message usually.
       Reply  11 Nov 2013, Konstantin Olchanski, Forum, Installation problem 
> > I run into problems while trying to install Midas on Slackware 14.0.

> b) an actual error in fal.c:
       Reply  13 Nov 2013, Konstantin Olchanski, Forum, Installation problem 
> > I run into problems while trying to install Midas on Slackware 14.0.

> Thank you for reporting this. We do not have any slackware computers so we cannot see these message usually.
          Reply  13 Nov 2013, Stefan Ritt, Forum, Installation problem 
> got around to look at compile messages on ubuntu: in addition to "variable 'error' set but not used" we have these:

> warning: ignoring return value of 'ssize_t write(int, const void*, size_t)'
       Reply  14 Nov 2013, Razvan Stefan Gornea, Forum, Installation problem 
Hi,  Thanks a lot for the response! Yes to search packages and list their content in Slackware it is pretty similar to your illustration. Slackware seems
to use iODBC in which case it would link with -liodbc I guess.
root@lheppc83:~# slackpkg file-search sql.h
          Reply  14 Nov 2013, Konstantin Olchanski, Forum, Installation problem 
# slackpkg file-search sql.h
[ installed ] - libiodbc-3.52.7-x86_64-2
...
    Reply  12 Nov 2013, Stefan Ritt, Forum, Installation problem 
The warnings with the set but unused variables are real. While John O'Donnell proposed:

==========
       Reply  14 Nov 2013, Konstantin Olchanski, Forum, Installation problem 
> #include "use.h"
>  { USED int i=foo(); }
Entry  22 Oct 2013, Konstantin Olchanski, Info, midas programs "auto start", etc 
MIDAS "programs" settings include: /programs/xxx/"auto start", "auto restart" and "auto stop". What do 
they do?
    Reply  06 Nov 2013, Stefan Ritt, Info, midas programs "auto start", etc 
> "programs auto start" : works but has strange interactions and side effects, do not use it.
> "programs auto stop" : works, can be used to stop programs at the end of run (but what for?)
> "programs auto restart" : works, seems to work correctly, can be used to auto restart mlogger, frontends, 
Entry  25 Oct 2013, Konstantin Olchanski, Bug Fix, fixed mlogger run auto restart bug 
A problem existed in midas for some time: when recording long data sets of time (or event) limited runs 
with logger run auto restart set to "yes", the runs will automatically stop and restart as expected, but 
sometimes the run will stop and never restart and beam will be lost until the experiment operator on shift 
    Reply  25 Oct 2013, Stefan Ritt, Bug Fix, fixed mlogger run auto restart bug 
> A problem existed in midas for some time: when recording long data sets of time (or event) limited runs 
> with logger run auto restart set to "yes", the runs will automatically stop and restart as expected, but 
> sometimes the run will stop and never restart and beam will be lost until the experiment operator on shift 
       Reply  28 Oct 2013, Konstantin Olchanski, Bug Fix, fixed mlogger run auto restart bug 

> More generally I kind of consider the mlogger auto restart facility as deprecated. It works in the background and the operator does not have a clue 
> what is going on. We use now the sequencer to achieve exactly the same functionality.
          Reply  28 Oct 2013, Stefan Ritt, Bug Fix, fixed mlogger run auto restart bug 
> Does the sequencer survive a crash or a restart of mhttpd?

Yes. Of course runs will not be started/stopped when mhttpd is not running, but when you restart it gracefully continues where it stopped, since all variables
Entry  01 Oct 2013, Konstantin Olchanski, Info, MacOS select() problem 
The following code found in mhttpd does not work on MacOS (BSD UNIX).

On Linux, the do-loop will finish after 2 seconds as expected. On MacOS (and other BSD systems), it will 
    Reply  25 Oct 2013, Konstantin Olchanski, Info, MacOS select() problem 
> The following code found in mhttpd does not work on MacOS (BSD UNIX). ...

Because of this problem, on MacOS, run transitions can get stuck forever - most timeouts do not work. (Specifically, recv_string() never times out)
Entry  22 Oct 2013, Konstantin Olchanski, Info, audit of db_get_record() 
Record-oriented ODB functions db_create_record(), db_get_record(), db_check_record() and 
db_set_record() require special attention to the consistency between their "C struct"s (usually defined in 
midas.h), their initialization strings (usually defined in midas.h) and the contents of ODB.
Entry  21 Aug 2013, Konstantin Olchanski, Info, Documentation for ODBGet() & co, Javascript and AJAX functions. 
The bulk of the MIDAS AJAX and Javascript functions is now documented on the MIDAS Wiki:

https://midas.triumf.ca/MidasWiki/index.php/Mhttpd.js
    Reply  22 Aug 2013, Konstantin Olchanski, Info, Documentation for ODBGet() & co, Javascript and AJAX functions. 
> The bulk of the MIDAS AJAX and Javascript functions is now documented on the MIDAS Wiki:

> https://midas.triumf.ca/MidasWiki/index.php/Mhttpd.js
       Reply  25 Sep 2013, Konstantin Olchanski, Info, Documentation for ODBGet() & co, Javascript and AJAX functions. 
> > The bulk of the MIDAS AJAX and Javascript functions is now documented on the MIDAS Wiki:
> > 
> > https://midas.triumf.ca/MidasWiki/index.php/Mhttpd.js
Entry  13 Sep 2013, Thomas Lindner, Bug Report, mhttpd truncates string variables to 32 characters 
I find that new mhttpd has strange behaviour for ODB strings.

- I create a new STRING variable in ODB through mhttpd.  It defaults to size 32.
    Reply  13 Sep 2013, Konstantin Olchanski, Bug Report, mhttpd truncates string variables to 32 characters 

I can confirm part of the problem - the new inline-edit function - after you finish editing - shows you what you 
have typed, not what's actually in ODB - at the very end it should do an ODBGet() to load the actual ODB 
       Reply  18 Sep 2013, Konstantin Olchanski, Bug Report, mhttpd truncates string variables to 32 characters 
I confirm the second part of the problem.

Inline edit uses ODBSet(), which uses the "jset" AJAX call to mhttpd which does not extend string variables.
          Reply  24 Sep 2013, Stefan Ritt, Bug Report, mhttpd truncates string variables to 32 characters 
> This is the jset code. The best I can tell it truncates string variables to the existing size in ODB:

> db_find_key(hDB, 0, str, &hkey)
    Reply  24 Sep 2013, Stefan Ritt, Bug Report, mhttpd truncates string variables to 32 characters 
Actually this was no bug, but a missing feature. Strings were never meant to be extended via the web interface. 
Now I added that feature to the current version. Please check it.
Entry  14 Sep 2013, Konstantin Olchanski, Info, mktime() and daylight savings time 
I would like to share with you a silly problem with mktime() and daylight savings time (Summer 
time/Winter time) that I have run into while working on the mhttpd history query page.
    Reply  24 Sep 2013, Stefan Ritt, Info, mktime() and daylight savings time 
I vaguely remember that I had a similar problem with ELOG. The solution was to call tzset() at the beginning of the program. The man page says that 
this function is called automatically by programs using time zones, but apparently it is not. Can you try that? There is also the TZ environment 
variable and /etc/localtime. I never understood the details, but playing with these things can influence mktime() and localtime().
       Reply  24 Sep 2013, Konstantin Olchanski, Info, mktime() and daylight savings time 
> I vaguely remember that I had a similar problem with ELOG. The solution was to call tzset() at the beginning of the program. The man page says that 
> this function is called automatically by programs using time zones, but apparently it is not. Can you try that? There is also the TZ environment 
> variable and /etc/localtime. I never understood the details, but playing with these things can influence mktime() and localtime().
          Reply  24 Sep 2013, Stefan Ritt, Info, mktime() and daylight savings time 
> > I vaguely remember that I had a similar problem with ELOG. The solution was to call tzset() at the beginning of the program. The man page says that

> > this function is called automatically by programs using time zones, but apparently it is not. Can you try that? There is also the TZ environment 
             Reply  24 Sep 2013, Stefan Ritt, Info, mktime() and daylight savings time 
> > > I vaguely remember that I had a similar problem with ELOG. The solution was to call tzset() at the beginning of the program. The man page says that

> > > this function is called automatically by programs using time zones, but apparently it is not. Can you try that? There is also the TZ environment
Entry  13 Sep 2013, Carl Blaksley, Forum, MIDAS CITATION 
Dear MIDAS programmers,

I have been using your software in my lab (APC, Paris)
    Reply  13 Sep 2013, Konstantin Olchanski, Forum, MIDAS CITATION 

> I have been using your software in my lab (APC, Paris)
> to run our data acqusition system. It is very robust and flexible.s
    Reply  13 Sep 2013, Stefan Ritt, Forum, MIDAS CITATION 
> Dear MIDAS programmers,

> I have been using your software in my lab (APC, Paris)
Entry  26 Aug 2013, Konstantin Olchanski, Bug Fix, Enable cross-site requests in mhttpd 
Javascript "AJAX" functions (and their MIDAS wrappers - ODBGet/ODBSet) are subject to something called 
"same origin policy" intended to prevent something called "cross-site scripting attacks", i.e. see
http://en.wikipedia.org/wiki/Same-origin_policy
Entry  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),
Entry  26 Jul 2013, Konstantin Olchanski, Bug Report, odbedit fixed size buffer overrun 
odbedit uses a fixed size buffer for ODB data. If an array in ODB is bugger than this size, 
db_get_data() correctly returns DB_TRUNCATED and there is no memory overwrite, but the following 
code for printing the data does not know about this truncation and proceeds printing memory 
Entry  26 Jul 2013, Konstantin Olchanski, Bug Report, abort on buffer overflow in odb.c::merge_records() 
The odb.c function merge_records() has a fixed size array of 10000 bytes to handle the data and it 
aborts with an assert() if passed data bigger than that. It is called from db_create_record() which 
already allocates a data buffer of correct size for it's operations.
Entry  22 Jul 2013, Konstantin Olchanski, Info, MidasWiki at TRIUMF 
We are happy to announce the creation of the MidasWiki at TRIUMF (https://midas.triumf.ca) as the 
new location of MIDAS documentation, user instructions, examples, etc.
    Reply  24 Jul 2013, Konstantin Olchanski, Info, MidasWiki at TRIUMF 
> We are happy to announce the creation of the MidasWiki at TRIUMF
> https://midas.triumf.ca
Entry  22 Jul 2013, Konstantin Olchanski, Info, MIDAS source code converted from SVN to GIT 
The MIDAS source code repository was converted from SVN to GIT, hosted as bitbucket: 
https://bitbucket.org/tmidas.
    Reply  22 Jul 2013, Stefan Ritt, Info, MIDAS source code converted from SVN to GIT 
Konstantin forgot to tell people outside of TRIUMF how to get the newest version of MIDAS. Here it is:

$ git clone https://bitbucket.org/tmidas/midas.git
Entry  10 Jun 2013, Konstantin Olchanski, Forum, ladd00.triumf.ca https ssl certificate update, elogd update, relocation. 
The HTTPS SSL certificate on ladd00.triumf.ca has been updated. Same as the old
certificate, the new one is self-signed and your web browser may complain about
that and ask you to "save a security exception".
Entry  07 May 2013, Konstantin Olchanski, Info, Updated: javascript custom page examples 
I updated the MIDAS javascript examples in examples/javascript1. All existing mhttpd.js functions are 
now exampled. (yes).
    Reply  10 May 2013, Konstantin Olchanski, Info, Updated: javascript custom page examples 
> ODBCopy(path, format); -- no doc

Updated example of ODBCopy:
Entry  10 May 2013, Konstantin Olchanski, Bug Fix, Fixed: crash if alarm "write elog message" is enabled 
If the MIDAS Alarm property "write elog message" is enabled, an uninitialized variable "tag" is passed to 
el_submit() and depending on your luck, cause a crash. "tag" is supposed to be and is now a NUL-
terminated string. The only other use of el_submit() is in mhttpd.cxx and mserver.c, where it is called 
Entry  06 May 2013, Konstantin Olchanski, Info, TRIUMF MIDAS page moved to DAQWiki 
The MIDAS web page at TRIUMF (http://midas.triumf.ca) moved from the daq-plone site to the DAQWiki 
(MediaWiki) site. Links were updated, checked and corrected:
https://www.triumf.info/wiki/DAQwiki/index.php/MIDAS
ELOG V3.1.4-2e1708b5