# Slicer build error on Windows on the dashboard

**URL:** <https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967>\
**Category:** Development\
**Created:** [January 25, 2024, 2:51pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967 "2024-01-25T14:51:14Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 25, 2024, 2:51pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/1 "2024-01-25T14:51:14Z")

</div>

Since January 21, Slicer build on Windows has been failing (4 out of 5 cases) - [see dashbaord](https://slicer.cdash.org/index.php?project=SlicerPreview&begin=2024-01-01&end=2024-01-25&filtercount=2&showfilters=1&filtercombine=and&field1=site&compare1=63&value1=overload&field2=buildname&compare2=63&value2=Windows10) with this error:

```
LINK : fatal error LNK1104: cannot open file 'D:\D\P\S-0-build\DCMTK-build\bin\Release\ofstd.dll' [D:\D\P\S-0-build\DCMTK-build\ofstd\libsrc\ofstd.vcxproj] [D:\D\P\S-0-build\DCMTK.vcxproj]

```

There was a huge CTK update for the DICOM visual browser, but it should not affect DCMTK build. It is also odd that one build succeeded.

@Sam_Horvath OR @jcfr could you have a look? Does the file exist? Does restarting the build fixes the problem? Has anything been changed on the factory machine around January 21?

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [January 25, 2024, 3:00pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/2 "2024-01-25T15:00:37Z")

</div>

Looking at it now, will post back soon.

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [January 25, 2024, 3:11pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/3 "2024-01-25T15:11:40Z")

</div>

So, looking at the factory, the file exists, but there appears to be an executable hanging in the background that is holding the DLL:

`dcmqrscp.exe`  
Killing that allows DCMTK to proceed. I will make sure we get a full build with extensions out today.  
The build that succeeded coincides with a reboot of the machine I think.

Now looking into why that process is remaining open.

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [January 25, 2024, 3:29pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/4 "2024-01-25T15:29:13Z")

</div>

Suspicious commit:

> <https://github.com/commontk/CTK/commit/05a858af00cf3ca51933da321bc708dfaf52936d>
>
> This will prevent the following test from all running in parallel with
> a \`dcmqrs…cp\` executable configured to listen on the same port.
> 
> Tests either using "dcmqrscp" executable directly or through the
> \`ctkDICOMTester\` helper class:
> 
> \* ctkDICOMApplicationTest1
> \* ctkDICOMQueryTest2
> \* ctkDICOMRetrieveTest2
> \* ctkDICOMTesterTest1
> \* ctkDICOMTesterTest2

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [January 25, 2024, 3:35pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/5 "2024-01-25T15:35:34Z")

</div>

@jcfr Do we need to add a similar commit to this one to ensure that `dcmqrscp` is killed?

> <https://github.com/commontk/CTK/commit/5b502aa7160d96d09e4819138065bd32cd5534e2>
>
> Since the DCMTK executable do not seem to configure a termination handler on
> win…dows (using \`SetConsoleCtrlHandler()\`) or on Unix (using \`sigaction()\`),
> we speed up testing by simply killing the process.
> 
> \> On Windows, terminate() posts a WM\_CLOSE message to all top-level
> \> windows of the process and then to the main thread of the process
> \> itself. On Unix and macOS the SIGTERM signal is sent.
> \>
> \> Console applications on Windows that do not run an event loop, or whose
> \> event loop does not handle the WM\_CLOSE message, can only be terminated
> \> by calling kill().
> 
> Source: https://doc.qt.io/qt-5/qprocess.html#terminate

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 25, 2024, 3:41pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/6 "2024-01-25T15:41:50Z")

</div>

I also had to kill the process earlier this week. I originally thought the process was running due to tests I ran while testing CTK manually.

Since when Slicer is built, we do not explicitly run the CTK tests, I am not sure the linked commit is the culprit.

I will follow-up when I have an update.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 25, 2024, 5:13pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/7 "2024-01-25T17:13:31Z")

</div>

We may have to look into the following:

```plaintext
Modules/Scripted/DICOMLib/DICOMProcesses.py
Applications/SlicerApp/Testing/Python/JRC2013Vis.py

```

That are both starting the `dcmqrscp` process, I will further review later this evening.

Independently of addressing this, we will also look into updating the dashboard script so that it makes sure all instance of DCMTK application are “terminated” before initiating the next cycle of nightly build.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 25, 2024, 5:20pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/8 "2024-01-25T17:20:48Z")

</div>

Thanks for the investigations!

If you have the chance, it would be great if you could trigger a Slicer build/package/upload for the Slicer Preview Release so that users get a chance to test out Davide’s latest DICOM browser features and fixes.

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [January 25, 2024, 5:42pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/9 "2024-01-25T17:42:46Z")

</div>

Yep, a build has been started and is in progress.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 25, 2024, 6:07pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/10 "2024-01-25T18:07:30Z")

</div>

> [@jcfr](#):
>
> That are both starting the `dcmqrscp` process, I will further review later this evening.

dcmqrscp is a server and Windows firewall may show a popup asking the user for permission to open the port. This popup may interfere with the test exiting cleanly. If the user gave the permission once then I think it is not asked again for the same executable file (full path).

You can have a look at the list of allowed apps in the Control Panel\System and Security\Windows Defender Firewall\Allowed apps:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/3/13e6c04f9a9fd876f98e16de739dbd8c6dc742ff.png)

---

<div class="post-metadata">

**Author:** ![Davide\_Punzo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide_punzo/32/66104_2.png) [@Davide\_Punzo](https://discourse.slicer.org/u/Davide_Punzo)\
**Post date:** [January 26, 2024, 8:12am UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/11 "2024-01-26T08:12:51Z")

</div>

Today windows build has failed as well ☹ and the last available Windows download is from 23. Would be possible for you to check again @Sam_Horvath ? thanks in advance.

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [January 26, 2024, 3:20pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/12 "2024-01-26T15:20:05Z")

</div>

Will do. I think it is the same issue, just not yet resolved.

Re: latest build, the download page for me has the build I triggered yesterday, and that should have the latest changes from the visual DICOM browser.

I did note during that build yesterday that it was taking o very long time for the download page to update.

Another way to get the most recent package is from the cdash site: [CDash](https://slicer.cdash.org/index.php?project=SlicerPreview&date=2024-01-25), the yellow package next to the build name.

---

<div class="post-metadata">

**Author:** ![Davide\_Punzo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide_punzo/32/66104_2.png) [@Davide\_Punzo](https://discourse.slicer.org/u/Davide_Punzo)\
**Post date:** [January 26, 2024, 5:07pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/13 "2024-01-26T17:07:00Z")

</div>

Ah yes, now it is the latest version (this morning it was still the 23th). thanks for looking into it 🙂

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 26, 2024, 6:06pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/14 "2024-01-26T18:06:28Z")

</div>

It is indeed a server, we need to also understand which test is starting the server.

Away from computer travelling, i didn’t have a chance to further look into this.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 26, 2024, 11:38pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/15 "2024-01-26T23:38:07Z")

</div>

> This popup may interfere with the test exiting cleanly. If the user gave the permission once then I think it is not asked again for the same executable file (full path).
> 
> You can have a look at the list of allowed apps in the Control Panel\System and Security\Windows Defender Firewall\Allowed apps:

@lassoan Thanks for the detailed instructions, the settings have been updated accordingly.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/b/ebb6ee48d62c3e1f8e7ae9299dec9f66a4adbd64.png)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 27, 2024, 8:51pm UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/16 "2024-01-27T20:51:02Z")

</div>

Today’s dasboard didn’t report any issues related to the `dcmqrscp` process ✅

Thanks everyone for your input and help to sort this out 🙏

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 31, 2024, 2:50am UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/17 "2024-01-31T02:50:35Z")

</div>

After inspecting the process explorer (following similar error reported on the dashboard), the `dcmqrscp` process still persists once the Slicer (or Slicer extension ?) tests have been executed:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/d/2dc84ca2eb5f8acb4c365c7999df211680ce32cd.png)

I will investigate and report back.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [February 2, 2024, 7:19am UTC](https://discourse.slicer.org/t/slicer-build-error-on-windows-on-the-dashboard/33967/18 "2024-02-02T07:19:29Z")

</div>

Until we further improve the lifecycle associated with the execution of the `dcmqrscp`, a daily job has been setup to kill the process using before the the Preview build is started.

For reference, the following is executed:

```plaintext
taskkill /F /T /IM dcmqrscp.exe

```
