mdsplus icon indicating copy to clipboard operation
mdsplus copied to clipboard

Actmon crashing bug.

Open dgarnier opened this issue 1 year ago • 2 comments

Affiliation OpenStar

Version(s) Affected latest-alpha a

Platform Ubuntu 22.04

Describe the bug Dispatching an action will cause the action monitor to crash.

To Reproduce Steps to reproduce the behavior:

actmon -m JUNIOR_MONITOR &
mdstcl
TCL> set tree junior /shot=240112003
TCL> dispatch/build
TCL> dispatch/phase/monitor=JUNIOR_MONITOR init

Expected behavior Action monitor would fill with completed or completing actions.

likely clause

Its pretty clear that ServerSendMessage is calling the ast with its first argument in servershr/Job.h:

if (callback_done)
  callback_done(j->callback_param);

but its defined with a dummy first argument and a second argument in actions/actlogp.h:

static void MessageAst(void *dummy __attribute__((unused)), char *reply)

I did try to do this change.. but it and it fixes the crashing bug, but I'm not getting results to show up in actmon. Did this just die of bit rot at some stage?

dgarnier avatar Jan 13 '24 21:01 dgarnier

Hi there, I did a quick lookup on the callback and I think the caller should be found here. https://github.com/MDSplus/mdsplus/blob/3aea9338e4d05c116da95155437ff9ceb62f00c6/servershr/ServerMonitorCheckin.c#L69 So the signature seems to be right. You can try actlog instead of actmon for a terminal based variant of actmon (no x required). Maybe running it in gdb will point you in the right direction. If i remember correctly it is crutial that actmon/actlog have access to the action nodes and hence shot files in order to resolve the tree paths. there was a way to fallback to model files instead i think. also it may fail if it missed the newshot and subsequent build of the action tree.

zack-vii avatar Jan 15 '24 07:01 zack-vii

Hi Timo, Yes.. you are right. event_ast uses the correct prototype. The problem was I was using the "old method" of a mdsip based monitor server. This will use ServerSendMessage which has the problem. Based on your point, it shouldn't be changed in actlogp.h but in either with another wrapper in ServerMonitorCheckin.c or in ServerSendMessage.c. As far as I can tell, ServerSendMessage is only ever called with ast = NULL or from this one call, so probably it should be ServerSendMessage that gets corrected.. and better yet.. have a proper prototype in servershrp.h. So, this is a bug, but lower in my priority since I have a workaround. In the meantime, I have other issues with servershr.

dgarnier avatar Feb 03 '24 23:02 dgarnier