ID |
Date |
Author |
Topic |
Subject |
2090
|
11 Feb 2021 |
Isaac Labrie Boulay | Forum | Javascript error during run transitions. |
> > I am encountering a Javascript error (TypeError: client.error is undefined) when
> > I transition between run states. Does anybody have an idea of what my problem
> > might be? I have pasted an example of what MIDAS logs during such sequences.
>
>
> Not enough information. Can you do this:
>
> a) for the javascript error, if you get it every time, open the javascript debugger
> and capture the stack trace? or at least the file name, function name and line number
> where the javascript exception is thrown?
I've attached a screenshot of the call stack showing the file names and line numbers.
> b) for the run start failure, start the run from odbedit "start now -v" or from
> "mtransition -v -d 1 START" (or "stop" as the case may be). capture the output, email
> to me directly or put in this elog here.
I have also attached a screen capture of the output.
Thanks for your help as always.
Isaac
> K.O.
>
>
> >
> > Thanks for all the help!
> >
> > Isaac
> >
> >
> > 09:24:08.611 2021/02/10 [mhttpd,INFO] Executing script
> > "~/ANIS_20210106/scripts/start_daq.sh" from ODB "/Script/Start DAQ"
> >
> > 09:24:13.833 2021/02/10 [Logger,LOG] Program Logger on host localhost started
> >
> > 09:24:28.598 2021/02/10 [fevme,LOG] Program fevme on host localhost started
> >
> > 09:24:33.951 2021/02/10 [mhttpd,INFO] Run #234 started
> >
> > 09:26:30.970 2021/02/10 [mhttpd,ERROR] [midas.cxx:4260:cm_transition_call,ERROR]
> > Client "Logger" transition 2 aborted while waiting for client "fevme":
> > "/Runinfo/Transition in progress" was cleared
> >
> > 09:26:31.015 2021/02/10 [mhttpd,ERROR] [midas.cxx:5120:cm_transition,ERROR]
> > transition STOP aborted: "/Runinfo/Transition in progress" was cleared
> >
> > 09:27:27.270 2021/02/10 [mhttpd,ERROR]
> > [system.cxx:4937:ss_recv_net_command,ERROR] timeout receiving network command
> > header
> >
> > 09:27:27.270 2021/02/10 [mhttpd,ERROR] [midas.cxx:12262:rpc_client_call,ERROR]
> > call to "fevme" on "localhost" RPC "rc_transition": timeout waiting for reply |
Attachment 1: start_now_-v.PNG
|
|
Attachment 2: Call_Stack_for_JavaScript_Error.PNG
|
|
Draft
|
25 Feb 2021 |
Konstantin Olchanski | Forum | Javascript error during run transitions. | >
> I have also attached a screen capture of the output.
>
so the error is gone?
> Thanks for your help as always.
>
> Isaac
>
> > K.O.
> >
> >
> > >
> > > Thanks for all the help!
> > >
> > > Isaac
> > >
> > >
> > > 09:24:08.611 2021/02/10 [mhttpd,INFO] Executing script
> > > "~/ANIS_20210106/scripts/start_daq.sh" from ODB "/Script/Start DAQ"
> > >
> > > 09:24:13.833 2021/02/10 [Logger,LOG] Program Logger on host localhost started
> > >
> > > 09:24:28.598 2021/02/10 [fevme,LOG] Program fevme on host localhost started
> > >
> > > 09:24:33.951 2021/02/10 [mhttpd,INFO] Run #234 started
> > >
> > > 09:26:30.970 2021/02/10 [mhttpd,ERROR] [midas.cxx:4260:cm_transition_call,ERROR]
> > > Client "Logger" transition 2 aborted while waiting for client "fevme":
> > > "/Runinfo/Transition in progress" was cleared
> > >
> > > 09:26:31.015 2021/02/10 [mhttpd,ERROR] [midas.cxx:5120:cm_transition,ERROR]
> > > transition STOP aborted: "/Runinfo/Transition in progress" was cleared
> > >
> > > 09:27:27.270 2021/02/10 [mhttpd,ERROR]
> > > [system.cxx:4937:ss_recv_net_command,ERROR] timeout receiving network command
> > > header
> > >
> > > 09:27:27.270 2021/02/10 [mhttpd,ERROR] [midas.cxx:12262:rpc_client_call,ERROR]
> > > call to "fevme" on "localhost" RPC "rc_transition": timeout waiting for reply |
2107
|
25 Feb 2021 |
Konstantin Olchanski | Forum | Javascript error during run transitions. | >
> I have also attached a screen capture of the output.
>
so the error is gone?
K.O. |
Draft
|
25 Feb 2021 |
Konstantin Olchanski | Forum | Javascript error during run transitions. | >
> I have also attached a screen capture of the output.
>
so the error is gone?
K.O. |
Draft
|
26 Feb 2021 |
Isaac Labrie Boulay | Forum | Javascript error during run transitions. | > >
> > I have also attached a screen capture of the output.
> >
>
> so the error is gone?
>
> K.O.
Hi K.O.,
No the error persists, |
1213
|
14 Oct 2016 |
Konstantin Olchanski | Info | Javascript based run start and stop pages. | I switched mhttpd to use the new javascript based run start and stop pages.
There are two new html pages:
resources/start.html - mimics the old run start page exactly - where you can enter the "edit on
start" parameters and start the run.
resources/transition.html - monitors the transition progress, shows the status of every transition
client, their sequence number, waiting list dependency, time spent making rpc calls, etc.
If the new pages do not work for you, please report it here and switch to the old pages
by editing src/mhttpd.cxx - comment-out the line "#define NEW_START_STOP 1"
K.O. |
1224
|
05 Dec 2016 |
Thomas Lindner | Info | Javascript based run start and stop pages. | > I switched mhttpd to use the new javascript based run start and stop pages.
One initial complaint: the transition.html page doesn't seem to deal well with a frontend program using
a deferred transition. Specifically, I find with my simulated frontend ([1]), which has a deferred
end-of-run transition, that two problems happen:
i) the page doesn't give any indication that a frontend has a deferred transition; in fact it says that
the frontend immediately has finished the transition.
ii) once the deferred transition has finished, the page doesn't switch to saying that the run has
stopped. In fact, even if I reload the transition page it still continues to show that the run is
ongoing; the status page, by contrast, shows that the run has stopped.
I separately still think that the transition page should automatically go away after 5 seconds
(assuming that all the transitions were successful). I think it is annoying that you need to click
back to the status page.
[1] https://github.com/thomaslindner/fesimdaq |
1232
|
01 Feb 2017 |
Konstantin Olchanski | Info | Javascript based run start and stop pages. | > > I switched mhttpd to use the new javascript based run start and stop pages.
>
> One initial complaint: the transition.html page doesn't seem to deal well with a frontend program using
> a deferred transition.
>
We now have a test frontend for deferred transitions, and this problem will likely be fixed.
>
> I separately still think that the transition page should automatically go away after 5 seconds
>
This is a user-interface philosophy issue.
Instead of using personal preferences one should follow established design principles
(there is research done and books written about this).
I did not recently look at current recommendations for this type of interaction, but generally
one expects web pages to "do things" (such as switch to a different page) only when directed
by user input (press a button).
My personal opinion is that half the users will find 5 sec delay too slow, the other half will
find 5 sec too fast and the 3rd half will wonder "what happened, the web page flashed and disappeared,
did I miss something important, how do I get back to whatever is was?!?".
One idea is to implement the transition page as a implant on the state page - after the "start" page
you go back to the status page where you can see the progress of the transition. After the transition
completes, it's progress window "collapses" into a "success/failure" display with a link to the full
transition page to see any details of what happened. Any volunteers? (I would html-ize the status page first).
K.O. |
1233
|
01 Feb 2017 |
Stefan Ritt | Info | Javascript based run start and stop pages. | > > > I switched mhttpd to use the new javascript based run start and stop pages.
> >
> > One initial complaint: the transition.html page doesn't seem to deal well with a frontend program using
> > a deferred transition.
> >
>
> We now have a test frontend for deferred transitions, and this problem will likely be fixed.
>
> >
> > I separately still think that the transition page should automatically go away after 5 seconds
> >
>
> This is a user-interface philosophy issue.
>
> Instead of using personal preferences one should follow established design principles
> (there is research done and books written about this).
>
> I did not recently look at current recommendations for this type of interaction, but generally
> one expects web pages to "do things" (such as switch to a different page) only when directed
> by user input (press a button).
>
> My personal opinion is that half the users will find 5 sec delay too slow, the other half will
> find 5 sec too fast and the 3rd half will wonder "what happened, the web page flashed and disappeared,
> did I miss something important, how do I get back to whatever is was?!?".
>
> One idea is to implement the transition page as a implant on the state page - after the "start" page
> you go back to the status page where you can see the progress of the transition. After the transition
> completes, it's progress window "collapses" into a "success/failure" display with a link to the full
> transition page to see any details of what happened. Any volunteers? (I would html-ize the status page first).
>
> K.O.
I agree with Konstantin's plans and volunteer for the "collapsable" display. We will address this during my next visit to TRIUMF. |
966
|
21 Feb 2014 |
Konstantin Olchanski | Info | Javascript ODBMLs(), modified ODBMCopy() JSON encoding | I made a few minor modifications to the ODB JSON encoder and implemented a javascript "ls" function to
report full ODB directory information as available from odbedit "ls -l" and the mhttpd odb editor page.
Using the new ODBMLs(), the existing ODBMCreate(), ODBMDelete() & etc a complete ODB editor can be
written in Javascript (or in any other AJAX-capable language).
While implementing this function, I found some problems in the ODB JSON encoder when handling
symlinks, also some problems with handling symlinks in odbedit and in the mhttpd ODB editor - these are
now fixed.
Changes to the ODB JSON encoder:
- added the missing information to the ODB KEY (access_mode, notify_count)
- added symlink target information ("link")
- changed encoding of simple variable (i.e. jcopy of /experiment/name) - when possible (i.e. ODB KEY
information is omitted), they are encoded as bare values (before, they were always encoded as structures
with variable names, etc). This change makes it possible to implement ODBGet() and ODBMGet() using the
AJAX jcopy method with JSON data encoding. Bare value encoding in ODBMCopy()/AJAX jcopy is enabled by
using the "json-nokeys-nolastwritten" encoding option.
All these changes are supposed to be backward compatible (encoding used by ODBMCopy() for simple
values and "-nokeys-nolastwritten" was previously not documented).
Documentation was updated:
https://midas.triumf.ca/MidasWiki/index.php/Mhttpd.js
K.O. |
766
|
20 Jun 2011 |
Stefan Ritt | Info | Javascript ODB interface revised | The Javascript interface to the ODB has been revised. This extends the capabilities of custom web pages requesting data from the ODB. By grouping several request together, the number of round-trips is minimized and the response time is reduced. Following functions are new or extended:
- ODBGet(path[, format]): This functions works now also with subdirectories in the ODB. The command ODBGet('/Runinfo') returns for example:
1
1
1024
0
0
0
Mon Jun 20 09:40:14 2011
1308588014
Mon Jun 20 09:40:46 2011
1308588046
- ODBGetRecord(path), ODBExtractRecord(key): While ODBGet can be used for subdirectories, an easier way is to use ODBGetRecord and ODBExtractRecord. The first function retrieves the subtree (record), while the second one can be used to extract individual items. Here is an example:
result = ODBGetRecord('/Runinfo');
run_number = ODBExtractRecord(result, 'Run number');
start_time = ODBExtractRecord(result, 'Start time');
- ODBMGet(paths[, callback, formats]): This function ("Multi-Get") can be used to obtain ODB values from different paths in one call. The ODB paths have to be supplied in an array, the result is again an array. An optional callback routine might be supplied for asynchronous operation. Optional formats might be supplied if the resulting number should be formatted in a specific way. Here is an example:
var req = new Array();
req[0] = "/Runinfo/Run number";
req[1] = "/Equipment/Trigger/Statistics/Events sent";
var result = ODBMGet(req);
run_number = result[0];
events_sent = result[1];
The new functions are implemented in mhttpd revision 5075. |
2437
|
10 Oct 2022 |
Zaher Salman | Suggestion | JSON-RPC function to read files | Hello ,
The midas sequencer uses the function js_seq_list_files to get a list of files in the /Sequencer/State/Path with extension *.msl. It would be nice to generalize this function to be able to read files with other (or any) extension.
Based on the js_seq_list_files I added a function in js_any_list_files mjsonrpc_user.cxx (attached) which does the job. Maybe a better/safer implementation can be made in midas. Are there any plans to do this?
thanks. |
Attachment 1: mjsonrpc_user.cxx
|
/********************************************************************\
Name: mjsonrpc_user.cxx
Created by: Konstantin Olchanski
Contents: handler of user-provided and experimental JSON-RPC requests
\********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <map>
#include "mjson.h"
#include "midas.h"
#include "msystem.h"
#include "mjsonrpc.h"
#include <mutex> // std::mutex
//
// example 1: extract request parameters, return up to 3 results
//
static MJsonNode* user_example1(const MJsonNode* params)
{
if (!params) {
MJSO* doc = MJSO::I();
doc->D("example of user defined RPC method that returns up to 3 results");
doc->P("arg", MJSON_STRING, "example string argment");
doc->P("optional_arg?", MJSON_INT, "optional example integer argument");
doc->R("string", MJSON_STRING, "returns the value of \"arg\" parameter");
doc->R("integer", MJSON_INT, "returns the value of \"optional_arg\" parameter");
return doc;
}
MJsonNode* error = NULL;
std::string arg = mjsonrpc_get_param(params, "arg", &error)->GetString(); if (error) return error;
int optional_arg = mjsonrpc_get_param(params, "optional_arg", NULL)->GetInt();
if (mjsonrpc_debug)
printf("user_example1(%s,%d)\n", arg.c_str(), optional_arg);
return mjsonrpc_make_result("string", MJsonNode::MakeString(arg.c_str()), "integer", MJsonNode::MakeInt(optional_arg));
}
//
// example 2: extract request parameters, return more than 3 results
//
static MJsonNode* user_example2(const MJsonNode* params)
{
if (!params) {
MJSO* doc = MJSO::I();
doc->D("example of user defined RPC method that returns more than 3 results");
doc->P("arg", MJSON_STRING, "example string argment");
doc->P("optional_arg?", MJSON_INT, "optional example integer argument");
doc->R("string1", MJSON_STRING, "returns the value of \"arg\" parameter");
doc->R("string2", MJSON_STRING, "returns \"hello\"");
doc->R("string3", MJSON_STRING, "returns \"world!\"");
doc->R("value1", MJSON_INT, "returns the value of \"optional_arg\" parameter");
doc->R("value2", MJSON_NUMBER, "returns 3.14");
return doc;
}
MJsonNode* error = NULL;
std::string arg = mjsonrpc_get_param(params, "arg", &error)->GetString(); if (error) return error;
int optional_arg = mjsonrpc_get_param(params, "optional_arg", NULL)->GetInt();
if (mjsonrpc_debug)
printf("user_example2(%s,%d)\n", arg.c_str(), optional_arg);
MJsonNode* result = MJsonNode::MakeObject();
result->AddToObject("string1", MJsonNode::MakeString(arg.c_str()));
result->AddToObject("string2", MJsonNode::MakeString("hello"));
result->AddToObject("string3", MJsonNode::MakeString("world!"));
result->AddToObject("value1", MJsonNode::MakeInt(optional_arg));
result->AddToObject("value2", MJsonNode::MakeNumber(3.14));
return mjsonrpc_make_result(result);
}
//
// example 3: return an error
//
static MJsonNode* user_example3(const MJsonNode* params)
{
if (!params) {
MJSO* doc = MJSO::I();
doc->D("example of user defined RPC method that returns an error");
doc->P("arg", MJSON_INT, "integer value, if zero, throws a JSON-RPC error");
doc->R("status", MJSON_INT, "returns the value of \"arg\" parameter");
return doc;
}
MJsonNode* error = NULL;
int arg = mjsonrpc_get_param(params, "arg", &error)->GetInt(); if (error) return error;
if (mjsonrpc_debug)
printf("user_example3(%d)\n", arg);
if (arg)
return mjsonrpc_make_result("status", MJsonNode::MakeInt(arg));
else
return mjsonrpc_make_error(15, "example error message", "example error data");
}
static MJsonNode* js_any_list_files(const MJsonNode* params)
{
if (!params) {
MJSO* doc = MJSO::I();
doc->D("js_any_list_files");
doc->P("subdir", MJSON_STRING, "List files in /Seq/State/Path/subdir");
doc->R("status", MJSON_INT, "return status of midas library calls");
doc->R("path", MJSON_STRING, "Search path");
doc->R("fileext", MJSON_STRING, "Filename extension");
doc->R("subdirs[]", MJSON_STRING, "list of subdirectories");
doc->R("files[].filename", MJSON_STRING, "script filename");
doc->R("files[].description", MJSON_STRING, "script description");
return doc;
}
MJsonNode* error = NULL;
std::string subdir = mjsonrpc_get_param(params, "subdir", &error)->GetString(); if (error) return error;
std::string fileext = mjsonrpc_get_param(params, "fileext", &error)->GetString(); if (error) return error;
std::string path = mjsonrpc_get_param(params, "path", NULL)->GetString();
if (subdir.find("..") != std::string::npos) {
return mjsonrpc_make_result("status", MJsonNode::MakeInt(DB_INVALID_PARAM));
}
int status;
HNDLE hDB;
status = cm_get_experiment_database(&hDB, NULL);
if (status != DB_SUCCESS) {
return mjsonrpc_make_result("status", MJsonNode::MakeInt(status));
}
// std::string path;
// If path is not provided get from ODB
if (path == "") {
status = db_get_value_string(hDB, 0, "/Sequencer/State/Path", 0, &path, FALSE);
}
if (status != DB_SUCCESS) {
return mjsonrpc_make_result("status", MJsonNode::MakeInt(status));
}
path = cm_expand_env(path.c_str());
if (subdir.length() > 0) {
if (path[path.length()-1] != DIR_SEPARATOR) {
path += DIR_SEPARATOR_STR;
}
path += subdir;
}
char* flist = NULL;
//printf("path: [%s]\n", path.c_str());
MJsonNode* s = MJsonNode::MakeArray();
/*---- go over subdirectories ----*/
int n = ss_dir_find(path.c_str(), "*", &flist);
for (int i=0 ; i<n ; i++) {
if (flist[i*MAX_STRING_LENGTH] != '.') {
//printf("subdir %d: [%s]\n", i, flist+i*MAX_STRING_LENGTH);
ss_repair_utf8(flist+i*MAX_STRING_LENGTH);
s->AddToArray(MJsonNode::MakeString(flist+i*MAX_STRING_LENGTH));
}
}
MJsonNode* f = MJsonNode::MakeArray();
/*---- go over files in path ----*/
n = ss_file_find(path.c_str(), fileext.c_str(), &flist);
for (int i=0 ; i<n ; i++) {
//printf("file %d: [%s]\n", i, flist+i*MAX_STRING_LENGTH);
MJsonNode* o = MJsonNode::MakeObject();
ss_repair_utf8(flist+i*MAX_STRING_LENGTH);
o->AddToObject("filename", MJsonNode::MakeString(flist+i*MAX_STRING_LENGTH));
o->AddToObject("description", MJsonNode::MakeString("description"));
f->AddToArray(o);
#if 0
char comment[512];
comment[0] = 0;
strlcpy(str, path, sizeof(str));
if (strlen(str)>1 && str[strlen(str)-1] != DIR_SEPARATOR)
strlcat(str, DIR_SEPARATOR_STR, sizeof(str));
strlcat(str, flist+i*MAX_STRING_LENGTH, sizeof(str));
if (msl_parse(str, error, sizeof(error), &error_line)) {
if (strchr(str, '.')) {
*strchr(str, '.') = 0;
strlcat(str, ".xml", sizeof(str));
}
comment[0] = 0;
if (pnseq) {
mxml_free_tree(pnseq);
pnseq = NULL;
}
pnseq = mxml_parse_file(str, error, sizeof(error), &error_line);
if (error[0]) {
strlcpy(comment, error, sizeof(comment));
} else {
if (pnseq) {
pn = mxml_find_node(pnseq, "RunSequence/Comment");
if (pn)
strlcpy(comment, mxml_get_value(pn), sizeof(comment));
else
strcpy(comment, "<No description in XML file>");
}
}
if (pnseq) {
mxml_free_tree(pnseq);
pnseq = NULL;
}
} else {
sprintf(comment, "Error in MSL: %s", error);
}
strsubst(comment, sizeof(comment), "\"", "\\\'");
r->rsprintf("<option onClick=\"document.getElementById('cmnt').innerHTML='%s'\"", comment);
r->rsprintf(" onDblClick=\"load();\">%s</option>\n", flist+i*MAX_STRING_LENGTH);
#endif
}
free(flist);
flist = NULL;
MJsonNode* r = MJsonNode::MakeObject();
r->AddToObject("status", MJsonNode::MakeInt(SUCCESS));
ss_repair_utf8(path);
r->AddToObject("path", MJsonNode::MakeString(path.c_str()));
r->AddToObject("subdirs", s);
r->AddToObject("files", f);
return mjsonrpc_make_result(r);
}
//
// to create your own rpc method handler, copy one of the examples here, register it in user_init below
//
//
// user_init function is called at startup time to register user rpc method handlers
//
void mjsonrpc_user_init()
{
if (mjsonrpc_debug) {
printf("mjsonrpc_user_init!\n");
}
// add user functions to the rpc list
mjsonrpc_add_handler("user_example1", user_example1);
mjsonrpc_add_handler("user_example2", user_example2);
mjsonrpc_add_handler("user_example3", user_example3);
mjsonrpc_add_handler("any_list_files", js_any_list_files, true);
}
/* emacs
* Local Variables:
* tab-width: 8
* c-basic-offset: 3
* indent-tabs-mode: nil
* End:
*/
|
664
|
19 Oct 2009 |
Exaos Lee | Forum | It' better to fix this warnings | > There is no "type conversions". The compiler is whining about code like this:
>
> /* data type names */
> static char *tid_name[] = {
> "NULL",
> "BYTE",
> ...
>
> I guess we should keep the compiler happy and make them "static const char*".
>
> BTW, my compiler is SL5.2 gcc-4.1.2 and it does not complain. What's your compiler?
>
> K.O.
When I use "make" with odbedit, the generated "experim.h" also contains such codes as:
#define EXPCVADC_COMMON_STR(_name) char *_name[] = {\
"[.]",\
...
This will cause "type conversion" warnings. I hope that "odbedit" can generate codes like this:
#define EXPCVADC_COMMON_STR(_name) const char *_name[] = {\
"[.]",\
...
In fact, "const char*" is enough to suppress the warnings. Using "const char* foo=\"blarblar\"" is a good habit because it can avoid the following bugs:
char *s = "whatever";
...
strcpy(s, "Hello, this is a string longer than the initial one.");
The above code can successfully generate an executable, but it will encounter segmentation fault while executing. "const char*" means we should not change the variable in other place, which is important to suppress bugs.
Another problem, if I change the "experim.h" as I wished, new warnings appeared when the compiler parsing the following code:
status = db_create_record(hDB, 0, set_str, strcomb(expcvadc_settings_str));
Warning:
cvadcfe.c: In function ‘frontend_init’:
cvadcfe.c:144: warning: passing argument 1 of ‘strcomb’ from incompatible pointer type
|
670
|
10 Nov 2009 |
Stefan Ritt | Forum | It' better to fix this warnings | > This will cause "type conversion" warnings. I hope that "odbedit" can generate codes like this:
>
> #define EXPCVADC_COMMON_STR(_name) const char *_name[] = {\
> "[.]",\
>...
Ok, I changed that in odb.c rev. 4620, should be fine now. |
2566
|
02 Aug 2023 |
Caleb Marshall | Forum | Issues with Universe II Driver | Hello,
At our lab we are currently in the process of migrating more of our systems over to Midas. However, all of our working systems are dependent on SBCs with the Tsi-148 chips of which we only have a handful. In order to have some backups and spares for testing, we have been attempting to get Midas working with some borrowed SBCs (Concurrent Technologies VX 40x/04x) with Universe-II chips. The SBC is running CentOS 7. I have tried to follow the instructions posted here. The universe-II kernel module appears to load correctly, dmesg gives:
[ 32.384826] VME: Board is system controller
[ 32.384875] VME: Driver compiled for SMP system
[ 32.384877] VME: Installed VME Universe module version: 3.6.KO6
However, running vmescan.exe fails with a segfault. Running with gdb shows:
vmic_mmap: Mapped VME AM 0x0d addr 0x00000000 size 0x00ffffff at address 0x80a01000
mvme_open:
Bus handle = 0x7
DMA handle = 0x6045d0
DMA area size = 1048576 bytes
DMA physical address = 0x7ffff7eea000
vmic_mmap: Mapped VME AM 0x2d addr 0x00000000 size 0x0000ffff at address 0x86ff0000
Program received signal SIGSEGV, Segmentation fault.
mvme_read_value (mvme=0x604010, vme_addr=<optimized out>)
at /home/jam/midas/packages/midas/drivers/vme/vmic/vmicvme.c:352
352 dst = *((WORD *)addr);
With the pointer addr originating from a call to vmic_mapcheck within the mvme_read_value functions in the vmicvme.c file. Help with where to go from here would be appreciated.
-Caleb
|
2567
|
02 Aug 2023 |
Konstantin Olchanski | Forum | Issues with Universe II Driver | I maintain the tsi148 and the universe-II drivers. I confirm -KO6 is my latest
version, last updated for 32-bit Debian-11, and we still use it at TRIUMF.
It is good news that the vme_universe kernel module built, loaded and reported
correct stuff to dmesg.
It is not clear why mvme_read_value() crashed. We need to know the value of
vme_addr and addr, can you add printf()s for them using format "%08x" and try
again?
K.O.
<p> </p>
<table align="center" cellspacing="1" style="border:1px solid #486090;
width:98%">
<tbody>
<tr>
<td style="background-color:#486090">Caleb Marshall
wrote:</td>
</tr>
<tr>
<td style="background-color:#FFFFB0">
<p>Hello,</p>
<p>At our lab we are currently in the process of
migrating more of our systems over to Midas. However, all of our working systems
are dependent on SBCs with the Tsi-148 chips of which we only have a handful. In
order to have some backups and spares for testing, we have been attempting to
get Midas working with some borrowed SBCs (Concurrent Technologies VX 40x/04x)
with Universe-II chips. The SBC is running CentOS 7. I have tried to
follow the instructions posted <a
href="https://daq00.triumf.ca/DaqWiki/index.php/VME-
CPU#V7648_and_V7750_BIOS_Settings">here</a>. The universe-II kernel module
appears to load correctly, dmesg gives:</p>
<p>[ 32.384826] VME: Board is system
controller<br />
[ 32.384875] VME: Driver compiled for SMP
system<br />
[ 32.384877] VME: Installed VME Universe module
version: 3.6.KO6<br />
</p>
<p>However, running vmescan.exe fails with a segfault.
Running with gdb shows:</p>
<p>vmic_mmap: Mapped VME AM 0x0d addr 0x00000000 size
0x00ffffff at address 0x80a01000<br />
mvme_open:<br />
Bus handle
= 0x7<br />
DMA handle
= 0x6045d0<br />
DMA area size =
1048576 bytes<br />
DMA physical address = 0x7ffff7eea000<br />
vmic_mmap: Mapped VME AM 0x2d addr 0x00000000 size
0x0000ffff at address 0x86ff0000</p>
<p>Program received signal SIGSEGV, Segmentation fault.
<br />
mvme_read_value (mvme=0x604010, vme_addr=<optimized
out>)<br />
at
/home/jam/midas/packages/midas/drivers/vme/vmic/vmicvme.c:352<br />
352 dst = *((WORD
*)addr);<br />
</p>
<p>With the pointer addr originating from a call
to vmic_mapcheck within the mvme_read_value functions in the
vmicvme.c file. Help with where to go from here would be appreciated.</p>
<p>-Caleb </p>
<p> </p>
</td>
</tr>
</tbody>
</table>
<p> </p> |
2570
|
03 Aug 2023 |
Caleb Marshall | Forum | Issues with Universe II Driver | Here is the output:
vmic_mmap: Mapped VME AM 0x0d addr 0x00000000 size 0x00ffffff at address 0x80a01000
mvme_open:
Bus handle = 0x3
DMA handle = 0x158f5d0
DMA area size = 1048576 bytes
DMA physical address = 0x7f91db553000
vmic_mmap: Mapped VME AM 0x2d addr 0x00000000 size 0x0000ffff at address 0x86ff0000
vme addr: 00000000
addr: db543000 |
2571
|
03 Aug 2023 |
Konstantin Olchanski | Forum | Issues with Universe II Driver | > Here is the output:
>
> vmic_mmap: Mapped VME AM 0x0d addr 0x00000000 size 0x00ffffff at address 0x80a01000
> mvme_open:
> Bus handle = 0x3
> DMA handle = 0x158f5d0
> DMA area size = 1048576 bytes
> DMA physical address = 0x7f91db553000
> vmic_mmap: Mapped VME AM 0x2d addr 0x00000000 size 0x0000ffff at address 0x86ff0000
> vme addr: 00000000
> addr: db543000
I see the problem. A24 is mapped at 0x80xxxxxx, A16 is mapped at 0x86ffxxxx, but
mvme_read computed address 0xdb543000, out of range of either mapped vme address. ouch.
One more thing to check, AFAIK, this universe-II codes were never used on 64-bit CPU
before, we only have 32-bit Pentium-3 and Pentium-4 machines with these chips. The
tsi148 codes used to work both 32-bit and 64-bit, we used to have both flavours of
CPUs, but now only have 64-bit.
What is your output for "uname -a"? does it report 32-bit or 64-bit kernel?
If you feel adventurous, you can build 32-bit midas (cd .../midas; make linux32),
compile vmescan.o with "-m32" and link vmescan.exe against .../midas/linux-m32/lib, and
see if that works. Meanwhile, I can check if vmicvme.c is 64-bit clean. Checking if
kernel module is 64-bit clean would be more difficult...
K.O. |
2572
|
03 Aug 2023 |
Caleb Marshall | Forum | Issues with Universe II Driver | I am looking into compiling the 32 bit midas.
In the meantime, here is the kernel info:
3.10.0-1160.11.1.el7.x86_64
Thank you for the help.
-Caleb |
2574
|
04 Aug 2023 |
Caleb Marshall | Forum | Issues with Universe II Driver | I can compile 32 bit midas. Unless I am interpreting the linking error, I don't
think I can use the driver as built.
While trying to compile vme_scan, most of the programs fail with:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-
linux/4.8.5/../../../../lib/libvme.so when searching for -lvme
/usr/bin/ld: skipping incompatible /lib/../lib/libvme.so when searching for -lvme
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libvme.so when searching for -
lvme
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-
linux/4.8.5/../../../libvme.so when searching for -lvme
/usr/bin/ld: skipping incompatible //lib/libvme.so when searching for -lvme
/usr/bin/ld: skipping incompatible //usr/lib/libvme.so when searching for -lvme
with libvme.so being built by the universe-II driver. Not sure if I can get around
this without messing with the driver? Is it possible to build a 32 bit version of
that shared library without having to touch the actual kernel module?
-Caleb |
|