Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch 5.15.0.4 crashes my VS 17.14.7 again and again and again...
Anders Juul
#1 Posted : Monday, August 4, 2025 6:13:31 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2020(UTC)
Posts: 9
Location: Denmark

Thanks: 1 times
Hi NCrunch,

NCrunch is crashing my VS (becomes unresponsive). Like all the time! It appears to be linked to moving the windows around. As I work both from office and home with different screens it happens a lot.

I'd be happy to help if you e.g. produce debug versions with extra logging or whatever.

Great product when it doesnt crash!
Remco
#2 Posted : Monday, August 4, 2025 6:21:50 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,339

Thanks: 991 times
Was thanked: 1334 time(s) in 1237 post(s)
Hi,

Thanks for sharing this issue.

Is this something you can reproduce at will? If so, can you do it with a second VS instance debugger attached to it? It would be awesome to get a stack trace if possible.
Anders Juul
#3 Posted : Monday, August 4, 2025 6:25:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2020(UTC)
Posts: 9
Location: Denmark

Thanks: 1 times
Hi Remco,
That was fast response ;)

Yes, it happens so frequently that I could do that.

So -- start VS with my usual project, start another and attach to dev.exe? Then make first one crash?
Anders Juul
#4 Posted : Monday, August 4, 2025 6:38:42 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2020(UTC)
Posts: 9
Location: Denmark

Thanks: 1 times
Dfferent behaviour with debugger attached. Moving the test window it just dissappears. VS not responding but different from before, it's like windows 11 doesnt notice that it's unresponsive.
Task manager shows 45-50% processor usage still after five minutes. Memomy is maxing out at 32gb (my physical limit). Disk also maxing out now, I imagine swapping.
While VS before was greyed-out unresponsive, I am now not able to close the application, it's just ignored.

I detached and attached again. Now I was able to shut down unresponsive instance.

I don't get information to relay to you -- please advice on what I should do.
Remco
#5 Posted : Monday, August 4, 2025 7:03:31 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,339

Thanks: 991 times
Was thanked: 1334 time(s) in 1237 post(s)
Could you try starting a profiling session over the buggy instance instead of a debugger? This should help to find the routine that eating all the CPU.
Anders Juul
#6 Posted : Monday, August 4, 2025 9:20:40 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2020(UTC)
Posts: 9
Location: Denmark

Thanks: 1 times
I can also get it to crash by closing Tests and Metrics, resizing the docked windows, then trying to open Tests window via Tools-NCrunch menu.
I'm running as administrator, by the way.
I should also add that the problem has occured over multiple machines, some on tight company regulation some owned by me and running from home with minimal restrictions.

Starting the VS for profiling, I (accidently) resized Tests window, but without having NCrunch enabled (no open solution). This did not crash VS.

I did the profiling for three minutes after VS Freeze and uploaded Report20250804-1108.diagsession (164mMB) to here:
https://drive.google.com...ytQy/view?usp=drive_link
Anders Juul
#7 Posted : Monday, August 4, 2025 9:32:39 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2020(UTC)
Posts: 9
Location: Denmark

Thanks: 1 times
Opening my solution with NCrunch already enabled.
Closing all tools windows (including Tests and Metrics)
Resizing text editor (Error list and more still occupying bottom of screen).
Opening Tests via menu

=> No crash.

But Tests window looks 'funny'

https://drive.google.com..._8aNNHC/view?usp=sharing
Remco
#8 Posted : Monday, August 4, 2025 12:47:18 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,339

Thanks: 991 times
Was thanked: 1334 time(s) in 1237 post(s)
Thanks for sharing this report. It was quite illuminating.

The problem seems to stem from the trace output in the Tests Window. When dragging the resize of the window, it's causing a massive number of resize events to be raised, which causes the trace output to continually try to recalculate its sizing (an expensive operation when a lot of text is involved).

Do you have a large amount of text showing in your tests window trace output? If so, this does seem to be related to the pattern of crashing and hanging?
Anders Juul
#9 Posted : Monday, August 4, 2025 2:39:27 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2020(UTC)
Posts: 9
Location: Denmark

Thanks: 1 times
That was a bit tricky to dig out as my Tests window kept going blank and now minimize+restore causes hang as well :D

This is the largest chunk I could find in Trace Output. It's a relatively new hobby project started two weeks back. I have 33 tests in total.

