"Error getting locals" in Water debugger


(Matt Robertson) #1

Running Water with Elements 10.0.0.2351, I am suddenly unable to inspect locals in the debugger. It shows a message

Error getting locals: system.collections.generic.keynotfoundexception.

Strangely, I tried to reproduce in a new project, but I am not able to create a new project due to error

Value cannot be null - Parameter name: collection

I am debugging an Android project written in Oxygene.


Debugger crashes inspecting children
(marc hoffman) #2

Does it print any more detailed stack trace for either exception? Does the issue persist with the latest, .2359?

thanx,
marc


(Matt Robertson) #3

Oops my mistake - I’m running .2359, not .2351, so yes. I also tried downgrading to .2358 and the issue persisted.

Nope, that’s all I’m getting for either one. I did a full uninstall and clean install and I am no longer getting the error on creating a new project, but I am still getting the error in the inspector.

I’ve been playing around with it and have noticed some more details:

I am able to inspect locals in a method as long as there is only a single variable type defined within the method. For example (this is actual code from a newly created test project):

method MainActivity.doHelloWorld;
  var
    text1, text2: String;
begin
  text2 := 'Hello, world 2.';
  Log.d('tests', text2);
end;

I am able to inspect this and see the value of text2, although strangely the first variable (in this case, text1) always shows up in the inspector as “self”, regardless of type or name, but it does show the correct value. If I change the code to this:

method MainActivity.doHelloWorld;
  var
    text1, text2: String;
    num: Integer; // only change from first example
begin
  text2 := 'Hello, world 2.';
  Log.d('tests', text2);
end;

then I get the same “error getting locals” error that I was getting in my main project.

If I define a class-scope variable, the app crashes while debugging if I expand the “this” scope item in the inspector. Oddly, the crash takes about one second to occur (consistently) and I am able to see that it displays the field name and value correctly before crashing. Strange all around, as debugging and inspecting were working fine for me just a few days ago.

Here’s the full test project. It’s a new project with only a handful of changes to test this bug.

com.matt.tests.zip (189.8 KB)


(RemObjects) #4

Thanks, logged as bugs://81678 — for the ‘error getting locals’


(Matt Robertson) #5

Does this mean that someone was able to reproduce the bug on another system?


(marc hoffman) #6

No, just that since enow have a testcase I can have someone look at it :wink:

Can you check Water.log to see if you see an y more details there? I just reviewed the code, and i should be logging the whole exception, there as “Exception getting locals: ...


(marc hoffman) #7

I cannot reproduce this one. Can you give me more steps? I assume you do File|New Project, then Java Console App or Android App (i tried both)? Does the error show before or after you browse for the target folder? how/where does it show, as a message box? using water’s “Oops there was a problem” Exception dialog?


(Matt Robertson) #8

It does show "The given key was not present in the dictionary." Here’s from there to the end, which appears to include the crash I referred to above.

2019-01-07 20:02:14 Exception getting locals: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at RemObjects.Oxygene.CoreDebugEngine.CooperDebugEngine.FillFrameData(StackFrameInfo ec)
   at RemObjects.Oxygene.CoreDebugEngine.StackFrameInfo.get_Locals()
   at RemObjects.Fire.ProjectSystem.DebugSession.fillLocals(StackFrameInfo stackFrame)
2019-01-07 20:02:14 <- Exception in block: The given key was not present in the dictionary. at    at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at RemObjects.Oxygene.CoreDebugEngine.CooperDebugEngine.FillFrameData(StackFrameInfo ec)
   at RemObjects.Oxygene.CoreDebugEngine.StackFrameInfo.get_Self()
   at RemObjects.Fire.ProjectSystem.TextFile.<>c__DisplayClass38.<getLocals>b__2()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:19 parameters {
  "Arguments": [
  ],
  "EnvironmentVariables": {
  },
  "Mode": "Cooper",
  "SubMode": "Android",
  "CaptureOutput": true,
  "CrossBox": "Local",
  "LocalExecutable": "C:\\Users\\mattr\\Documents\\RemObjects Software\\Elements\\Water\\com.matt.tests\\Bin\\Debug\\com.matt.tests.apk",
  "Architecture": "jvm",
  "AndroidDeviceID": "HT72V0201615",
  "AndroidPackageName": "com.matt.tests",
  "AndroidMainActivityName": "com.matt.tests.MainActivity",
  "UseMixedDebugger": false,
  "Detach": false,
  "StrictBreakpoints": true
}
2019-01-07 20:05:27 evaluateExpressionOnCurrentStackFrame error (Error) for expression 'end': End of expression expected but found: end
2019-01-07 20:05:31 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:32 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:37 parameters {
  "Arguments": [
  ],
  "EnvironmentVariables": {
  },
  "Mode": "Cooper",
  "SubMode": "Android",
  "CaptureOutput": true,
  "CrossBox": "Local",
  "LocalExecutable": "C:\\Users\\mattr\\Documents\\RemObjects Software\\Elements\\Water\\com.matt.tests\\Bin\\Debug\\com.matt.tests.apk",
  "Architecture": "jvm",
  "AndroidDeviceID": "HT72V0201615",
  "AndroidPackageName": "com.matt.tests",
  "AndroidMainActivityName": "com.matt.tests.MainActivity",
  "UseMixedDebugger": false,
  "Detach": false,
  "StrictBreakpoints": true
}
2019-01-07 20:05:52 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:52 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:06:07 parameters {
  "Arguments": [
  ],
  "EnvironmentVariables": {
  },
  "Mode": "Cooper",
  "SubMode": "Android",
  "CaptureOutput": true,
  "CrossBox": "Local",
  "LocalExecutable": "C:\\Users\\mattr\\Documents\\RemObjects Software\\Elements\\Water\\com.matt.tests\\Bin\\Debug\\com.matt.tests.apk",
  "Architecture": "jvm",
  "AndroidDeviceID": "HT72V0201615",
  "AndroidPackageName": "com.matt.tests",
  "AndroidMainActivityName": "com.matt.tests.MainActivity",
  "UseMixedDebugger": false,
  "Detach": false,
  "StrictBreakpoints": true
}

(Matt Robertson) #9

I can’t reproduce this one now either. I didn’t even get the “Oops there was a problem” dialog. It was just a plain white dialog that showed

Value cannot be null.
Parameter name: collection

(marc hoffman) #10

:(.

Weird.


(RemObjects) #11

bugs://81678 got closed with status fixed.


(Matt Robertson) #12

This seems promising :slight_smile: What happened with this?


(marc hoffman) #13

It was fixed? :wink:


(Matt Robertson) #14

Great! Thanks for the fix! Would it be possible for me to get a build with this fix? I’m trying to sort through a few bugs and 90% of the time the debugger either shows this or crashes out of the debug session completely.


(marc hoffman) #15

Sure thing, I’ll start a new build with Water for you now.


(marc hoffman) #16

Up!


(Matt Robertson) #17

Thanks Marc!