Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when debugging sunflower sample #2150

Closed
DartBot opened this issue Mar 14, 2012 · 13 comments
Closed

Crash when debugging sunflower sample #2150

DartBot opened this issue Mar 14, 2012 · 13 comments
Labels

Comments

@DartBot
Copy link

DartBot commented Mar 14, 2012

This issue was originally filed by podivilov@google.com


Open samples/sunflower/sunflower.html in Dartium. Open the developer tools, refresh to see the source files, and place a breakpoint in sunflower.dart on line 19 (PHI = ...). Then refresh.

@DartBot
Copy link
Author

DartBot commented Mar 14, 2012

This comment was originally written by @mhausner


At what chagelist/revision of the Dart runtime is this happening? If this is before r5436, it most likely is due to optimized code. After this change, the debugger knows how to deoptimize functions when breakpoints are set in optimized code.

@DartBot
Copy link
Author

DartBot commented Mar 14, 2012

This comment was originally written by podivilov@google.com


I still see the crash at r5464. Matthias, could you please take a look?

ASSERT(bpt->breakpoint_kind_ == PcDescriptors::kReturn) is failed:

#­0 *__GI_abort () at abort.c:128
#­1 0xf4a04011 in dart::DynamicAssertionHelper::Fail (this=0xff9ca7dc, format=0xf5c80eb1 "expected: %s") at dart/runtime/platform/assert.cc:41
#­2 0xf4919e01 in dart::Debugger::BreakpointCallback (this=0xf974e260) at dart/runtime/vm/debugger.cc:894
#­3 0xf4a1fed3 in DRT_HelperBreakpointDynamicHandler (arguments=<optimized out>, isolate=<optimized out>) at dart/runtime/vm/code_generator.cc:760
#­4 dart::DRT_BreakpointDynamicHandler (arguments=...) at dart/runtime/vm/code_generator.cc:756
#­5 0xee7000c2 in ?? ()
#­6 0xe8280334 in ?? ()
#­7 0xe828090d in ?? ()
#­8 0xe8280684 in ?? ()
#­9 0xe8280452 in ?? ()
#­10 0xe828006d in ?? ()
#­11 0xf490a988 in dart::DartEntry::InvokeStatic (function=..., arguments=..., optional_arguments_names=...) at dart/runtime/vm/dart_entry.cc:82
#­12 0xf48d0072 in dart::Dart_InvokeStatic (library_in=0xf97d90fc, class_name_in=0xf97d90f4, function_name_in=0xf97d90f0, number_of_arguments=0, arguments=0x0)
    at dart/runtime/vm/dart_api_impl.cc:2303
#­13 0xf324009d in WebCore::DartApplicationLoader::callEntryPoint ()


Set owner to @mhausner.

@DartBot
Copy link
Author

DartBot commented Mar 14, 2012

This comment was originally written by @mhausner


Thank you Pavel. I will take a look today.

@DartBot
Copy link
Author

DartBot commented Mar 14, 2012

This comment was originally written by podivilov@google.com


Please note that in debug mode it stops at "void drawFrame() {" for some reason. You need to hit F11 twice to observe the crash.

@DartBot
Copy link
Author

DartBot commented Mar 14, 2012

This comment was originally written by @mhausner


I cannot reproduce the crash/assert mentioned above. I do however have an explanation why the breakpoint got set in the line "void drawFrame()".

The line info was off because the debugger indeed set the breakpoint at the wrong location. I have a fix for that that I'll send for review in a moment.

When I run Dartium in --single-process mode, I get a different assertion when the debugger breaks at line 19:

hit user breakpoint at file:///src/dartium/src/dart/samples/sunflower/Sunflower.dart:19 (Address 0x1b1807f8)

Fatal error in ../../src/objects-inl.h, line 1461

CHECK(index < GetInternalFieldCount() && index >= 0) failed

Abort trap

I am not sure this has anything to do with the debugger. If I run Dartium in regular mode (not single process) then everything works fine and I can single-step through the entire Sunflower code, including the closure that gets called when the slider value changes.

Please try again once the breakpoint location bug is fixed.

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by @mhausner


Please try with a VM at r5501 or newer and let me know whether the crash can be reproduced.

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by podivilov@google.com


At r5512 it still crashes.

  1. set breakpoint at Sunflower.dart:31
  2. reload
  3. step over to drawFrame()
  4. step into
  5. crash

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by @mhausner