Send me an email on ... if you want access to the source code.

[16:34:19 INF] Starting
[16:34:20 INF] Migrating Microsoft.EntityFrameworkCore.SqlServer
2025-08-04 16.34.20 +02:00 [INF] Beginning database upgrade
2025-08-04 16.34.20 +02:00 [INF] Checking whether journal table exists
2025-08-04 16.34.20 +02:00 [INF] Fetching list of already executed scripts.
2025-08-04 16.34.20 +02:00 [INF] No new scripts need to be executed - completing.
[16:34:20 INF] DbUp.Engine.DatabaseUpgradeResult
[16:34:20 INF] Outbox processor started
[16:34:21 INF] DbExists
[16:34:21 INF] Migrating
[16:34:21 INF] Migrating Microsoft.EntityFrameworkCore.SqlServer
2025-08-04 16.34.21 +02:00 [INF] Beginning database upgrade
2025-08-04 16.34.21 +02:00 [INF] Checking whether journal table exists
2025-08-04 16.34.21 +02:00 [INF] Fetching list of already executed scripts.
2025-08-04 16.34.21 +02:00 [INF] No new scripts need to be executed - completing.
[16:34:21 INF] Seeding
[16:34:21 INF] Request starting HTTP/1.1 POST http://localhost/employments - application/json; charset=utf-8 72
[16:34:21 WRN] Failed to determine the https port for redirect.
[16:34:21 INF] Executing endpoint 'HTTP: POST /employments'
[16:34:21 INF] Setting HTTP status code 201.
[16:34:21 INF] Writing value of type 'EmploymentDto' as Json.
[16:34:21 INF] Executed endpoint 'HTTP: POST /employments'
[16:34:21 INF] Request finished HTTP/1.1 POST http://localhost/employments - 201 null application/json; charset=utf-8 208.6354ms
[16:34:21 INF] Request starting HTTP/1.1 POST http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0 - application/json; charset=utf-8 68
[16:34:21 INF] Executing endpoint 'HTTP: POST /employments/{employmentId}'
[16:34:21 WRN] You do not have a valid license key for the Lucky Penny software MediatR. This is allowed for development and testing scenarios. If you are running in production you are required to have a licensed version. Please visit https://luckypennysoftware.com to obtain a valid license.
[16:34:22 INF] Setting HTTP status code 201.
[16:34:22 INF] Writing value of type 'WorkTimeSchemaDto' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: POST /employments/{employmentId}'
[16:34:22 INF] Request finished HTTP/1.1 POST http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0 - 201 null application/json; charset=utf-8 242.7349ms
[16:34:22 INF] Request starting HTTP/1.1 POST http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327 - application/json; charset=utf-8 88
[16:34:22 INF] Executing endpoint 'HTTP: POST /employments/{employmentId}/{workTimeSchemaId}'
[16:34:22 INF] Setting HTTP status code 201.
[16:34:22 INF] Writing value of type 'DutyDto' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: POST /employments/{employmentId}/{workTimeSchemaId}'
[16:34:22 INF] Request finished HTTP/1.1 POST http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327 - 201 null application/json; charset=utf-8 72.4655ms
[16:34:22 INF] Request starting HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327/011ef686-93d8-4fed-8c0a-750349d29cad - application/json; charset=utf-8 88
[16:34:22 INF] Executing endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}/{dutyId}'
[16:34:22 INF] Setting HTTP status code 202.
[16:34:22 INF] Writing value of type 'IListSelectIterator`2' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}/{dutyId}'
[16:34:22 INF] Request finished HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327/011ef686-93d8-4fed-8c0a-750349d29cad - 202 null application/json; charset=utf-8 42.4622ms
[16:34:22 INF] Request starting HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327 - application/json; charset=utf-8 23
[16:34:22 INF] Executing endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}'
[16:34:22 INF] Setting HTTP status code 202.
[16:34:22 INF] Writing value of type 'WorkTimeSchemaDto' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}'
[16:34:22 INF] Request finished HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327 - 202 null application/json; charset=utf-8 48.1297ms
[16:34:22 INF] Request starting HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327 - application/json; charset=utf-8 23
[16:34:22 INF] Executing endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}'
[16:34:22 INF] Setting HTTP status code 202.
[16:34:22 INF] Writing value of type 'WorkTimeSchemaDto' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}'
[16:34:22 INF] Request finished HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327 - 202 null application/json; charset=utf-8 17.0875ms
[16:34:22 INF] Request starting HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327/011ef686-93d8-4fed-8c0a-750349d29cad - application/json; charset=utf-8 88
[16:34:22 INF] Executing endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}/{dutyId}'
[16:34:22 INF] Setting HTTP status code 202.
[16:34:22 INF] Writing value of type 'IListSelectIterator`2' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: PUT /employments/{employmentId}/{workTimeSchemaId}/{dutyId}'
[16:34:22 INF] Request finished HTTP/1.1 PUT http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327/011ef686-93d8-4fed-8c0a-750349d29cad - 202 null application/json; charset=utf-8 31.2409ms
[16:34:22 INF] Request starting HTTP/1.1 DELETE http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327/011ef686-93d8-4fed-8c0a-750349d29cad - null null
[16:34:22 INF] Executing endpoint 'HTTP: DELETE /employments/{employmentId}/{workTimeSchemaId}/{dutyId}'
[16:34:22 INF] Setting HTTP status code 202.
[16:34:22 INF] Writing value of type 'DutyDto' as Json.
[16:34:22 INF] Executed endpoint 'HTTP: DELETE /employments/{employmentId}/{workTimeSchemaId}/{dutyId}'
[16:34:22 INF] Request finished HTTP/1.1 DELETE http://localhost/employments/e506398d-f28f-4f81-baeb-140aa7d7a3e0/a8234dde-72c3-4ec9-82fc-d9694ebf4327/011ef686-93d8-4fed-8c0a-750349d29cad - 202 null application/json; charset=utf-8 17.2135ms
Remco
#10 Posted : Wednesday, August 6, 2025 8:15:38 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,339

