Skip to content

Crash dartium tab with this fancy-sytnax #12316

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

Closed
sethladd opened this issue Aug 8, 2013 · 13 comments
Closed

Crash dartium tab with this fancy-sytnax #12316

sethladd opened this issue Aug 8, 2013 · 13 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-mirrors P0 A serious issue requiring immediate resolution

Comments

@sethladd
Copy link
Contributor

sethladd commented Aug 8, 2013

Using Dart Editor version 0.6.15_r25822

Consider this code:

<!DOCTYPE html>

<html>
  <head>
    <title>index</title>
    <script src="packages/polymer/boot.js"></script>
  </head>
 
  <body>
    <template id="tmpl" bind>
      
      <!-- Only works with fancy-syntax -->
      <ul>
      <template repeat="{{k in addresses.keys}}">
        <li>{{addresses[k]}}</li>
      </template>
      </ul>

      
      <!-- This should work, but doesn't -->
      <!-- See https://github.com/dart-lang/fancy-syntax/issues/9 -->
      <!--
      <template repeat="{{a > 21 ? [1,2,3] : [5,6,7]}}">
        <li>{{}}</li>
      </template>
      -->
        
      
    </template>
    <script type="application/dart" src="index.dart"></script>
  </body>
</html>

import 'dart:html';
import 'package:fancy_syntax/syntax.dart';

class Person {
  String firstName;
  String lastName;
  bool signedAgreement;
  int age;
  Map<String, Address> addresses = new Map<String, Address>();
  List<Color> favoriteColors = new List<Color>();
  
  String get fullName => '$firstName $lastName';
  
  Address addressFor(String name) => addresses[name];
}

class Address {
  String street;
  String city;
  
  Address(this.street, this.city);
}

class Color {
  String name;
  String hex;
  
  String toString() => '$name is $hex in hex';
}

main() {
  Person bob = new Person()
      ..firstName = 'Bob'
      ..lastName = 'Smith'
      ..signedAgreement = true
      ..age = 42
      ..favoriteColors.add(new Color()..name="red"..hex="#FF0000")
      ..favoriteColors.add(new Color()..name="yellow"..hex="#FFFF00")
      ..addresses['home'] = new Address("main st", "smallville")
      ..addresses['work'] = new Address('oak way', 'gotham');
  
  TemplateElement template = query('#tmpl');
  template.bindingDelegate = new FancySyntax();
  template.model = bob;
}

Run that, and I get a crashed Aw Snap tab.


Attachment:
[Screen Shot 2013-08-07 at 11.11.45 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-12316/comment-0/Screen Shot 2013-08-07 at 11.11.45 PM.png) (37.19 KB)

@sethladd
Copy link
Contributor Author

sethladd commented Aug 8, 2013

FWIW this works fine:

      <ul>
      <template repeat="{{k in addresses.keys}}">
        <li>{{k}}</li>
      </template>
      </ul>

@sethladd
Copy link
Contributor Author

sethladd commented Aug 9, 2013

FYI I tried to test this on bleeding_edge editor, but ran into what appears to be a fancy-syntax bug. See https://github.com/dart-lang/fancy-syntax/issues/29 which we'll need to fix before we can confirm if the Dartium issue is fixed.

@sethladd
Copy link
Contributor Author

sethladd commented Aug 9, 2013

OK, I changed "break on exceptions: all" to "break on exceptions: uncaught" and I can reproduce the Dartium crash.

Specifically, Dartium Version 30.0.1581.0 (214250)

@justinfagnani
Copy link
Contributor

I closed fancy-syntax issue #29 because it's a Editor or VM issue. So it this one. No Dart code should crash Dartium. Assigning this to Vijay.


Set owner to @vsmenon.

@justinfagnani
Copy link
Contributor

The Fancy Syntax example also reliably crashes Dartium as of 25972

https://github.com/dart-lang/fancy-syntax/blob/master/example/example.html

@sethladd
Copy link
Contributor Author

sethladd commented Aug 9, 2013

Bumping to High, I don't think we can release on Monday with this crash.


Removed Priority-Unassigned label.
Added Priority-High label.

@dgrove
Copy link
Contributor

dgrove commented Aug 9, 2013

cc @jacob314.
Removed Priority-High label.
Added Priority-Critical label.

@jacob314
Copy link
Member

jacob314 commented Aug 9, 2013

Set owner to @jacob314.
Added Accepted label.

@blois
Copy link

blois commented Aug 9, 2013

Quick glance it's crashing in mirrors

@blois
Copy link

blois commented Aug 9, 2013

