[RESOLVED] Sometimes VirtualDub hangs with no error message

Support forum for DGDecNV
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes VirtualDub hangs with no error message

Post by admin »

I'll experiment with it today. Thank you for the ideas. Obviously a deterministic solution is preferred.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes VirtualDub hangs with no error message

Post by admin »

I just slipstreamed my latest version of this fix. Please run with this one and let me know if it ever hangs again. Thanks.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Thanks for your work :bow:
Just out of curiosity, if my guess is roughly correct, according what you've said.
In the constructor (i was hesitating between creator/constructor, but constructeur seems more logical), you start a thread to handle all the CUDA things. This thread init things, and when done, wait for a getframe (and maybe other things). When this "CUDA thread" has finished its init and is waiting, you have to notify the constructor that it's finished and it can itself finish.
In the getframe, you trig an event to tell the "CUDA thread" that you've received a getframe.
So is it, roughly, something like this ?
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Don't want to patronize or anything, just giving suggestion if needed, in case my guess is correct.
If not needed or don't want it, just ignore, absolutely no hard feelings.
My suggestion :

Code: Select all

constructor
{
  Doing stuff
  Creating E1 Event.
  Starting "CUDA Thread"
  // Waiting "CUDA Thread" finished
  WaitForSingleEvent(E1)
  Destroying E1 event
  (will not be needed anymore, don't waste resources for nothing).
}

Destructor
{
  Destroy E2 to E6
}

CUDA Thread
{
  Doing Init Stuff
  // Init is done, i'm ready, notify constructor
  SetEvent(E1)
  While whateever_exit_or_ending_filter_condition_is
  {
     WaitForMultipleEvent(E2,E3)
     ResetEvent(E2)
     ResetEvent(E3)
     // Don't know what E3 is, don't care, it will follow the same idea than GetFrame
     // Doing CUDA stuff
     // Notify GetFrame 1rst part of CUDA Stuff is done
     SetEvent(E4)
     // Waiting GetFrame notifying its part is done
     WaitForSingleEvent(E5)
     ResetEvent(E5)
     // Doing CUDA stuff
     // Notify GetFrame 2nd and last part of CUDA Stuff is done
     SetEvent(E6)
  }
  Doing Ending stuff
}

GetFrame
{
  Do Things
  // Notify CUDA it can do its stuff 
  SetEvent(E2)
  // Waiting CUDA finishing part of its job.
  WaitForSingleEvent(E4)
  ResetEvent(E4)
  Do things
  // Notify CUDA it can do the 2nd part
  SetEvent(E5)
  // Waiting CUDA finishing part of its job.
  WaitForSingleEvent(E6)
  ResetEvent(E6)
  Do things
}
In that case, even if Getframe is called between the tiny interval, it shouldn't matter, the event was already trigged, there will just be no wait. Ajust according the number of dispatching jobs between both.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes VirtualDub hangs with no error message

Post by admin »

"If not needed or don't want it, just ignore"

OK.

Please advise the results of testing my last slipstream.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Sometimes VirtualDub hangs with no error message

Post by jpsdr »

I've begin to use it. No issue but no big project also immediately (just a very few files). I'll report after a longer use, so may take a little while.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes VirtualDub hangs with no error message

Post by admin »

Thanks, I appreciate your assistance.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes VirtualDub hangs with no error message

Post by admin »

Marking this resolved. If not, please post again.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

I've worked on several project with a lot more of files recently, and so far, so good.
So, it seems that the issue is indeed probably solved.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

Thank you, my friend, for the update, and for helping me to improve DGDecNV. In honor of your contributions, I have placed you in my Distinguished Member group.

:bravo:
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Happened again... :(
But... DGIndexNV is for now second in suspect list, another is the first suspect.
Nevertheless, i would like to provide the ProcessExplorer stack dump when next hang, like last time.
With it, will you be able, in the first time, just checking if hang occured within DGIndexNV or not ?
Situation is not the same as before, this time, DGIndexNV is not the only one filter used.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

Probably. Let's see the traces.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Thanks, i'll post them when it occurs again. Lot and often issues sunday, unable to reproduce yesterday... :evil:
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

Patience is a virtue.

See, even I can virtue signal. :lol:
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

It happened again, so, if you can check in the first place what you get from this stack information :

Code: Select all

VDub Process 1

ntoskrnl.exe!KeWaitForMultipleObjects+0xc0a
ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x712
ntoskrnl.exe!KeWaitForSingleObject+0x19f
ntoskrnl.exe!PoStartNextPowerIrp+0xbd4
ntoskrnl.exe!PoStartNextPowerIrp+0x187d
ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x91d
ntoskrnl.exe!KeWaitForMultipleObjects+0x26a
ntoskrnl.exe!NtWaitForSingleObject+0x40f
ntoskrnl.exe!NtWaitForSingleObject+0x77e
ntoskrnl.exe!KeSynchronizeExecution+0x3a23
ntdll.dll!ZwWaitForMultipleObjects+0xa
KERNELBASE.dll!GetCurrentProcess+0x40
kernel32.dll!WaitForMultipleObjects+0xb0
Filtres_JPSDR.vdf!VirtualdubFilterModuleInit2+0x1735
Filtres_JPSDR.vdf!VirtualdubFilterModuleInit2+0x3533
Filtres_JPSDR.vdf+0x16c13d
Filtres_JPSDR.vdf!VirtualdubFilterModuleInit2+0x4654
Veedub64.exe+0x448b5
Veedub64.exe+0x47680
Veedub64.exe+0x47db3
Veedub64.exe+0x5081e
Veedub64.exe+0x80640
Veedub64.exe+0x8340b
Veedub64.exe+0x6cdb5
Veedub64.exe+0x226674
kernel32.dll!BaseThreadInitThunk+0xd
ntdll.dll!RtlUserThreadStart+0x21

VDub Process 2

ntoskrnl.exe!KeWaitForMultipleObjects+0xc0a
ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x712
ntoskrnl.exe!KeWaitForSingleObject+0x19f
ntoskrnl.exe!PoStartNextPowerIrp+0xbd4
ntoskrnl.exe!PoStartNextPowerIrp+0x187d
ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x91d
ntoskrnl.exe!KeWaitForMultipleObjects+0x26a
win32k.sys!memset+0x7cc7
win32k.sys!memset+0x7d89
win32k.sys!W32pArgumentTable+0xab22
ntoskrnl.exe!KeSynchronizeExecution+0x3a23
USER32.dll!WaitMessage+0xa
Veedub64.exe+0x1f07ef
Veedub64.exe+0x13bf8e
Veedub64.exe+0x226ff3
Veedub64.exe+0x227087
kernel32.dll!BaseThreadInitThunk+0xd
ntdll.dll!RtlUserThreadStart+0x21
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

It looks like Filtres_JPSDR.vdf is getting stuck. What is that? Is it a filter you are running in VirtualDub?
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Ok, thanks for the information, it's some of my filters.
As i've said, this time it was different from last time, DGIndexNV wasn't alone, and wasn't also the first in the suspect list.
And now, we know it's not it, so, it's not on your.
I absolutely don't understand the stack information i've provided you. Can you tell me what information told you which process is stuck ? It may help me in future cases.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

Nothing magic about it. The first stack trace had a wait at the top, so it was stuck waiting for something. Moving down the stack (down the listing) you see it passing through OS kernel calls and then you see your filter which initiated the call chain that led to the wait. The wait was initiated in the function VirtualdubFilterModuleInit2() of your filter.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

NeatVideo answer :
Thank you for the minidump. We took a quick look into it and so far the situation is not very clear.
Neat Video is involved, CUDA is involved, other plug-ins are also involved into that process.
Not good...
Even worse, i have no idea when VirtualdubFilterModuleInit2 is called... :?
And, if my guess would be within the Init of my plugin, it makes no sense, as i don't call any wait function in my init... I've hit a total mystery here... :scratch:
Well, apparently, i'll have to learn to live with it... :(
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

Please provide your filter source code, so we can try to find the problem. You don't have to live with mysteries.

Your filter .vdf exports VirtualdubFilterModuleInit2 (). It is called by VirtualDub when the filter is instantiated. Your code would be helpful.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Code is here : https://github.com/jpsdr/Filtres_JPSDR
Only RGBConvert and AddBorder are involved from mine.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

You loaded an avs script in VirtualDub and then added VirtualDub filters? What was the script and what filters? Thanks. I would like to recreate your scenario.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by jpsdr »

Thanks for trying this, even knowing that NV is not causing it... :bow:
You can get also my avisynth plugins on my github, i'm using the "all in one plugin" for avisynth, the one called "plugin_jpsdr".
Script :

Code: Select all

SetMemoryMax(192)
video=DGSource("File.dgi",i420=false,deinterlace=0,fieldop=0).crop(0,20,0,-20)
Y=ConvertToY8(video)
U=UtoY8(video).BlackmanResizeMT(Width(Y),Height(Y),src_left=0.25,range=3)
V=VtoY8(video).BlackmanResizeMT(Width(Y),Height(Y),src_left=0.25,range=3)
YtoUV(U,V,Y)
DGI file is created from a Blu-Ray.
VDub : Input/Output colors are set to YV24, compression is UT Video 17.4.0 YUV444 BT709.
Internal VDub filters :
RGBConvert BT709
NeatVideo 4.5
RGBConvert BT709 , output YV24.
AddBorder (Top/Bottom 20).
alias BT601.
VDub version : VDub build 35570
Full x64 chain. avs+ r2420 for avisynth.
I think that's all...
And time to sleep, i've caught a bad cold...
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes VirtualDub hangs with no error message

Post by admin »

Ok, thank you, jp. Investigating... :scratch:

Take rest, get well soon.
Post Reply