Hi Pranas,2013/8/20 Pranas Gudaitis <pranza@takas.lt>
>
> i've went further investigating file locking issue. it turned out, that when
> sometimes liquidsoap locks files from deleting, it is not only reload mode =
> "watch" files - it suddenly locks all the files, even static, that it has
> got
> ready for playing or had played lately.
>
> i'd consider it a bug, because most of the time the files are not locked,
> but about once in two weeks i get complaints from people unable to delete
> old files, and when i check - files are really locked.
>
>
> C:\Documents and Settings\pranza>handle d:\airy
>
> Handle v3.51
> Copyright (C) 1997-2013 Mark Russinovich
> Sysinternals - www.sysinternals.com
>
> liquidsoap.exe     pid: 9740   type: File           2E4: D:\airy\Rugiagialia
> x n
> oid - Drops.mp3
> liquidsoap.exe     pid: 9740   type: File           374: D:\airy\sb\b.mp3
> liquidsoap.exe     pid: 9740   type: File           40C:
> D:\airy\kitokie_bytai\k
> b - 26.mp3
> liquidsoap.exe     pid: 9740   type: File           494:
> D:\airy\lietmuz\moondis
> co\moon disco - communication to none.mp3
>
> etc...
>
>
> then i stop the service. in service mode liquidsoap allways crashes when
> stopping: Unhandled exception at 0x0022e6fc in liquidsoap.exe: 0xC0000005:
> Access violation writing location 0x00000000.
>
> i start microsoft visual studio debugger and it shows:
> 'liquidsoap.exe': Loaded 'C:\Program Files\liquidsoap-win32\liquidsoap.exe',
> Binary was not built with debug information.
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\secur32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
> 'liquidsoap.exe': Loaded 'C:\Program Files\liquidsoap-win32\libtag.dll',
> Binary was not built with debug information.
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\winmm.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll'
> 'liquidsoap.exe': Loaded 'C:\Program
> Files\liquidsoap-win32\libstdc++-6.dll', Binary was not built with debug
> information.
> 'liquidsoap.exe': Loaded 'C:\Program
> Files\liquidsoap-win32\libgcc_s_sjlj-1.dll', Binary was not built with debug
> information.
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\imm32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\digi96.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\mswsock.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\hnetcfg.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\wshtcpip.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\dnsapi.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\winrnr.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\wldap32.dll'
> 'liquidsoap.exe': Loaded 'C:\WINDOWS\system32\rasadhlp.dll'
> Unhandled exception at 0x0022e6fc in liquidsoap.exe: 0xC0000005: Access
> violation writing location 0x00000000.
> The thread 'Win32 Thread' (0x2c80) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x1a40) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x1790) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x1860) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x1ca4) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0xf64) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x19ac) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x1c34) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x2544) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x202c) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x35ac) has exited with code 0 (0x0).
> The thread 'Win32 Thread' (0x1e90) has exited with code 0 (0x0).
> The program '[9740] liquidsoap.exe: Native' has exited with code 0 (0x0).
>
> the crash allways gives two notices of crashing, one after other. it's not
> really a problem for me, it just leaves crash notice windows .

I will look at this. I am. however, happy that this is just an annoyance and not a production-level bug..

> after liquidsoap restart, let's have a look at handles:
>
> C:\Documents and Settings\pranza>handle d:\airy
>
> Handle v3.51
> Copyright (C) 1997-2013 Mark Russinovich
> Sysinternals - www.sysinternals.com
>
> No matching handles found.
>
>
> We see, that liquidsoap, restarted with all the same config suddenly doesn't
> lock anything. So why does it lock files occasionally? Would it be possible
> to avoid it?

When a file is considered locked, you should connect to telnet and look at request.alive. I believe that all the files currently locked should be part of a request that is still alive.

A request might stay alive for many reasons, for instance if it contains a file that is active in one of the sources in your script. The source does not need to be playing itself, just that this file is currently loaded and pending on this source.

Hope this helps,
Romain