SharpCap 4.1.10910 64 bit crashing on Discord screen share

Discussions, Bug Reports and Issues related to Beta versions of SharpCap
DogWatch
Posts: 23
Joined: Wed Jun 21, 2023 4:15 am

SharpCap 4.1.10910 64 bit crashing on Discord screen share

#1

Post by DogWatch »

Robin-

This is an odd one. I have been using our club's Discord server to screen share my live stacking through all previous versions of SharpCap I have used without any issue (currently 4.0.9562 64 bit). However, SharpCap v4.1.10910 64 bit closes (crashes) immediately upon screen share on Discord. It doesn't matter what Sharpcap is doing at the time (live stacking, live view, folder monitor, no camera connected), it just closes immediately. When I try with v4.0.9562 64 bit, it screen shares and is rock steady no matter how hard I'm pushing it at the time. I am using Win10 and have been through all of my firewall and permission settings and they are identical for both versions (default). To be clear, I am able to see and choose v4.1.10910 64 bit in the Discord server screen share dialogue, but as soon as I start the screen share SharpCap just closes (crashes). There is no error message, it's just gone. If I immediately load v4.0.9562 64 bit, it screen shares without an issue.

I'm unsure how this can be a SharpCap issue, but I have eliminated all other possibilities... Thoughts?

Thanks,

Chuck
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#2

Post by admin »

Hi Chuck,

since it sounds as though this might be to do with how the application is displayed, worth trying the following

* Make sure your graphics card drivers are fully up-to-date. Go the the manufacturer of the graphics card chip (ie Intel/NVidia/AMD) for drivers, not the manufacturer of the PC/Laptop or the card itself, since the ones you get from Dell etc are often quite out-of-date.

* If new graphics card drivers do not help, try turning off the 'Use graphics card acceleration' in the first page of the SharpCap settings, then restarting to see if that helps

* Another thing to try - Screen share first, then run SharpCap to see what happens in that situation.

If you are still getting instant crashes after all of that, let me know as I can tell you how to capture a crash dump file that might help me work out what is going on and if I can fix it.

cheers,

Robin
DogWatch
Posts: 23
Joined: Wed Jun 21, 2023 4:15 am

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#3

Post by DogWatch »

Robin-

Thanks for the quick reply.
The plot thickens. In Discord, there is a toggle under settings that says "Use our advanced technology to capture your screen (Our signed DLL is injected into the application to capture frames)"
This toggle is set to "On" by default and whether it is on or off v4.0.9560 64 bit screen share works fine. If this toggle is set to "On" v4.1.10910 64 bit crashes immediately. If the toggle is set to "Off", v4.1.10910 64 bit appears to screen share without a problem. I have not tried it while Live Stacking yet, but will give it a go tonight.
Any idea why the two versions of SharpCap respond differently to this particular toggle?...obviously, the simple answer for now is to leave that toggle "off"

Thanks,

Chuck
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#4

Post by admin »

Hi Chuck,

sadly there are a vast range of differences between the two versions that might impact on this, but one of them is that SharpCap 4.0 was built on top of the Microsoft .NET Framework 4.5, whereas 4.1 is built on .NET 7. That changes a lot of things in addition to the changes in the code that I have made.

When I get some time I will see if I can install the software and make it crash here - it might just reveal the cause or give a pointer towards it. Good that there is a workaround though.

cheers,

Robin
DogWatch
Posts: 23
Joined: Wed Jun 21, 2023 4:15 am

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#5

Post by DogWatch »

Robin-

Thanks for looking into this issue (when you have time). I have also placed a bug report with Discord to look at it from their end. I will report back if/when I get anything from them.

Thanks again,

Chuck
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#6

Post by admin »

Hi Chuck,

brilliant, thanks for taking that approach. Turns out that my son uses Discord for gaming, so we are going to try the screen sharing thing on his PC this weekend.

cheers,

Robin
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#7

Post by admin »

Hi,

we just tested the Discord share and it breaks here too. Looking at the problem in a debugger reveals that the DiscordHook seems to be overrunning a stack buffer, which is detected by the system as a potential exploit causing the process to be terminated.

Code: Select all

ERROR_CODE: (NTSTATUS) 0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.
The information below may help the Discord developers track down the issue (Windbg error analysis of the problem).

cheers,

Robin

Code: Select all

*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Check Image - Checksum mismatch - Dump: 0x1f5ee6, File: 0x1fb3ea - C:\ProgramData\Dbg\sym\ntdll.dll\5212ECE51f8000\ntdll.dll

KEY_VALUES_STRING: 1

    Key  : Analysis.CPU.mSec
    Value: 2359

    Key  : Analysis.Elapsed.mSec
    Value: 11577

    Key  : Analysis.IO.Other.Mb
    Value: 148

    Key  : Analysis.IO.Read.Mb
    Value: 1

    Key  : Analysis.IO.Write.Mb
    Value: 204

    Key  : Analysis.Init.CPU.mSec
    Value: 2187

    Key  : Analysis.Init.Elapsed.mSec
    Value: 170782

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 217

    Key  : CLR.Engine
    Value: CORECLR

    Key  : CLR.Version
    Value: 7.0.923.32018

    Key  : FailFast.Name
    Value: GUARD_ICALL_CHECK_FAILURE

    Key  : FailFast.Type
    Value: 10

    Key  : Failure.Bucket
    Value: FAIL_FAST_GUARD_ICALL_CHECK_FAILURE_c0000409_DiscordHook64.dll!Unknown

    Key  : Failure.Hash
    Value: {01af5e04-7d8a-22d5-936b-72d4405cba67}

    Key  : Timeline.OS.Boot.DeltaSec
    Value: 883367

    Key  : Timeline.Process.Start.DeltaSec
    Value: 250

    Key  : WER.OS.Branch
    Value: vb_release

    Key  : WER.OS.Version
    Value: 10.0.19041.1

    Key  : WER.Process.Version
    Value: 4.1.10931.0


NTGLOBALFLAG:  0

PROCESS_BAM_CURRENT_THROTTLED: 0

PROCESS_BAM_PREVIOUS_THROTTLED: 0

APPLICATION_VERIFIER_FLAGS:  0

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ffb4d5f2350 (ntdll!RtlFailFast2)
   ExceptionCode: c0000409 (Security check failure or stack buffer overrun)
  ExceptionFlags: 00000001
NumberParameters: 1
   Parameter[0]: 000000000000000a
Subcode: 0xa FAST_FAIL_GUARD_ICALL_CHECK_FAILURE 

FAULTING_THREAD:  00001598

PROCESS_NAME:  SharpCap.exe

ERROR_CODE: (NTSTATUS) 0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.

EXCEPTION_CODE_STR:  c0000409

EXCEPTION_PARAMETER1:  000000000000000a

