Rewind problem

Oct 28, 2008 at 1:11 AM
I'm getting an error with a set of stdf files that our application creates:
 throw new InvalidOperationException("Cannot rewind further than memoized data");

Any ideas what can cause this? My query is the following:

           foreach (string fn in ofDialog.FileNames)
            {
                var stdf = new StdfFile(fn);

                //silly query
                var query = from r in stdf.GetRecords()
                            select r;
                //Get PTR results from failing parts grouped by test number
                var results = from ptr in stdf.GetRecords().OfExactType<Ptr>()
                              let result = ptr.Result
                              where result != null
                              group result.Value by ptr.TestNumber into g
                              select new { TestNumber = g.Key, Results = g };
                //NumRecords += query.Count();
                //tbNumRecords.Text = NumRecords.ToString();

error===> foreach (var test in results)
                {
                    if (!lbxTestNumbers.Items.Contains(test.TestNumber))
                    {
                        lbxTestNumbers.Items.Add(test.TestNumber);
                    }
                }
            }




Oct 28, 2008 at 1:54 AM
A little more info - after debugging further a simpler query:
           //silly query 
           var query = from r in stdf.GetRecords()
                            select r;

error===> NumRecords += query.Count(); //

code stopped at:
          public void Rewind(int offset) {
                if (offset == 0) return;
                if (offset > _MemoizedData.Length) { // offset is 37, _MemorizedData.Length is 35
                    //TODO: better message?
                    throw new InvalidOperationException("Cannot rewind further than memoized data");
                }


Oct 28, 2008 at 2:44 AM
Hi Eric,
  I couldn't reproduce the error you are seeing with any of my stdf files using the same code as you posted.

Does the problem occur with a particular stdf file or with any of your files?
Is the file loop important?  i.e.  Does it only fail after processing more than one file?

I'm sure Mark has some good ideas as to why the exception gets thrown.
 
Rob
Oct 29, 2008 at 8:19 PM
Hi Rob,
    Yes, it only happens with one category of file, generated from our diagnostics program. I don't know what is wrong with the file. Galaxy can process it, but the linq stdf gives this error. Maybe I could send you a sample file and see if it works for you?
Thanks,
Eric
Coordinator
Oct 30, 2008 at 4:11 PM
Eric, shoot the file to me and I'll see if I can repro. If so, this would definitely be a bug. We shouldn't be invoking rewind in this scenario. We invoke rewind if a record filter is registered that triggers corruption detection.  From the code above, you don't appear to be doing that.

I'm working on getting our test infrastructure into the CodePlex project, which should help us improve the quality dramatically.
Oct 30, 2008 at 7:39 PM

Hi Mark,

This is the file. Rob took at look at it and had the following feedback. I did find that we are writing the PCR and MRR records 2 times which is the problem. But the error statement didn’t really provide any clues as to why the query failed.

Thanks for your help,

Eric


From: marklio [mailto:notifications@codeplex.com]
Sent: Thursday, October 30, 2008 12:12 PM
To: e.craft@asterion.com
Subject: Re: Rewind problem [LinqToStdf:38633]

From Rob:

Hi Eric,

That's a very interesting file. As you say, Galaxy processes it fine but ....

I ran it through two of my internal tools - one crashed and one processed it without coment.

The one that crashed wasn't written by me and I don't have the source so I can't get any clues from that crash.

I also tried to run it through one of Teradynes tools and got a message saying that the file was not a valid STDF file.

I'm intrigued so I am going to try and work my way through all the records to see if there is anything seriously wrong with the format.

I have noticed a few things that are not quite as I would expect.

1) You have two PCR records - both for site zero.

Normally there should be one per site plus a global one for all sites (site 255)

2) The secod PCR is after the MRR. The V4 spec states that the MRR must be the LAST record in the stream.

- Maybe this is the problem.

3) There are no HBR, SBR and TSR records. I don't think that the V4 spec does not list these records as optional.

Could you check your STDF generator to see if the ordering of PCR and MRR is correct?

Regards

Rob

From: marklio

Eric, shoot the file to me and I'll see if I can repro. If so, this would definitely be a bug. We shouldn't be invoking rewind in this scenario. We invoke rewind if a record filter is registered that triggers corruption detection. From the code above, you don't appear to be doing that.

I'm working on getting our test infrastructure into the CodePlex project, which should help us improve the quality dramatically.

Read the full discussion online.

To add a post to this discussion, reply to this email (LinqToStdf@discussions.codeplex.com)

To start a new discussion for this project, email LinqToStdf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Oct 31, 2008 at 1:17 AM
Ah.  I see.  We may treat records after the MRR as "corrupt" and that results in a rewind.  Definitely a bug though.  I'll repro with the file and get a fix in.  Can you log a bug?
Coordinator
Nov 1, 2008 at 6:24 AM
For those following the discussion, I fixed this, and resolved the bug that Eric filed (http://www.codeplex.com/LinqToStdf/WorkItem/View.aspx?WorkItemId=2532).  Look at the bug if you want to see the details.  Let me know if you have questions.