Results 1 to 10 of 10

Thread: Old problem... simple fix? index out of bounds

  1. #1
    Join Date
    Dec 2005
    Posts
    173

    Old problem... simple fix? index out of bounds

    I must have some garbage in a saved video, because XRecord stopped being able to load my archived videos ages ago...

    Figured I would try again, and am still seeing the same behavior.

    From the log:
    Code:
    2008-09-20 09:44:38.161	INFO	[1]	xxx = C:\Program Files\Devnz\GBPVR\media\art\camp rock.mix
    2008-09-20 09:44:38.270	VERBOSE	[1]	ReturnToMainMenu()
    2008-09-20 09:44:38.270	VERBOSE	[1]	XRecord is currently active
    2008-09-20 09:44:38.270	VERBOSE	[1]	XRecord.Deactivate() called
    2008-09-20 09:44:38.301	VERBOSE	[1]	ReturnToMainMenu()@2
    2008-09-20 09:44:38.301	VERBOSE	[1]	System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at RecordingViewerPlugin.ShowImportData..ctor(String strFile)
       at RecordingViewerPlugin.XVideoRecordingsBox.searchDirectories(String directory, ArrayList ignoreList)
       at RecordingViewerPlugin.XVideoRecordingsBox.searchDirectories(String directory, ArrayList ignoreList)
       at RecordingViewerPlugin.XVideoRecordingsBox.initialize()
       at RecordingViewerPlugin.RecordingTask.initializeDatabase()
       at RecordingViewerPlugin.RecordingTask.render(Boolean& requiresMoreRendering)
       at GBPVRX2.MenuTask.x9006c1ed9ccb79de.GetRenderList()
       at GBPVRX2.x0061b801bdf12d35.xdb012c437aec4a40(Boolean xd23bf32f3b17e3be)
       at GBPVRX2.x0061b801bdf12d35.xdae9991ab918b397(Object xdf2e3583f942db7b, KeyEventArgs xc4f45905cb1fc7ba)
       at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
       at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
       at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
       at System.Windows.Forms.Control.WmKeyChar(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at GBPVRX2.x0061b801bdf12d35.WndProc(Message& m)
    Its barfing in showimportdata... It would be cool if instead of bombing out when it ran into something it didn't like, it just tossed that show info (or otherwise gracefully handled it)

    I'm happy to enable more logging/debugging if that will help.

  2. #2
    Join Date
    Mar 2006
    Location
    Montreal, Canada
    Posts
    765
    I got a similar crash once for the reason mentionned here. It's possible some of your ".dat" files have carriage returns, line feeds and tabs in program descriptions. Is your EPG coming from xmltv import? GBPVR's xmltv import does not cleanup these bad characters and xsuite just trusts the data in gbpvr.db3 and stores it in a ".dat" file.

    I just looked at my dat files with notepad and cleaned up the ones like this:

    description=

    The Daily

    Show

    and fixed them to look like this:

    description=The Daily Show

    I ran xrecord in the debugger and easily identified the bad dat file. If you have many dat files and can't find the bad one, you can zip them (just the .dat not the media) and I could easily do the same for yours. I don't have the time with work to make a new xsuite version these days.

    The problem never came back so my xmltv source must have suffered from a temporary bug.
    2 Hauppauge PVR-150's, Celeron 2.93GHz, 1GB RAM, 1TB Maxtor HD, Cooler Master Cavalier 2, Radeon HD 2400 Pro, gbpvr 1.1.5 Blue Skin

  3. #3
    Join Date
    Dec 2005
    Posts
    173
    Ok, I will use grep to find the bad data... Thanks (sorry to hear about no new versions... really like xsuite)

  4. #4
    Join Date
    Jul 2005
    Location
    HK - Pal I
    Posts
    3,443
    Quote Originally Posted by JohnInSJ View Post
    sorry to hear about no new versions... really like xsuite
    Just a "me too" on this. My fave plugin besides Moviewiz. Still works though ... :-)

    k.
    ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | Various HD's | AC86U | USB-UIRT | PCH-A110 | RPi2 | Sony Bravia LCD X9000F Android TV |. Frustrated that NextPVR is not working? Take a moment and consider this and this and this and this and this and this. Credit where credit's due; for one guy (with a wife and two kids), most problems are solved outrageously quickly. Patience.

  5. #5
    Join Date
    Mar 2007
    Posts
    24
    Quick question for the Newbie. How do I use debug mode to find to corrupt .dat file? I would totally appreciate it since I use only Xrecord. Thanks in advance! steve

    Also, I have having serious trouble getting Xrecord to work again. It continues to give me the "Index was outside the bounds of the array" error. Can anybody take a quick look at my logs to see what the problem is? I would really appreciate it.
    Last edited by yofive; 2008-09-25 at 02:39 AM. Reason: add attachment

  6. #6
    Join Date
    Mar 2006
    Location
    Montreal, Canada
    Posts
    765
    There must be a bad .dat file in one of the video paths that xrecord is searching but the logs don't show the problematic filename. If you zip the dat files I could take a look. The source code for XRecord is on sourceforge so it's not a debug mode that's available unless you download the code and build XRecord.

    If I have time I might create a version with more robust .dat file reading.
    2 Hauppauge PVR-150's, Celeron 2.93GHz, 1GB RAM, 1TB Maxtor HD, Cooler Master Cavalier 2, Radeon HD 2400 Pro, gbpvr 1.1.5 Blue Skin

  7. #7
    Join Date
    Dec 2005
    Posts
    173
    Ah, source is on sourceforge... lemme take a quick peek.

    Edit...

    Could you not protect us from death by bad data simply by adding a try/catch block?
    Code:
    public ShowImportData(string strFile)
    {
        TextReader outputReader = new StreamReader(strFile);
        try {
          // rest of current code lines 54-131 goes here
        }
        catch(Exception) // catches without assigning to a variable
        {
            //  put some default values in
            // dunno what is needed, if anything
        			title        = strFile;
       			description  = "WARNING: bad data in .dat file, skipped!";
        			fullfilename = "";
        			filename     = "";
        			starttime    = "";
        			endtime      = "";
        			channel      = "";
        			subtitle     = "";
        			recordedtime = "";
        			image = "";
        }
        // line 132-end goes here
    I could do the checkout/build/post dance if you want, but it might be easier for you to do... An alternative to the above is to move the try/catch inside of the while loop, but this should work and at least allow XRecord to load up the files and just provide no data for those with borked .dat files.
    Last edited by JohnInSJ; 2008-09-29 at 04:55 PM.

  8. #8
    Join Date
    Mar 2007
    Posts
    24
    thank you both. I have isolated to corrupt file via trial and error and can't find anything wrong with the .dat file. However, after deleting it, my xrecord is back up and running. Is there any short .bat type file I could run on a dir to detect a corrupt .dat file or is that too difficult of a thing? Cheers, steve

  9. #9
    Join Date
    Mar 2006
    Location
    Montreal, Canada
    Posts
    765
    Can you post the bad .dat file so I can see what went wrong? A new version of XRecord that doesn't crash on bad .dat files is good but also avoiding generating new bad .dat files would be even better.
    2 Hauppauge PVR-150's, Celeron 2.93GHz, 1GB RAM, 1TB Maxtor HD, Cooler Master Cavalier 2, Radeon HD 2400 Pro, gbpvr 1.1.5 Blue Skin

  10. #10
    Join Date
    Mar 2006
    Location
    Montreal, Canada
    Posts
    765
    This is fixed now. The bad dat file names should now appear in the UI and logs and it shouldn't crash anymore. It only took 6 months. I should work at Microsoft...
    2 Hauppauge PVR-150's, Celeron 2.93GHz, 1GB RAM, 1TB Maxtor HD, Cooler Master Cavalier 2, Radeon HD 2400 Pro, gbpvr 1.1.5 Blue Skin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •