http://bugs.winehq.org/show_bug.cgi?id=15225
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|DVDFlick v1.3.0 freezes |DVDFlick v1.3.0 freezes |when trying to add title |when trying to add title |from video file |from video file (parent | |process hangs on redirected | |child output pipe)
--- Comment #11 from Anastasius Focht focht@gmx.net 2012-05-18 14:09:13 CDT --- Hello,
it seems to hang on a pipe read.
When you add a video file the main app spawns "ffmpeg" for analysis and reads the child stdout through a pipe. A pipe is created to redirect the output from "ffmpeg" child process.
--- snip --- ... 0009:Call KERNEL32.CreatePipe(0032eb88,0032eb94,0032eb24,00000000) ret=004e993d 0009: create_named_pipe( access=80100000, attributes=00000042, rootdir=0000, options=00000020, sharing=00000002, maxinstances=00000001, outsize=00000000, insize=00000000, timeout=0, flags=00000000, name=L"\??\pipe\Win32.Pipes.00000008.00000001" ) 0009: create_named_pipe() = 0 { handle=000c } 0009: open_file_object( access=40100000, attributes=00000042, rootdir=0000, sharing=00000000, options=00000060, filename=L"\??\pipe\Win32.Pipes.00000008.00000001" ) 0009: open_file_object() = 0 { handle=0144 } 0009:Ret KERNEL32.CreatePipe() retval=00000001 ret=004e993d ... 0009:Call KERNEL32.SetNamedPipeHandleState(0000000c,0032ea3c,0032ea38,0032ea34) ret=004e9a7c 0009:Ret KERNEL32.SetNamedPipeHandleState() retval=00000000 ret=004e9a7c ... --- snip ---
handle=000c -> read end handle=0144 -> write end
The child is spawned:
--- snip --- ... 0009:Call KERNEL32.CreateProcessW(00000000,0200682c L"C:\Program Files\DVD Flick\bin\ffmpeg.exe -analyzeduration 10M -threads 4 -i "Z:\home\focht\Downloads\[krautsubs] Nisemonogatari - 01 (720p) [F473ECDC].mkv"",0032eb24,0032eb24,ffffffff,00000020,00000000,0200b09c L"C:\Program Files\DVD Flick\bin",0032eb44,0032eb14) ret=004e9cdc ... 0030:Call KERNEL32.__wine_kernel_init() ret=7bc530d2 ... 0009:Ret KERNEL32.CreateProcessW() retval=00000001 ret=004e9cdc ... --- snip ---
Parent issues a blocking read:
--- snip --- ... 0009:Call KERNEL32.ReadFile(0000000c,020170bc,00000100,0032eb9c,00000000) ret=004e9edb ... 0009: get_handle_fd( handle=000c ) ... 0009: *fd* 000c -> 24 ... 0009: get_handle_fd() = 0 { type=5, cacheable=1, access=00120089, options=00000020 } ... --- snip ---
Child opens/duplicates the handles:
--- snip --- ... 0030:Call KERNEL32.GetStdHandle(fffffff6) ret=7ed461c5 0030:Ret KERNEL32.GetStdHandle() retval=ffffffff ret=7ed461c5 0030:Call KERNEL32.GetStdHandle(fffffff5) ret=7ed4624f 0030:Ret KERNEL32.GetStdHandle() retval=00000144 ret=7ed4624f 0030:Call KERNEL32.DuplicateHandle(ffffffff,00000144,ffffffff,0011f78c,00000000,00000001,00000002) ret=7ed46295 0030: dup_handle( src_process=ffffffff, src_handle=0144, dst_process=ffffffff, access=00000000, attributes=00000002, options=00000002 ) 0030: dup_handle() = 0 { handle=001c, self=1, closed=0 } 0030:Ret KERNEL32.DuplicateHandle() retval=00000001 ret=7ed46295 0030:Call KERNEL32.GetStdHandle(fffffff4) ret=7ed462d9 0030:Ret KERNEL32.GetStdHandle() retval=00000144 ret=7ed462d9 0030:Call KERNEL32.DuplicateHandle(ffffffff,00000144,ffffffff,0011f7b0,00000000,00000001,00000002) ret=7ed4631f 0030: dup_handle( src_process=ffffffff, src_handle=0144, dst_process=ffffffff, access=00000000, attributes=00000002, options=00000002 ) 0030: dup_handle() = 0 { handle=0024, self=1, closed=0 } 0030:Ret KERNEL32.DuplicateHandle() retval=00000001 ret=7ed4631f 0030:Call KERNEL32.CreateFileA(7ed8931a "CONIN$",80000000,00000001,00000000,00000003,00000000,00000000) ret=7ed36ec4 0030: open_console( from=0000, access=80000000, attributes=00000000, share=3 ) 0030: open_console() = 0 { handle=0028 } 0030:Ret KERNEL32.CreateFileA() retval=0000002b ret=7ed36ec4 0030:Call KERNEL32.CreateFileA(7ed89321 "CONOUT$",40000000,00000002,00000000,00000003,00000000,00000000) ret=7ed36f0b 0030: open_console( from=0001, access=40000000, attributes=00000000, share=3 ) 0030: open_console() = ACCESS_DENIED { handle=0000 } 0030:Ret KERNEL32.CreateFileA() retval=ffffffff ret=7ed36f0b ... --- snip ---
Child writes to pipe and parent is unblocked with data:
--- snip --- ... 0030:Call KERNEL32.WriteFile(00000024,007ad463,00000006,00d2fa3c,00000000) ret=7ed4b745 0030: get_handle_fd( handle=0024 ) 0030: *fd* 0024 -> 60 0030: get_handle_fd() = 0 { type=5, cacheable=1, access=00120116, options=00000060 } 0030:Ret KERNEL32.WriteFile() retval=00000001 ret=7ed4b745 0009:Ret KERNEL32.ReadFile() retval=00000001 ret=004e9edb --- snip ---
Child exits and parent wait on process handle is satisfied:
--- snip --- ... 0030:Call KERNEL32.GetStdHandle(fffffff5) ret=7ed45886 0030:Ret KERNEL32.GetStdHandle() retval=00000144 ret=7ed45886 0030:Call KERNEL32.CloseHandle(0000001c) ret=7ed46eb7 0030: close_handle( handle=001c ) 0030: close_handle() = 0 0030:Ret KERNEL32.CloseHandle() retval=00000001 ret=7ed46eb7 0030:Call ntdll.RtlFreeHeap(00110000,00000000,00000000) ret=7ed4f4b8 0030:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7ed4f4b8 0030:Call KERNEL32.GetStdHandle(fffffff4) ret=7ed458b4 0030:Ret KERNEL32.GetStdHandle() retval=00000144 ret=7ed458b4 0030:Call KERNEL32.CloseHandle(00000024) ret=7ed46eb7 0030: close_handle( handle=0024 ) 0030: close_handle() = 0 0030:Ret KERNEL32.CloseHandle() retval=00000001 ret=7ed46eb7 ... 0030: terminate_process( handle=ffffffff, exit_code=1 ) 0031: *killed* exit_code=1 0032: *killed* exit_code=1 0033: *killed* exit_code=1 0034: *killed* exit_code=1 0035: *killed* exit_code=1 0036: *killed* exit_code=1 0037: *killed* exit_code=1 0038: *killed* exit_code=1 0039: *killed* exit_code=1 003a: *killed* exit_code=1 003b: *killed* exit_code=1 003c: *killed* exit_code=1 003d: *killed* exit_code=1 003e: *killed* exit_code=1 003f: *killed* exit_code=1 0040: *killed* exit_code=1 0030: terminate_process() = 0 { self=1 } 0030:Call KERNEL32.FreeLibrary(7e1f0000) ret=7e6d9233 0030:Ret KERNEL32.FreeLibrary() retval=00000001 ret=7e6d9233 0030: *killed* exit_code=1 0009: *wakeup* signaled=0 002f: *process killed* ... 0009:Ret KERNEL32.WaitForSingleObject() retval=00000000 ret=004ea049 0009:Call KERNEL32.GetLastError() ret=660cc261 0009:Ret KERNEL32.GetLastError() retval=00000000 ret=660cc261 --- snip ---
Parent still issues reads on pipe (not all stdout data has been read yet) and ultimately blocks when no more data:
--- snip --- ... 0009:Call KERNEL32.WideCharToMultiByte(00000000,00000000,0016374c L"720, 23.810 tb(r)\r\n Stream #0.1: Audio: aac, 44100 Hz, stereo, s16\r\n Stream #0.2(ger): Subtitle: 0x0000\r\n Stream #0.3: Attachment: 0x0000\r\nMust supply at least one output file\r\n: 0.000000, bitrate: N/A\r\n Stream #0.0: Video: h264, yuv420p, 1280x",00000101,020170bc,00000101,00000000,00000000) ret=6600a24f 0009:Ret KERNEL32.WideCharToMultiByte() retval=00000101 ret=6600a24f 0009:Call KERNEL32.ReadFile(0000000c,020170bc,00000100,0032eb9c,00000000) ret=004ea0ce <hangs here> --- snip ---
Not sure but if the child process side of the pipe (write end) is closed shouldn't that result in "broken pipe" error?
Maybe the problem is that the parent process doesn't close the write end of the pipe preventing the broken pipe effect when the child exits?
Regards