MinimServer Forum
Minimserver crash - fixed in Release 72 - Printable Version

+- MinimServer Forum (https://forum.minimserver.com)
+-- Forum: MinimServer (/forumdisplay.php?fid=1)
+--- Forum: Support (/forumdisplay.php?fid=4)
+--- Thread: Minimserver crash - fixed in Release 72 (/showthread.php?tid=2727)

Pages: 1 2


Minimserver crash - fixed in Release 72 - Pastim - 07-11-2015 21:33

I am helping to test a new feature in a Control Point. Whilst doing so I got the crash below. The CP is putting together a long list of tracks, in minimserver groups,to play random groups. The crash only seems to happen when the number of tracks is large.

It may well be that the CP is doing something wrong (this is very much Alpha testing), but any help or advice would be welcome.

Code:
20:23:09.806 MinimServer on VB is running
20:23:49.672 MinimServer: exception while processing action request: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at com.minimserver.Server$Group.getCompleteAlbum(Server.java:12399)
    at com.minimserver.Server$Group.copyValuesFirstTag(Server.java:12299)
    at com.minimserver.Server$TagValueFormat.copyValues(Server.java:9037)
    at com.minimserver.Server.addAlbumTag(Server.java:6969)
    at com.minimserver.Server.access$12700(Server.java:114)
    at com.minimserver.Server$TrackItem.getDIDL(Server.java:14400)
    at com.minimserver.Server$Container.getContentsDIDL(Server.java:14946)
    at com.minimserver.Server$ContentDirectoryProvider.doBrowse(Server.java:19214)
    at com.minimserver.Server$ContentDirectoryProvider.browse(Server.java:19165)
    at org.openhome.net.device.providers.DvProviderUpnpOrgContentDirectory1$DoBrowse.ac​tionInvoked(DvProviderUpnpOrgContentDirectory1.java:978)
20:23:49.795 MinimServer error: now stopped, use 'restart' or 'exit'
20:24:20.779 HTTPConnection: exception while processing HTTP request: java.lang.NullPointerException
java.lang.NullPointerException
    at org.jminim.lib.HTTPContext.getHandler(HTTPContext.java:87)
    at com.minimstreamer.WaveResourceBase.writeData(WaveResourceBase.java:121)
    at com.minimserver.ServerRequestHandler.processRequest(ServerRequestHandler.java:52​9)
    at org.jminim.lib.HTTPConnection$WriterThread.runWriterThread(HTTPConnection.java:4​58)
    at org.jminim.lib.HTTPConnection$WriterThread.run(HTTPConnection.java:418)



RE: Minimserver crash - Pastim - 07-11-2015 21:50

I should add that the version info is as below - xubuntu 14.04 64 bit

Code:
19:53:23.512 MinimServer 0.8.3 update 70, Copyright (c) 2012-2015 Simon Nash. All rights reserved.
19:53:23.516 MinimStreamer 0.5.17, Copyright (c) 2012-2015 Simon Nash. All rights reserved.
19:53:23.517 Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
19:53:23.517 Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
19:53:23.518 Platform default charset is UTF-8
19:53:26.284 Language setting is 'eng'

I attach the config file. One change I made today was to add a new displayFormat for Group. That may be somewhat unusual.


RE: Minimserver crash - Pastim - 08-11-2015 00:10

(07-11-2015 21:50)Pastim Wrote:  I should add that the version info is as below - xubuntu 14.04 64 bit

Code:
19:53:23.512 MinimServer 0.8.3 update 70, Copyright (c) 2012-2015 Simon Nash. All rights reserved.
19:53:23.516 MinimStreamer 0.5.17, Copyright (c) 2012-2015 Simon Nash. All rights reserved.
19:53:23.517 Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
19:53:23.517 Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
19:53:23.518 Platform default charset is UTF-8
19:53:26.284 Language setting is 'eng'

I attach the config file. One change I made today was to add a new displayFormat for Group. That may be somewhat unusual.
I did a little more testing. If I remove the Group.displayFormat={$album^^: $group} tagFormat there is no crash for exactly the same user request to the CP. So either minimserver has a problem with the Group.displayFormat when the number of tracks being perused is large, or the CP is doing something strange. As far as I know the CP doesn't understand any of the format or content of column 3 of the track item list, so I'd be a little surprised, but then I don't understand how all this really works.


RE: Minimserver crash - Pastim - 08-11-2015 21:25

After some more tests it's notable that some user selections always result in a crash, and some never do. Contrary to what I thought previously, some selections that find a large number of tracks (eg 3000) are OK, and some that only find 700 or so crash.

I might naively imagine this is a field length problem. Anyhow, here's a debug log. I hope it's useful.

Is there anything else I can provide?


RE: Minimserver crash - Pastim - 08-11-2015 22:24

I have got close to the cause, having identified the data that causes the crash.

I have tested this with 2 CPs, and in both cases Minimserver crashes, so it's unlikely to be the CP is at fault.

My Group names are usually the Work name (eg "Symphony No 1 in A").

I have an album with 2 recordings of the same symphony by different conductors. There are 8 tracks in all, numbered 1 to 4 and 5 to 8, all with the same Group name (the Symphony name) and the same Album name. The Group is sequential and so minimserver does not flag up that there might be a problem (which it would if they were not sequential). Normally I add a suffix to the Group when the same Work appears twice on an album, but in this case I didn't spot it.

The Titles of tracks 1 and 5 are exactly the same, as are 2 and 6 etc. The File names are different because I include the track and disc number in the file name.

If I select this album to play it crashes every time. If I add a suffix to the Group on the 2nd version it does not crash.

The puzzle now is why, if I do not specify a displayFormat for Group, all is well, but if I specify the format as being {$album$group} (or any variation of the two tags including separators) it crashes. If I define the displayFormat as being just $group it's OK.

I hope this detail helps.


RE: Minimserver crash - Pastim - 09-11-2015 19:19

Some might wonder why on earth I want to change the display format of a Group. The reason is that I've been testing a new feature in a Control Point. This feature allows me to do the one and only thing that has been preventing me using minimserver for most of my listening.

I want (even need) to be able to listen to random 'Works' (ie sets of tracks). Using the Group facility to label my (mostly classical) Works this almost did what I needed. Unfortunately, using the Work tag copied to the Group tag (in cases allowed my minimserver) meant that multiple versions of, say, a Symphony, all got played together, since the Group is the same. To distinguish between the Groups on different Albums I therefore needed to modify the displayFormat of Group by adding the Album name. This had an additional beneficial side effect of showing the Album together with the Group on the 'now playing' display.

That's when minimserver started to crash. It took me many hours, but I tracked down about 6 difficult Albums. The worst was a collection of Works all called "Stabat Mater" by various composers, all on one Album, without breaks in the track numbers. So minimserver thought this was one Group, not 6 Works. I fixed it by changing the Group name of each (by adding the Composer's name). In cases where the Work really is the same piece but the recorded version is different, I added the Conductor's name or Year recorded.

