I've recently started developement of thousand ways to crash LV my own provider , and I've encountered a little problem.
I have this Global_OnCommand method implemented:
VERITECH_LVCM_RUN command is registered as item in Tools menu.
When I select this menu item from Project Explorer window, everything works fine - _Veritech_LVCM.vi is called as expected.
However, when I select this item in any other window (i.e. Getting Started window, VI window, or any other), LV crashes:
I have a feeling that this might not be really unexpected and I'm just missing something - can anyone give me a hint? Here's my ini file for reference:
I've recently started developement of thousand ways to crash LV
I've likewise perfected this art; fortunately, have begun to learn the science of avoiding the "art"! Send me a message to my first name @wirebirdlabs.com, and perhaps we can screenshare to investigate the issue?
I don't know offhand exactly what this is, but I have seen some weird issues with calling VIs programmatically in the provider context, and there may be some special weirdness with using the "Call and Forget" features.
Thanks for offering your help here Jack, let us know if you guys are able to pin it down or if you need some additional assistance.
Jack, the exact moment I've got notification about your message here, I've also got the idea what might be wrong... Coincidence...?
Here's the thing:
I've got some tools developed earlier, which I put into "<LVDirectory>\project\Veritech" path. This makes LV create Tools->Veritech menu automatically, where I can select my tools.
When I started working on provider, I've decided to put global commands into the same (Veritech) menu. Apparently if you do this (put provider menus into menu created from <LVDir>\project\ directory), something goes wrong when provider commands are called from outside Project Explorer window and LV crashes.
I've attached project which reproduce this behaviour.
I can reproduce silent CTD when selecting the menu item from the GSW.
Looks like the "Crasher" is a red herring -- you can strip the _Veritech_LVCM_Global_OnCommand.vi diagram of everything except the "Object" and "Command ID" terminals (even delete err in and out), and the crash still occurs. Also, I recreated this VI from scratch and the problem persisted, meaning it's not a corrupting in your VI itself.
Perhaps, rather than trying to dynamically create this menu, you just drop those particular menu items in the Project dir? You can brand/localize the items using a ".txt" file to remap names to callback VIs. Perhaps you've already ruled this out technically, not sure...
Procmon did not turn up anything from a 2min "search for obvious problems"
It's not a solution, but hopefully it helps rule out some things!
Yup, that's right, I also observed this behaviour in my original code before. There is some problem with calling OnCommand itself when selecting menu item. Might be the dreaded context that David talked about - probably LV itself tries to call OnCommand in other than Provider context, when it is called from "project-directory-menu". Interesting thing that it works from Project Explorer window though... Would that mean that the situation is reversed there and all the VIs from Tools menu in Project Explorer window are called in Provider context? I'll need to check.
Anyway, I think it's work for R&D here
Just for information: this issue is also present in LV2013.
I have few ideas for workarounds. It's much easier to find solution when you know the source of problem
Do you have the stripped down version that crashed that you don't mind posting? If not I can use PiDis and go from there, but figured I'd save some work if you still had it handy.
Anyway, I think it's work for R&D here
Once I reproduce it here I'll CAR it to R&D and post the results and CAR number here.
I'm glad you have workarounds for now. If these don't work for some reason and this becomes more urgent, let us know and I can try to escalate faster.