Opened 5 years ago

Closed 4 years ago

#2189 closed defect (fixed)

ffmpeg -i http://url doesn't exit with absent server in windows

Reported by: rogerdpack Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: donmoir@comcast.net Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

How to reproduce:

*don't* turn on a server on port 8081. Then run the following

$ gdb ffplay_g.exe

% r -i http://localhost:8081/go.mjpeg
Starting program: C:\dev\ruby\dirt-simple-usb-surveillance/ffplay_g.exe -i  http://localhost:8081/go.mjpeg
[New Thread 5516.0x15b4]
ffplay version N-49292-g8168cbc Copyright (c) 2003-2013 the FFmpeg developers
  built on Jan 15 2013 15:06:46 with gcc 4.7.1 (GCC)
  configuration: --enable-static --arch=x86 --target-os=mingw32 --cross-prefix=/home/rogerdpack/dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc
 --enable-bzlib --enable-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libbluray --enable-libvpx --enable-runtime-cpudetect
  libavutil      52. 16.100 / 52. 16.100
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 33.100 /  3. 33.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[New Thread 5516.0x1038]
[New Thread 5516.0x13e8]
[New Thread 5516.0x172c]
[New Thread 5516.0xb88]

(ctrl+c when it hangs)


Program received signal SIGINT, Interrupt.
[Switching to Thread 5516.0xde0]
0x75116da7 in NlsUpdateSystemLocale () from C:\Windows\syswow64\kernel32.dll
(gdb) thread apply all bt

Thread 6 (Thread 5516.0xde0):
#0  0x75116da7 in NlsUpdateSystemLocale () from C:\Windows\syswow64\kernel32.dll
#1  0x9d364abe in ?? ()
#2  0x00000000 in ?? ()

Thread 5 (Thread 5516.0xb88):
#0  0x772ef939 in ntdll!RtlUpdateClonedSRWLock () from C:\Windows\system32\ntdll.dll
#1  0x772ef939 in ntdll!RtlUpdateClonedSRWLock () from C:\Windows\system32\ntdll.dll
#2  0x7418635c in ?? () from C:\Windows\SysWOW64\mswsock.dll
#3  0x750733aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
#4  0x09f4ffd4 in ?? ()
#5  0x77309ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#6  0x06c72f98 in ?? ()
#7  0x77309ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#8  0x741862ee in ?? () from C:\Windows\SysWOW64\mswsock.dll
#9  0x00000000 in ?? ()

Thread 4 (Thread 5516.0x172c):
#0  0x772f013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
#1  0x772f013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
#2  0x77322f51 in ntdll!RtlWeaklyEnumerateEntryHashTable () from C:\Windows\system32\ntdll.dll
warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)

#3  0x00000003 in ?? (warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)

) at utv_core/UL00Codec.h:124
warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)

#4  0x06c70ca0 in ?? ()
#5  0x750733aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
#6  0x09d4ffd4 in ?? ()
#7  0x77309ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#8  0x06c70c70 in ?? ()
#9  0x77309ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#10 0x77322e25 in ntdll!RtlWeaklyEnumerateEntryHashTable () from C:\Windows\system32\ntdll.dll
#11 0x06c70c70 in ?? ()
#12 0x00000000 in ?? ()


Thread 3 (Thread 5516.0x13e8):
#0  0x772ef8b1 in ntdll!RtlUpdateClonedSRWLock () from C:\Windows\system32\ntdll.dll
#1  0x772ef8b1 in ntdll!RtlUpdateClonedSRWLock () from C:\Windows\system32\ntdll.dll
#2  0x741817cd in ?? () from C:\Windows\SysWOW64\mswsock.dll
#3  0x74186d30 in ?? () from C:\Windows\SysWOW64\mswsock.dll
#4  0x74f66a28 in WSAAsyncGetHostByAddr () from C:\Windows\syswow64\ws2_32.dll
#5  0x00000211 in ?? ()
#6  0x099ea614 in ?? ()
#7  0x0056f98e in ff_poll (fds=0x99ea998, numfds=1, timeout=100) at libavformat/os_support.c:351
#8  0x5102f94b in ?? ()
#9  0x06e53480 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 2 (Thread 5516.0x1038):
#0  0x772f013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
#1  0x772f013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
#2  0x73c3a41c in timeGetDevCaps () from C:\Windows\SysWOW64\winmm.dll
#3  0x750733aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
#4  0x08ecffd4 in ?? ()
#5  0x77309ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#6  0x00000000 in ?? ()

Thread 1 (Thread 5516.0x15b4):
#0  0x772efd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
#1  0x75813bc8 in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#2  0x00000000 in ?? ()

ffmpeg appears to hang as does ffplay "forever" instead of detecting that port 8081 is actually closed.

Thanks!

Change History (7)

comment:1 Changed 5 years ago by cehoyos

  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

This may be related to ticket #2116.

comment:2 Changed 5 years ago by DonMoir

Same thing happens when I try to connect to my IP camera which is http://x.x.x.x/... and it is either unplugged or not connected. In my own code, I found it necessary to have an interrupt_callback and timeout from there. Also when I do connect and av_read_frame is called, then camera is disconnected, I also need catch that in the interrupt_callback by timing out or on exit. If I don't catch in interrupt then av_read_frame will hang. Not sure if it hangs forever, but close enough.

With interrupt_callback it works fine.

comment:3 Changed 5 years ago by DonMoir

  • Cc donmoir@comcast.net added

comment:4 Changed 5 years ago by cehoyos

The crash on Ctrl-C should be fixed, can you try again to get a useful backtrace?

comment:5 Changed 5 years ago by rogerdpack

Ctrl+C does seem fixed, thank you!

Ok running what I believe to be git master...

https://gist.github.com/rdp/4743454 has all the backtraces, not super helful unfortunately. The most relevant one seems to be thread 1, which appears to possibly be stuck in "poll"? Thanks!

Thread 1 (Thread 1616.0x168c):
#0 0x7735f8b1 in ntdll!RtlUpdateClonedSRWLock () from C:\Windows\system32\ntdll.dll
#1 0x7735f8b1 in ntdll!RtlUpdateClonedSRWLock () from C:\Windows\system32\ntdll.dll
#2 0x741f17cd in ?? () from C:\Windows\SysWOW64\mswsock.dll
#3 0x741f6d30 in ?? () from C:\Windows\SysWOW64\mswsock.dll
#4 0x75ac6a28 in WSAAsyncGetHostByAddr () from C:\Windows\syswow64\ws2_32.dll
#5 0x00000149 in ?? ()
#6 0x0028a204 in ?? ()
#7 0x00581fde in ff_poll (fds=0x28a588, numfds=1, timeout=100) at libavformat/os_support.c:351
#8 0x5115aa27 in ?? ()
#9 0x06a65ba0 in ?? ()
#10 0xba010101 in ?? ()
#11 0x08cd4d08 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

comment:6 Changed 4 years ago by michael

Is the hang still happening, there have been some changes that might have fixed it

comment:7 Changed 4 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed
$ time ffmpeg.exe -i http://localhost:8081/go.mjpeg
ffmpeg version N-54724-g5462361 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 14 2013 12:50:19 with gcc 4.7.2 (GCC)
  configuration: --cpu=corei7-avx
  libavutil      52. 39.100 / 52. 39.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 80.101 /  3. 80.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
http://localhost:8081/go.mjpeg: Input/output error

real    0m11.185s
user    0m0.000s
sys     0m0.000s
Note: See TracTickets for help on using tickets.