Strange. I cannot reproduce the crash. The debugger correctly steps into drawFrame() and i can step through that function as well.

This is on the mac with the command line: ./xcodebuild/Debug/Chromium.app/Contents/MacOS/Chromium

If I start Dartium in single process mode, like so:

./xcodebuild/Debug/Chromium.app/Contents/MacOS/Chromium --single-process

I do see a crash even in item 3) in your list, stepping over line 31. The crash is in v8 code though. This is what the console output is:

Fatal error in ../../src/objects-inl.h, line 1461

CHECK(index < GetInternalFieldCount() && index >= 0) failed

What could I be doing wrong for me not to see the crash? Are you seeing this on Linux or on the Mac? I've had bugs before that only showed on one OS but not the other. In that case it was an uninitialized variable.

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by lod...@google.com


For me, currently, on Linux, with the Dartium version that comes with the
current weekly download of DartEditor, it doesn't crash anymore, but breaks
at a wrong location in the file. Originally, it crashed with Aw Snap. There
must be something odd about the sunflower sample, because in other dart
applications the breakpoints seem to work fine.

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by @mhausner


The inaccurate breakpoint locations are an known issue I have on my list of things to improve. In particular at the end of functions, the line number is off.

Sunflower is a neat small piece of Dart code that seems to contain a number of interesting corner cases for the debugger. I wouldn't call the Sunflower code odd. The debugger code is just not ready for prime time just yet.

@DartBot
Copy link
Author

DartBot commented Mar 19, 2012

This comment was originally written by podivilov@google.com


Looks like this problem shows up on linux only. Latest linux build still crashes in sunflower's main() on "ASSERT(bpt->breakpoint_kind_ == PcDescriptors::kReturn)".


Added OpSys-Linux label.

@DartBot
Copy link
Author

DartBot commented Mar 19, 2012

This comment was originally written by @mhausner


Ok, I figured it out. It's a use-after-free bug. Linux seems to poison the freed block but not MacOS. I'll have a fix out shortly.

@DartBot
Copy link
Author

DartBot commented Mar 19, 2012

This comment was originally written by @mhausner


This should be fixed as of r5668.


Added Fixed label.

copybara-service bot pushed a commit that referenced this issue Jun 22, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/793d575..4757339):
  47573391  2023-06-21  Sam Rawlins  Remove dependency on code_builder (#3451)
  370cb2c4  2023-06-21  Sam Rawlins  Remove all use of package:build (#3448)
  70c2897b  2023-06-20  Sam Rawlins  Simplify some code in PackageBuilder (#3447)
  1a8403ec  2023-06-20  Sam Rawlins  Rank libraries lower than classes and class members (#3446)

lints (https://github.com/dart-lang/lints/compare/4b79906..79581ff):
  79581ff  2023-06-20  Devon Carew  update core and recommended from the recent review (#136)

test (https://github.com/dart-lang/test/compare/3d5afed..cdc8178):
  cdc8178b  2023-06-21  Nate Bosch  Ignore a false positive for unreachable_from_main (#2041)

vector_math (https://github.com/google/vector_math.dart/compare/a3aca09..c147038):
  c147038  2023-06-20  Lukas Klingsbo  `Vector2` constructor benchmark (#297)

web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/af72652..7fb82f2):
  7fb82f2  2023-06-21  Brian Quinlan  Add a note explaining why the onerror doesn't generate a more detailed exception (#273)

webdev (https://github.com/dart-lang/webdev/compare/b58edb7..6fe17fe):
  6fe17fe8  2023-06-21  Elliott Brooks  Prepare Webdev `3.0.5` release (#2151)
  3b7f266c  2023-06-21  Elliott Brooks  Small fixes for the `release` script (#2150)
  45446ec9  2023-06-20  Elliott Brooks  Reset DWDS to `19.0.2-wip` (#2149)
  91cbd183  2023-06-20  Elliott Brooks  Prepare DWDS for release to version 19.0.1 (#2145)
  a7b81589  2023-06-20  Elliott Brooks  Don't run proper_release_test with the rest of the test common tests (#2146)
  aa586d29  2023-06-20  Elliott Brooks  Fix DCM errors in `chrome_proxy_service.dart` (#2148)

Change-Id: I27850a0b8b1241b03f07a5832555d4da6dfbff44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310962
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant