# MWorks Quitting Unexpectedly

**URL:** <https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62>\
**Category:** Support\
**Created:** [June 30, 2022, 3:25pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62 "2022-06-30T15:25:53Z")\
**Posts on this page:** 8\
**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:** [June 30, 2022, 3:25pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/1 "2022-06-30T15:25:53Z")

</div>

Hi Chris,

I’ve been working with a monkey who tends to rock while in the rig. To train him out of this behavior I was using the pause function in mworks to give him mini time-outs. However, this occasionally caused the mworks server to quit unexpectedly in the middle of an experiment. I’m wondering why this might be the case (maybe because the rig has an outdated version of mworks v0.9?) and if there are any potential solutions. It may be beneficial anyways to create a “timeout” variable that can be set to 1 which changes the screen to black or a different color so it is more obvious to the animal.

Thanks,  
Sarah

---

<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:** [June 30, 2022, 3:34pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/2 "2022-06-30T15:34:12Z")

</div>

Hi Sarah,

Can you send me any crash reports associated with this problem?

To do this: On the machine running MWServer, open the Console application (`/Applications/Utilities/Console.app`). In the sidebar, select Crash Reports. In the list that appears, find any with MWServer in the name. You should be able to drag and drop them in to an email message.

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:** [July 6, 2022, 9:04pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/3 "2022-07-06T21:04:59Z")

</div>

Hi Chris,

So sorry, this email got lost in my junk folder! Here are two crashes, I’ve experienced no crashes since the end of June which is great! But I have also been pausing much less.

Thank you!  
Sarah

---

<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 6, 2022, 9:04pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/4 "2022-07-06T21:04:59Z")

</div>

Attachments:

- [MWServer\_2022-06-22-154035\_datamacos-Mac-Pro.crash](https://mworks.discourse.group/uploads/short-url/zPT3Q2nXBEcCaHYaGUiYfy4NMtE.crash) (91.3 KB)
- [MWServer\_2022-06-23-165630\_datamacos-Mac-Pro.crash](https://mworks.discourse.group/uploads/short-url/9Z8C9x2dkfIA02GQQ7R9eyyHEJ4.crash) (85.8 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:** [July 26, 2022, 4:05pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/8 "2022-07-26T16:05:01Z")

</div>

Hi Sarah,

Apologies for the delay in responding.

Thank you for sharing the crash reports. It looks like the crashes are due to a bug in MWorks. The specific circumstances of the crashes are

1. The experiment is paused while a [sound](https://mworks.github.io/documentation/latest/components/sound_stimulus.html) is playing.
2. Immediately after the experiment is resumed, it starts playing the same sound that was paused.

The result is that, after the experiment resumes, it attempts to play the same sound in two different places. This triggers the bug that leads to MWServer crashing.

I will fix the bug, so that it isn’t present in the nighty build or future releases. However, I’m not sure how best to avoid the bug with the version of MWorks you’re currently using. I guess you could just try not to pause while a sound is playing, although that may be difficult. Your idea of adding a “timeout” state, controlled by a variable that you set manually, is probably a better solution, as it would eliminate the need to pause the experiment altogether.

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:** [July 28, 2022, 7:23pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/9 "2022-07-28T19:23:39Z")

</div>

@sgouldin This bug should be fixed in the current MWorks [nightly build](https://mworks.github.io/downloads/).

---

<div class="post-metadata">

**Author:** ![sgouldin](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sgouldin](https://mworks.discourse.group/u/sgouldin)\
**Post date:** [August 3, 2022, 2:30pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/10 "2022-08-03T14:30:22Z")

</div>

Thanks Chris! Even if we can’t update right now, it’s helpful to know why it was only occasionally crashing so I can try to avoid pausing during sounds in the future.

---

<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:** [August 4, 2022, 12:36pm UTC](https://mworks.discourse.group/t/mworks-quitting-unexpectedly/62/11 "2022-08-04T12:36:36Z")

</div>


