I Broke Something But Made It Better…

However well you try to do things when it comes to coding sometimes you miss something and it leads to problems happening. For me today it was a hung Winamp instance on start-up that in the end was due to an issue in how the WACUP loader interacts with the original Winamp process.


The loader attempts to improve the responsiveness of how Winamp deals with existing Winamp instances that are already open which in most cases just hands off the action to the existing Winamp instance almost instantly so that there is only one Winamp instance.

In some cases (e.g. closing and re-opening Winamp within a few seconds of each other) Winamp can end up waiting until it either sees the other instance has closed or it’ll just timeout on checking and then start a new instance (which in the past has had issues and could lead to multiple unexpected Winamp instances running).

Unfortunately in implementing the patch to improve things (effectively doing more checks instead of a single generic one) I’d missed a scenario that only showed up randomly (due to timing issues with the closing and re-starting Winamp) and so I ended up causing Winamp to indefinitely hang on start-up for me.


Thankfully this time that it happened I was able to use the debugger to figure out what was going on and as with all of the best fixes it was one line of code. As a result of this I’ve now added the following message which appears once the checking is done and a hung Winamp instance appears to be present.

unresponsive_winamp_prompt.png

I’m hoping that this message will never be seen in actual usage but it’s there just in-case it does happen and provides some means to know that something is wrong (as Winamp natively can do this anyway if Winamp partially crashes) and what can be attempted to try to resolve the issue.

-dro


Comments:

  1. would be even better if by clicking ok it killed all other instances but I think that is easy for me to say lol

  2. I did think about that but without knowing what / why another Winamp instance might have hung / stopped responding (i.e. it could be expected due to a plug-in doing a long running task) then I cannot be 100% certain about just nuking things. As it could even be caused by other software that is faking itself as Winamp.

    There’s a few other things that have to be considered which is why it’s probably better that the user gets involved imho versus an automated solution. And like my last comment in the post, ideally this is something that should never be seen :)