Stack trace:
#­0 0x00007ffff2934425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#­1 0x00007ffff2937b8b in __GI_abort () at abort.c:91
#­2 0x0000000004a43b7d in dart::DynamicAssertionHelper::Fail (this=0x7fffdab149b0, format=0x6f0d1b7 "expected: %s") at ../../dart/runtime/platform/assert.cc:40
#­3 0x0000000004aa3a44 in dart::DN_HelperClassMirror_members (isolate=0x1b3e1c6b1020, arguments=0x7fffdab15360) at ../../dart/runtime/lib/mirrors.cc:466
#­4 0x0000000004aa375e in dart::BootstrapNatives::DN_ClassMirror_members (args=0x7fffdab15360) at ../../dart/runtime/lib/mirrors.cc:451
#­5 0x00007fffd85f225d in stub_CallBootstrapCFunction ()
#­6 0x00007fffd8553132 in dart:mirrors__LocalClassMirrorImpl@0x4863bc9__computeMembers@0x4863bc9 ()
#­7 0x00007fffd8552f90 in dart:mirrors__LocalClassMirrorImpl@0x4863bc9_get_members_entry ()
#­8 0x00007fffd3c5a3d9 in ?? ()
#­9 0x00007fffd3c5a429 in ?? ()
#­10 0x00007fffd3c5a429 in ?? ()
#­11 0x00007fffd8632021 in ?? ()
#­12 0x00007fffd8552e89 in dart:mirrors__LocalClassMirrorImpl@0x4863bc9_get_members_entry ()
#­13 0x00007fffdab15410 in ?? ()
#­14 0x00007fffd8552b11 in package:fancy_syntax/src/mirrors.dart
::getMemberMirror_entry ()
#­15 0x00007fffd3c5a429 in ?? ()
#­16 0x00007fffd8632021 in ?? ()
#­17 0x00007fffd8632021 in ?? ()
#­18 0x00007fffd8632021 in ?? ()
#­19 0x00007fffd8552a69 in package:fancy_syntax/src/mirrors.dart
::_getMemberMirror_entry ()
#­20 0x00007fffdab15448 in ?? ()
#­21 0x00007fffd855693d in package:fancy_syntax/eval.dart_Scope_ownerOf_entry ()
#­22 0x00007fffd3c5a349 in ?? ()
#­23 0x00007fffd3c5a429 in ?? ()
#­24 0x00007fffd3c5a429 in ?? ()
#­25 0x00007fffd3c5a349 in ?? ()
#­26 0x00007fffd8556509 in package:fancy_syntax/eval.dart_Scope_ownerOf_entry ()
#­27 0x00007fffdab15488 in ?? ()
#­28 0x00007fffd854fa9a in package:fancy_syntax/eval.dart_IdentifierObserver__updateSelf@0x2e17bf88_entry ()
#­29 0x00007fffd3c59ef9 in ?? ()
#­30 0x00007fffd3c3d309 in ?? ()
#­31 0x00007fffd3c59ac9 in ?? ()
#­32 0x00007fffd8632021 in ?? ()
#­33 0x00007fffd8632021 in ?? ()
#­34 0x00007fffd854f849 in package:fancy_syntax/eval.dart_IdentifierObserver__updateSelf@0x2e17bf88_entry ()
#­35 0x00007fffdab154c0 in ?? ()
#­36 0x00007fffd38d2101 in package:fancy_syntax/eval.dart_ExpressionObserver__observe@0x2e17bf88_entry ()

Also note that this method is called a couple of times successfully before it crashes:
[530:530:0809/141548:3993212577435:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("firstName")", source: undefined (0)
[530:530:0809/141549:3993213496818:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("lastName")", source: undefined (0)
[530:530:0809/141550:3993214219687:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("getFullName")", source: undefined (0)
[530:530:0809/141550:3993214931101:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("firstName")", source: undefined (0)
[530:530:0809/141550:3993214933921:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("lastName")", source: undefined (0)
[530:530:0809/141551:3993215466405:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("items")", source: undefined (0)
[Thread 0x7fffde488700 (LWP 561) exited]
[530:530:0809/141552:3993216787657:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("firstName")", source: undefined (0)
[530:530:0809/141552:3993216823186:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("lastName")", source: undefined (0)
[530:530:0809/141553:3993217507365:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("firstName")", source: undefined (0)
[530:530:0809/141553:3993217509929:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("lastName")", source: undefined (0)
[530:530:0809/141553:3993217518011:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("items")", source: undefined (0)
[530:530:0809/141553:3993217528842:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("firstName")", source: undefined (0)
[530:530:0809/141553:3993217529506:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("lastName")", source: undefined (0)
[530:530:0809/141553:3993217531995:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("firstName")", source: undefined (0)
[530:530:0809/141553:3993217533116:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("lastName")", source: undefined (0)
[530:530:0809/141553:3993217555330:INFO:CONSOLE(0)] "getting mirror ClassMirror on 'Person', Symbol("items")", source: undefined (0)
../../dart/runtime/lib/mirrors.cc:466: error: expected: !fields.IsNull()


cc @iposva-google.
cc @a-siva.
Removed the owner.
Removed Area-Dartium label.
Added Area-VM, Triaged labels.

@iposva-google
Copy link
Contributor

Set owner to @rmacnak-google.
Added Library-Mirrors, Accepted labels.

@dgrove
Copy link
Contributor

dgrove commented Aug 9, 2013

I tried this with the dartium 25983, and it did not crash for me. Thanks for the quick fix!


Added Fixed label.

@sethladd
Copy link
Contributor Author

Awesome, thanks for the fix!

@sethladd sethladd added Type-Defect P0 A serious issue requiring immediate resolution area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-mirrors labels Aug 10, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-mirrors P0 A serious issue requiring immediate resolution
Projects
None yet
Development

No branches or pull requests

7 participants