Debugger crashes inspecting children

Inspector also works fine for me, but that could possibly be a different Fire vs Water, even though I don’t know why. Seeing more infos (or maybe in can TeamView into your system?) would help, here.

This is what I’m referring to with local variable values displaying but not members. The 2 variables defined in the begin/end block of onCreate display out to the side in the editor. Oddly, lName also displays but not lNumItems, and I assume the self on line 25 is referring to mNumItems.

And the debug session is not being killed in this new sample project, so I may need to use TeamViewer while running my actual project

I may have found something helpful in Logcat.

17940 17961 F com.debugging: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: jfieldID com.debugging.MockList com.debugging.MainActivity.mList not valid for an object of class com.debugging.MockList
17940 17961 F com.debugging: java_vm_ext.cc:570]     in call to GetObjectField
--------- beginning of crash
17940 17961 F libc    : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x764214c55c in tid 17961 (JDWP Transport ), pid 17940 (com.debugging)
875   875 I Zygote  : Process 17940 exited due to signal 11 (Segmentation fault)
936   936 W lowmemorykiller: Failed to open /proc/17940/oom_score_adj; errno=2: process 17940 might have been killed
1384  1411 I ActivityManager: Process com.debugging (pid 17940) has died: vis+99 TOP
1384  1460 I libprocessgroup: Successfully killed process cgroup uid 10519 pid 17940 in 0ms

This is the entirety of the project’s code (project included below):

namespace com.debugging;

interface

uses
  java.util, android.app, android.content, android.os, android.util, android.view, android.widget;

type
  MainActivity = public class(Activity)
  private
    mList: MockList;

  public
    method onCreate(savedInstanceState: Bundle); override;
  end;

  MockList = public class
  public
    mNumItems: Integer;
  end;

implementation

method MainActivity.onCreate(savedInstanceState: Bundle);

begin
  inherited;
  ContentView := R.layout.main;

  mList := new MockList;
  mList.mNumItems := 11;

  Log.d('debug-test', String.format('%d', mList.mNumItems));
  Log.d('debug-test', 'Test');  // breakpoint here
end;

end.

com.debugging.zip (98.3 KB)

Oh. thats as deigned. only locals will show automatically, as that’s all the debugger knows ab out at this stage. Int would be super costly to try and evaluate every single token visible on screen.

That looks like a bug, yes. possibly re related with using the classing “before the begin” var declaration. I’ll need this testcase as project, not screenshot, so I can log it.

that’d be cool.

That’s for the one where the debug session stops when you select the output pane? I’ll see oof I can reproduce that with our project, here. where do you break for this to haoppen, any place in onCrete?

I’ve been breaking on the last line in onCreate just to allow all of its code to run. I don’t think it matters though. What does matter that I forgot to mention is that in this project I do not get the debug-session-stop until I expand the “this” in the Debug Pane. Once I expand “this” (to view children) the debug session crashes after ~1-2s.

Ok, interesting. I’d really like if I could TV in and debug/see this happening on your system

1 Like

Thanks, logged as bugs://84143

1 Like

Any update on “this”? (Monday pun-day)

Not really; it doesn’t repro for us here, unfortunately, so I’ve logged int for the compiler team as the error message sounds like it might be some invalid/flaky byte code. but im guessing here…

Did you get a chance to test if this issue still persists in 2501, btw? There have been a few fixes in this area, which could be any we can’t retro the problem here…

Essentially, i’m told, the debugger is asking for a “wrong field” on the instance, possibly because the local’s got screwed/mixed up.

bugs://84143 got closed with status fixed.

I found the cause of this. Should be fixed in fridays build. thanks for letting us know!

2 Likes

Fantastic! Thanks Carlo

I’ll send you a build later today.

1 Like

Thanks Marc!

up.

I’ve been using the debugger for a couple days now with no issues related to this. Thanks again @ck!

2 Likes

Glad to hear!