STACK_TEXT:  
00000009`505bf3c8 00007ffb`4d64d87d     : 00007ffb`4bf4cfd0 00000000`00000000 00007ffb`4bf55060 00007ffb`4bf4e840 : ntdll!RtlFailFast2
00000009`505bf3d0 00007ffb`4d5dc618     : 00000000`00001940 0000016b`84480000 00000000`0000002c 00007ffb`2b8e0fb1 : ntdll!RtlpHandleInvalidUserCallTarget+0x5d
00000009`505bf400 00007ffa`b9bc7ae2     : 00000009`00000040 00000000`00000a00 00000000`00000015 00000000`0000056d : ntdll!LdrpHandleInvalidUserCallTarget+0x38
00000009`505bf4c0 00007ffa`b9bc684a     : 0000016b`6ff34840 00007ffa`80ae6314 0000016b`70307c00 00000009`505bfb58 : DiscordHook64!Ordinal0+0x7ae2
00000009`505bf900 00007ffa`7b0e7f7a     : 00000000`00000001 00000000`0000003e 00000000`00000000 ffffffff`fffffffe : DiscordHook64!Ordinal0+0x684a
00000009`505bf9a0 00007ffa`7b0e7dea     : 0000016b`70367af0 0000016b`6ff34840 00000000`00000001 00040804`00002364 : wpfgfx_cor3!CD3DDeviceLevel1::PresentWithD3D+0x7a
00000009`505bfa10 00007ffa`7b1ce9fb     : 00000000`00000000 00000000`08760878 00000000`00000000 00000000`00000000 : wpfgfx_cor3!CD3DDeviceLevel1::Present+0x15a
00000009`505bfac0 00007ffa`7b1ce8df     : 00000000`00000000 00000000`00000000 00000000`00000000 00000009`505bfb78 : wpfgfx_cor3!CHwDisplayRenderTarget::PresentInternal+0x4b
00000009`505bfb10 00007ffa`7b1cefcb     : 0000de14`9b2c218c 00000000`00000000 0000016b`790311c8 00000000`00000008 : wpfgfx_cor3!CHwDisplayRenderTarget::Present+0x11f
00000009`505bfb90 00007ffa`7b1bbf42     : 00000000`00000000 00007ffa`7b19484f 00000000`00000001 00007ffa`7b181244 : wpfgfx_cor3!CHwHWNDRenderTarget::Present+0xb
00000009`505bfbc0 00007ffa`7b1bdad2     : 00000000`00000000 00000000`00000002 00000000`00000000 0000016b`6fe8b8b0 : wpfgfx_cor3!CDesktopRenderTarget::Present+0xd2
00000009`505bfc30 00007ffa`7b1962d6     : 0000016b`6fe8b8b0 00000009`505bfd10 0000016b`6fd303a0 00000009`505bfd20 : wpfgfx_cor3!CDesktopHWNDRenderTarget::Present+0x12
00000009`505bfc60 00007ffa`7b194b31     : 00000000`00000000 00000000`00000000 0000016b`6fd303a0 00000009`505bfd10 : wpfgfx_cor3!CSlaveHWndRenderTarget::Present+0x46
00000009`505bfc90 00007ffa`7b183ed8     : 00000000`00000000 00000000`00000000 00000000`00000000 00007ffa`7b140828 : wpfgfx_cor3!CRenderTargetManager::Present+0xe1
00000009`505bfce0 00007ffa`7b141069     : 00000000`00000000 0000016b`6fd9a9b0 00000000`00000000 0000016b`6ffc6a60 : wpfgfx_cor3!CComposition::Present+0x108
00000009`505bfd40 00007ffa`7b141130     : 0000016b`6ffc6a60 0000016b`6ffc6a60 00000000`00000000 0000016b`6ffc6a60 : wpfgfx_cor3!CPartitionThread::PresentPartition+0x29
00000009`505bfd70 00007ffa`7b140e53     : 0000016b`6fd9a9b0 00000000`00000000 00000000`00000000 00000000`00000000 : wpfgfx_cor3!CPartitionThread::Run+0x60
00000009`505bfda0 00007ffb`4bf47614     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : wpfgfx_cor3!CPartitionThread::ThreadMain+0x23
00000009`505bfdd0 00007ffb`4d5a26b1     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : KERNEL32!BaseThreadInitThunk+0x14
00000009`505bfe00 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21


SYMBOL_NAME:  discordhook64+7ae2

MODULE_NAME: DiscordHook64

IMAGE_NAME:  DiscordHook64.dll

STACK_COMMAND:  ~36s ; .cxr ; kb

FAILURE_BUCKET_ID:  FAIL_FAST_GUARD_ICALL_CHECK_FAILURE_c0000409_DiscordHook64.dll!Unknown

OS_VERSION:  10.0.19041.1

BUILDLAB_STR:  vb_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

FAILURE_ID_HASH:  {01af5e04-7d8a-22d5-936b-72d4405cba67}

Followup:     MachineOwner
---------
DogWatch
Posts: 23
Joined: Wed Jun 21, 2023 4:15 am

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#8

Post by DogWatch »

Robin-

Outstanding!...I have posted your findings on my support ticket at Discord. Hopefully they will be able to get it sorted.
In the mean time, I can also report that screen sharing Sharpcap 4.1.10910 64 bit on Discord with the "Use our advanced..." toggle set to "Off" is successful and stable (for at least 2+ hours). I will report back if/when I hear anything from the Discord support.

Thanks!

Chuck
DogWatch
Posts: 23
Joined: Wed Jun 21, 2023 4:15 am

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#9

Post by DogWatch »

Discord support is very interested and responsive. They appreciate your debug information. I have downloaded their alpha test client (Discord Canary) per their request as it has debug logging. I ran SharpCap v4.1.10910 64 bit and did a screen share with the Discord Canary client and SharpCap did close out again and it was captured on their debug log. I have uploaded their log to them and am awaiting their reply. I will update you as/when I hear back from Discord.

Chuck
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1.10910 64 bit crashing on screen share

#10

Post by admin »

Hi Chuck,

sounds promising - that's exactly how technical support is supposed to work :) I have to say from my own experience though that if you give a software developer a good bug report and they can replicate the issue then they are usually interested... It's the ones that happen one time in 50 or have a terrible description that they will do their best to avoid!

cheers,

Robin
Post Reply