# Load\_stimulus issue

**URL:** <https://mworks.discourse.group/t/load-stimulus-issue/91>\
**Category:** Support\
**Created:** [December 20, 2021, 4:11pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91 "2021-12-20T16:11:04Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 20, 2021, 4:11pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/1 "2021-12-20T16:11:04Z")

</div>

Hi Chris,

We are having an issue with an experiment in which we are presenting images from a local directory. The experiment loads fine, but when load\_stimulus is called the program crashes. The strange part is that this experiment worked fine a few months ago, and as far as we know nothing has changed about MWorks, the OS, etc.

I’ve attached a copy of the crash error and the xml- the error occurs on when these lines are executed:

Do you have any sense of what the issue might be?

Thanks,  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 20, 2021, 4:11pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/2 "2021-12-20T16:11:04Z")

</div>

Attachments:

- [loadStimulusCrashReport.rtf](https://mworks.discourse.group/uploads/short-url/90P3DDwjFHLDLLuVJ3aXQfew1pf.rtf) (135 KB)
- [bunnies6.xml](https://mworks.discourse.group/uploads/short-url/sJuanTRBtJXS8eGNEJfAYevC4Uc.xml) (25 KB)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 20, 2021, 5:06pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/3 "2021-12-20T17:06:09Z")

</div>

Hi Lindsey,

It looks like the crash occurs not in load\_stimulus but rather during update\_stimulus\_display (possibly immediately after the load\_stimulus, although I can’t tell from the crash log). It also looks like part of the load is happening asynchronously and hasn’t completed yet. This may be the cause of the crash, which occurs inside the graphics driver.

Would it be possible to add a short wait (maybe 100ms) right after the load\_stimulus actions? That should give the asynchronous part of the load (which MWorks unfortunately has no knowledge of or control over) time to finish.

Alternatively, I suspect this wouldn’t be an issue with a recent nightly build. MWorks’ stimulus rendering code has been modernized and basically completely rewritten since the build you’re using, and it wouldn’t even use the driver that’s triggering this crash.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 5:13pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/4 "2021-12-21T17:13:41Z")

</div>

Hi Chris,  
We updated to the nightly and added the wait statement. Now there is a  
crash after the first trial.  
I’ve attached the Apple and Console crash reports.  
Thanks  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 5:13pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/5 "2021-12-21T17:13:41Z")

</div>

Attachments:

- [load\_stimulus\_ConsoleCrash.rtf](https://mworks.discourse.group/uploads/short-url/8xB9QSEeAjbGv8S3mfPKZAM4Reh.rtf) (11.7 KB)
- [load\_stimulus\_AppleCrash.rtf](https://mworks.discourse.group/uploads/short-url/JVMPkxkkMnstg1bIgDXFV7qRhG.rtf) (231 KB)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 5:18pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/6 "2021-12-21T17:18:44Z")

</div>

Also- this seems to be a more general issue as we get the same crash when  
running other experiments that do not load images.  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 5:57pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/7 "2021-12-21T17:57:03Z")

</div>

Hi Chris,  
Looks like there is an issue with Matlab communication. We ensured that  
the matlab setup is correct (using these  
[https://mworks.tenderapp.com/kb/data-analysis/setup-for-using-matlab](https://mworks.tenderapp.com/kb/data-analysis/setup-for-using-matlab)  
instructions), but it did not solve the issue.  
This is the error report that we got when using the terminal query:

hullglick5:/ hullglick$ /Applications/MWClient.app/Contents/MacOS/MWClient  
2021-12-21 12:41:44.287 MWClient[2955:9428162] log file path:  
/Users/hullglick/Library/Logs/MWorks/20211221\_124144287.log  
dyld: lazy symbol binding failed: Symbol not found: \_mxCreateStructArray\_800  
Referenced from: /Library/Application  
Support/MWorks/Plugins/Client/MWorksMATLABWindow.bundle/Contents/MacOS/MWorksMATLABWindow  
Expected in: /Applications/MATLAB\_R2014b.app/bin/maci64/libmx.dylib

dyld: Symbol not found: \_mxCreateStructArray\_800  
Referenced from: /Library/Application  
Support/MWorks/Plugins/Client/MWorksMATLABWindow.bundle/Contents/MacOS/MWorksMATLABWindow  
Expected in: /Applications/MATLAB\_R2014b.app/bin/maci64/libmx.dylib

Abort trap: 6

Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 7:01pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/8 "2021-12-21T19:01:43Z")

</div>

Did you recompile your LabJack plugin against the nightly build?

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 7:09pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/9 "2021-12-21T19:09:15Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 7:14pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/10 "2021-12-21T19:14:39Z")

</div>

OK. Is it just MWClient crashing now, or does MWServer crash, too?

Regarding MATLAB, MWorks’ MATLAB tools and MWClient’s MATLAB window are currently built against MATLAB R2018b. With the older MWorks build you were using, the MATLAB stuff was built against R2017b. It looks like you’re using MATLAB R2014b, so I’m surprised that things worked even with the older build. Switching to R2018b or later should fix things.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 7:18pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/11 "2021-12-21T19:18:16Z")

</div>

Yes- it is mwServer that crashes and mwClient stays open (though it is  
“frozen” and needs to be force quit).  
We’re updating Matlab now…  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 7:59pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/12 "2021-12-21T19:59:51Z")

</div>

OK. I asked because the latest crash report you sent was for MWClient. If there’s a crash report for MWServer, can you send that, too?

Also, if it’s possible for you to provide me with the image files you’re using, I can try running the experiment myself and see if I can reproduce the crash.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 21, 2021, 8:04pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/13 "2021-12-21T20:04:26Z")

</div>

Sorry- I had that backwards- it’s the Client that crashes not the Server.  
Let’s see if the new Matlab install fixes everything. If not, I’ll send  
you the images for testing.  
Thanks,  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 22, 2021, 1:37pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/14 "2021-12-22T13:37:12Z")

</div>

Updating MWorks and Matlab solved it- thanks!  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 22, 2021, 2:10pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/15 "2021-12-22T14:10:18Z")

</div>

Great! Thanks for letting me know.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 22, 2021, 5:35pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/16 "2021-12-22T17:35:39Z")

</div>

Hi Chris,  
There is still one small issue: MWServer does not quit normally. You have  
to “close experiment” rather than just command-Q, or it will crash and need  
to be force-quit.  
Thanks,  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 23, 2021, 3:02pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/17 "2021-12-23T15:02:09Z")

</div>

Hi Lindsey,

If there’s a crash report, you can send it to me, and I’ll take a look. However, you really should explicitly close the experiment whenever possible. Some things can’t shut down properly otherwise.

FYI, I’m on vacation starting today through the end of the month. If needed, I can follow up on this in January.

Happy holidays!

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 24, 2021, 6:03pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/18 "2021-12-24T18:03:04Z")

</div>

Hi Chris,  
Ok- we’ll close the experiment going forward- but I’ll grab an error report  
next time and send it.  
Also- we have a resurgence of the ehFeedback error with the new nightly.  
We merged your pull request from July that should fix this- so maybe the  
nightly introduces some new issue? Would be great if you could check on  
this when you’re back in town.  
Have a good holiday,  
Lindsey.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 6:36pm UTC](https://mworks.discourse.group/t/load-stimulus-issue/91/19 "2022-07-19T18:36:30Z")

</div>