I should add that I'm only too well aware that minimserver will not accept a Group that has missing tracks (eg where there are 2 identical Work names on an Album separated by some other Work). I fixed all these issues quite a while ago.

With the new CP feature I can now play complete classical Works randomly over my whole collection, or by Composer, Genre, Rating, Audio quality, and so on. It's wonderful. All I wish is that minimserver didn't crash Wink


RE: Minimserver crash - simoncn - 10-11-2015 12:41

Thanks for this problem report and the detailed information about the circumstances that cause it. I will investigate and let you know if I need any more information.


RE: Minimserver crash - simoncn - 10-11-2015 15:59

(08-11-2015 22:24)Pastim Wrote:  My Group names are usually the Work name (eg "Symphony No 1 in A").

I have an album with 2 recordings of the same symphony by different conductors. There are 8 tracks in all, numbered 1 to 4 and 5 to 8, all with the same Group name (the Symphony name) and the same Album name. The Group is sequential and so minimserver does not flag up that there might be a problem (which it would if they were not sequential). Normally I add a suffix to the Group when the same Work appears twice on an album, but in this case I didn't spot it.

The Titles of tracks 1 and 5 are exactly the same, as are 2 and 6 etc. The File names are different because I include the track and disc number in the file name.

Are tracks 1 to 4 tagged with a different disc number than tracks 5 to 8? If so, I can understand why the crash is happening.


RE: Minimserver crash - Pastim - 10-11-2015 16:40

(10-11-2015 15:59)simoncn Wrote:  
(08-11-2015 22:24)Pastim Wrote:  My Group names are usually the Work name (eg "Symphony No 1 in A").

I have an album with 2 recordings of the same symphony by different conductors. There are 8 tracks in all, numbered 1 to 4 and 5 to 8, all with the same Group name (the Symphony name) and the same Album name. The Group is sequential and so minimserver does not flag up that there might be a problem (which it would if they were not sequential). Normally I add a suffix to the Group when the same Work appears twice on an album, but in this case I didn't spot it.

The Titles of tracks 1 and 5 are exactly the same, as are 2 and 6 etc. The File names are different because I include the track and disc number in the file name.

Are tracks 1 to 4 tagged with a different disc number than tracks 5 to 8? If so, I can understand why the crash is happening.
No. All have "discnumber" tag 1.

However, I've done another experiment. Instead of "$album^^: $group" I replaced album with 'setid', which is my record of the CD/LP catalogue number. minimserver then doesn't crash.

The Group in this case is "Symphony No.2 in Bmi"
The Album is "Borodin - Symphony No 2 - Carlos & Erich Kleiber"
The SetId is "93116"
Titles are like: "Symphony No.2 in Bmi - 1. Allegro - Animato assai - Poco meno - Animato assai - Tempo I", "Symphony No.2 in Bmi - 2. Scherzo. Prestissimo - Allegretto - Tempo I" and so on.

Tracks are 1 to 8, discnumber 1.

On one other troublesome album all Works were just 1 track, all called "Stabat Mater", tracks 1 to 6, discnunber 1.


RE: Minimserver crash - simoncn - 10-11-2015 17:15

(10-11-2015 16:40)Pastim Wrote:  No. All have "discnumber" tag 1.

However, I've done another experiment. Instead of "$album^^: $group" I replaced album with 'setid', which is my record of the CD/LP catalogue number. minimserver then doesn't crash.

The Group in this case is "Symphony No.2 in Bmi"
The Album is "Borodin - Symphony No 2 - Carlos & Erich Kleiber"
The SetId is "93116"
Titles are like: "Symphony No.2 in Bmi - 1. Allegro - Animato assai - Poco meno - Animato assai - Tempo I", "Symphony No.2 in Bmi - 2. Scherzo. Prestissimo - Allegretto - Tempo I" and so on.

Tracks are 1 to 8, discnumber 1.

On one other troublesome album all Works were just 1 track, all called "Stabat Mater", tracks 1 to 6, discnunber 1.

I understand why the presence of $album in the displayFormat string is required in order to trigger the crash.

I have set up a test similar to your "Stabat Mater" case but this hasn't triggered the problem.

================================================================================​==
EDIT: I have now been able to trigger the problem and there is no need for you to try what I requested below.
================================================================================​==

If you rename the "Stabat Mater" tracks as Stabat Mater 1/2/3/4/5/6 so that there is no duplication of track names (but assign them all to the same group), does this cause the problem to go away?

If this does cause the problem to go away, does the problem come back if you have the first two with duplicate names and the others without duplicate names?