[GH-ISSUE #957] Access violation when opening a WebCam #732

Closed
opened 2026-02-26 09:32:27 +03:00 by kerem · 13 comments
Owner

Originally created by @d0vgan on GitHub (Jul 27, 2021).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/957

ScreenToGif 2.32 and 2.33.1 under Windows 8.1 64-bit and under Windows 10 64-bit.
ScreenToGif silently crashes once the "WebCam" button is pressed.
I've built ScreenToGif from the sources and see the following call stack under debugging:

System.AccessViolationException

ScreenToGif.exe!ScreenToGif.Webcam.DirectX.CaptureWebcam.RenderGraph() Line 475 C#
ScreenToGif.exe!ScreenToGif.Webcam.DirectX.CaptureWebcam.StartPreview() Line 201 C#
ScreenToGif.exe!ScreenToGif.Controls.WebcamControl.Refresh() Line 70 C#

What might be the reason and how to fix that?

Originally created by @d0vgan on GitHub (Jul 27, 2021). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/957 ScreenToGif 2.32 and 2.33.1 under Windows 8.1 64-bit and under Windows 10 64-bit. ScreenToGif silently crashes once the "WebCam" button is pressed. I've built ScreenToGif from the sources and see the following call stack under debugging: System.AccessViolationException > ScreenToGif.exe!ScreenToGif.Webcam.DirectX.CaptureWebcam.RenderGraph() Line 475 C# ScreenToGif.exe!ScreenToGif.Webcam.DirectX.CaptureWebcam.StartPreview() Line 201 C# ScreenToGif.exe!ScreenToGif.Controls.WebcamControl.Refresh() Line 70 C# What might be the reason and how to fix that?
kerem closed this issue 2026-02-26 09:32:27 +03:00
Author
Owner

@pawlos commented on GitHub (Jul 27, 2021):

Isn't this the same as #150? The stack trace is similar but not exactly the same (different capture mode?)

<!-- gh-comment-id:887772598 --> @pawlos commented on GitHub (Jul 27, 2021): Isn't this the same as #150? The stack trace is similar but not exactly the same (different capture mode?)
Author
Owner

@d0vgan commented on GitHub (Jul 27, 2021):

Yes, seems to be pretty similat. The WebCam is Logitech C310.

<!-- gh-comment-id:887795804 --> @d0vgan commented on GitHub (Jul 27, 2021): Yes, seems to be pretty similat. The WebCam is Logitech C310.
Author
Owner

@d0vgan commented on GitHub (Jul 28, 2021):

Closing as duplicate of #150.
If anything else is needed from me or if I could help with further investigations, please let me know.

<!-- gh-comment-id:888102225 --> @d0vgan commented on GitHub (Jul 28, 2021): Closing as duplicate of #150. If anything else is needed from me or if I could help with further investigations, please let me know.
Author
Owner

@pawlos commented on GitHub (Aug 1, 2021):

@d0vgan I was thinking maybe I could start looking into this issue. Would you be willing to provide a crash dump from this situation? ProcDump can be used for that (I can provide the command-line params if needed)

<!-- gh-comment-id:890503053 --> @pawlos commented on GitHub (Aug 1, 2021): @d0vgan I was thinking maybe I could start looking into this issue. Would you be willing to provide a crash dump from this situation? [ProcDump](https://docs.microsoft.com/en-us/sysinternals/downloads/procdump) can be used for that (I can provide the command-line params if needed)
Author
Owner

@d0vgan commented on GitHub (Aug 2, 2021):

Attaching a minidump file (zipped). Please let me know if something else is needed.
ScreenToGif.exe_210802_092631.dmp.zip

<!-- gh-comment-id:890760406 --> @d0vgan commented on GitHub (Aug 2, 2021): Attaching a minidump file (zipped). Please let me know if something else is needed. [ScreenToGif.exe_210802_092631.dmp.zip](https://github.com/NickeManarin/ScreenToGif/files/6914792/ScreenToGif.exe_210802_092631.dmp.zip)
Author
Owner

@pawlos commented on GitHub (Aug 2, 2021):

@d0vgan thx. This is dump when the AccessViolation exception happens and Screen2Gif closes?

<!-- gh-comment-id:891128139 --> @pawlos commented on GitHub (Aug 2, 2021): @d0vgan thx. This is dump when the AccessViolation exception happens and Screen2Gif closes?
Author
Owner

@d0vgan commented on GitHub (Aug 2, 2021):

Yes. At least I've run ProcDump when an exception was being shown in Visual Studio under debugging.
I was not able to dump it without debugging because ScreenToGif just silently crashed.

<!-- gh-comment-id:891139248 --> @d0vgan commented on GitHub (Aug 2, 2021): Yes. At least I've run ProcDump when an exception was being shown in Visual Studio under debugging. I was not able to dump it without debugging because ScreenToGif just silently crashed.
Author
Owner

@pawlos commented on GitHub (Aug 2, 2021):

@d0vgan hmm, what procdump command did you run?

<!-- gh-comment-id:891140033 --> @pawlos commented on GitHub (Aug 2, 2021): @d0vgan hmm, what `procdump` command did you run?
Author
Owner

@d0vgan commented on GitHub (Aug 2, 2021):

procdump64.exe ScreenToGif.exe
<!-- gh-comment-id:891162058 --> @d0vgan commented on GitHub (Aug 2, 2021): ``` procdump64.exe ScreenToGif.exe ```
Author
Owner

@pawlos commented on GitHub (Aug 2, 2021):

@d0vgan could you try procdump -ma -e ScreenToGif.exe - and then repro the AccessViolation case? It should create the dump exactly in the moment when the unhandled exception occurs (-e). ma will create the full dump (might not be needed) but I always prefer to have the full pciture.

<!-- gh-comment-id:891171772 --> @pawlos commented on GitHub (Aug 2, 2021): @d0vgan could you try `procdump -ma -e ScreenToGif.exe` - and then repro the AccessViolation case? It should create the dump exactly in the moment when the unhandled exception occurs (`-e`). `ma` will create the full dump (might not be needed) but I always prefer to have the full pciture.
Author
Owner

@d0vgan commented on GitHub (Aug 2, 2021):

Please find the full dump here (124 MB in a .zip archive):
https://drive.google.com/drive/folders/1MZ0qshwPu0y8P8xJLspKYsI3L2gOFzzE

<!-- gh-comment-id:891216153 --> @d0vgan commented on GitHub (Aug 2, 2021): Please find the full dump here (124 MB in a .zip archive): https://drive.google.com/drive/folders/1MZ0qshwPu0y8P8xJLspKYsI3L2gOFzzE
Author
Owner

@pawlos commented on GitHub (Aug 2, 2021):

thx. With this one I can see the crash is in lvcod64.dll, now I will try to figure out why

<!-- gh-comment-id:891319241 --> @pawlos commented on GitHub (Aug 2, 2021): thx. With this one I can see the crash is in lvcod64.dll, now I will try to figure out why
Author
Owner

@pawlos commented on GitHub (Aug 5, 2021):

Ok, tried to analyze to see if Screen2Gif can do anything to make this bug go away, but it looks like the problem is in fact in lvcod64.dll as it's from ~2012 and not updated since then. Seen some reports that it doesn't work well when camera is attached to USB3 port - not sure how much it's valid. The analysis is not an easy one as there are 18 frames between Screen2Gif and the faulty call - the problem might be in some calls prior to the one we see an exception. I found numerous similar reports in other programs in relations to this lib and the results were pretty similar.

I think one of the solution (what was also mentioned in some places) is just to not add a source that is handled by this lib - not sure how/if that's possible, that would at least not cause a crash when picking such faulty driver for camera

Ps. I can also see that OBS virtual camera is also not working with Screen2gif.

cc: @NickeManarin

<!-- gh-comment-id:893695553 --> @pawlos commented on GitHub (Aug 5, 2021): Ok, tried to analyze to see if Screen2Gif can do anything to make this bug go away, but it looks like the problem is in fact in lvcod64.dll as it's from ~2012 and not updated since then. Seen some reports that it doesn't work well when camera is attached to USB3 port - not sure how much it's valid. The analysis is not an easy one as there are 18 frames between Screen2Gif and the faulty call - the problem might be in some calls prior to the one we see an exception. I found numerous similar reports in other programs in relations to this lib and the results were pretty similar. I think one of the solution (what was also mentioned in some places) is just to not add a source that is handled by this lib - not sure how/if that's possible, that would at least not cause a crash when picking such faulty driver for camera Ps. I can also see that OBS virtual camera is also not working with Screen2gif. cc: @NickeManarin
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#732
No description provided.