Thanks: 991 times
Was thanked: 1334 time(s) in 1237 post(s)
Thanks for your help in understanding this issue.

I haven't myself been able to reproduce it, but I have some theories about what is happening. The profiling log you've provided shows that the resize handler is being hammered with around 30,000 events within the short space of the profiling session. The algorithm to resize the contents of the trace output is fairly expensive and was never designed to handle that kind of frequency. This causes the UI thread to be starved and the application appears to crash. While the application is in a starved state, most likely the resizing action becomes somewhat sticky and we end up in a death spiral.

I've arranged a speculative fix that changes the resize logic so that it sits on a timer thread to set a ceiling on the number of times the output text can be resized in a short space of time. In theory, this should resolve the problem. I'm wondering if you'd like to give it a try in the build below?

NCrunch_Console_5.17.0.1.msi
NCrunch_Console_5.17.0.1.zip
NCrunch_GridNodeServer_5.17.0.1.msi
NCrunch_GridNodeServer_5.17.0.1.zip
NCrunch_LicenseServer_5.17.0.1.zip
NCrunch_Rider_5.17.0.1.7z
NCrunch_Rider_5.17.0.1.zip
NCrunch_VS2010_5.17.0.1.msi
NCrunch_VS2010_5.17.0.1.zip
NCrunch_VS2012_5.17.0.1.msi
NCrunch_VS2012_5.17.0.1.zip
NCrunch_VS2013_5.17.0.1.msi
NCrunch_VS2013_5.17.0.1.zip
NCrunch_VS2015_5.17.0.1.msi
NCrunch_VS2015_5.17.0.1.msi.7z
NCrunch_VS2015_5.17.0.1.zip
NCrunch_VS2017_5.17.0.1.msi
NCrunch_VS2017_5.17.0.1.msi.7z
NCrunch_VS2017_5.17.0.1.zip
NCrunch_VS2019_5.17.0.1.msi
NCrunch_VS2019_5.17.0.1.msi.7z
NCrunch_VS2019_5.17.0.1.zip
NCrunch_VS2022_5.17.0.1.msi
NCrunch_VS2022_5.17.0.1.msi.7z
NCrunch_VS2022_5.17.0.1.zip


I feel the WM_RESIZE message frequency on your side may deserve some investigation. Probably this is being caused by a faulty mouse driver or something. It may give you problems with other software too. Regardless, I don't like the idea of having expensive work being done on resize events .. so a fix to NCrunch still makes sense.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.065 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download