Giter Club home page Giter Club logo

Comments (8)

osa1 avatar osa1 commented on August 15, 2024

@mkustermann I think it may make sense to run jscm test config before submitting patches. That configuration greatly increases test coverage. This issue was caused because we didn't run it when submitting.

from sdk.

rakudrama avatar rakudrama commented on August 15, 2024

+1 on adding jscm. I had no idea that not all the relevant tests were run.

This fixes the one with the stack trace: https://dart-review.googlesource.com/c/sdk/+/371743

I'm not sure where to start with the other two that just report:

Runtime error:
[object WebAssembly.Exception]
<undefined stack>

from sdk.

mkustermann avatar mkustermann commented on August 15, 2024

@mkustermann I think it may make sense to run jscm test config before submitting patches. That configuration greatly increases test coverage. This issue was caused because we didn't run it when submitting.

Ideally all CI bots also run on CQ. If we don't have resources and we had to pick, I'd pick not running JSCM because we don't have any customers of that mode atm. /cc @athomas does it increase CQ times if we add another builder?

I'm not sure where to start with the other two that just report:

You can often get the real stacks by running with D8 instead of Chrome. So in this case, if I run

% python3 tools/test.py -n dart2wasm-linux-jscm-d8 lib/typed_data/polymorphic_unmodifiable_typed_data_test
...
stdout:
Attempt to execute code removed by Dart AOT compiler (TFA)
    at Error._throwWithCurrentStackTrace (wasm://wasm/00086132:wasm-function[212]:0xa9dc)
    at new NaiveUnmodifiableInt32x4List (initializer) (wasm://wasm/00086132:wasm-function[925]:0x13c74)
    at NaiveUnmodifiableInt32x4List (wasm://wasm/00086132:wasm-function[924]:0x13c4d)
    at JSInt32x4ArrayImpl.asUnmodifiableView (wasm://wasm/00086132:wasm-function[914]:0x13aa9)
    at testInt32x4 (wasm://wasm/00086132:wasm-function[731]:0x11204)
    at main (wasm://wasm/00086132:wasm-function[94]:0x8eb8)
    at main tear-off trampoline (wasm://wasm/00086132:wasm-function[96]:0x8ed5)
    at _invokeMain (wasm://wasm/00086132:wasm-function[99]:0x90eb)
/usr/local/google/home/kustermann/repositories/sdk-gclient4/sdk/pkg/dart2wasm/bin/run_wasm.js:343: [object WebAssembly.Exception]
  }
  ^

Looking at the code, it may be due to this:

final class NaiveUnmodifiableInt32x4List extends NaiveInt32x4List {
  NaiveUnmodifiableInt32x4List(Int32x4List list)
      : super.externalStorage(unsafeCast<NaiveInt32x4List>(list)._storage);
  ...
}

TFA may infer that list is always a JSInt32x4ArrayImpl and so it knows that this unsafeCast<NaiveInt32x4List>(list) cannot be right, so it inserts a throw.

from sdk.

athomas avatar athomas commented on August 15, 2024

Adding dart2wasm-linux-jscm-chrome to the CQ SGTM, it runs relatively quick and should mostly trigger on dart2wasm related changes.

from sdk.

osa1 avatar osa1 commented on August 15, 2024

Fixed by the commit referenced above. 08ca631 removes unsafe casts in the file so that we won't have this issue again.

JSCM added to the CQ tests in https://dart-review.googlesource.com/c/sdk/+/371542.

from sdk.

mkustermann avatar mkustermann commented on August 15, 2024

The test is still failing in JSCM mode (but now due to a different reason):

% tools/build.py -nvh -d0 -mrelease -ax64 dart2wasm  create_sdk 
...
% python3 tools/test.py -n dart2wasm-linux-jscm-chrome lib/typed_data/polymorphic_unmodifiable_typed_data_test
                                                                                                                                                                                                                                                           
FAILED: dart2wasm-chrome release_x64 lib/typed_data/polymorphic_unmodifiable_typed_data_test                                                                                                                                                               
Expected: Pass                                                                                                                                                                                                                                             
Actual: RuntimeError                                                                                                                                                                                                                                       
...                                                      
Runtime error:                                             
[object WebAssembly.Exception]                                                                                                                                                                                                                             
<undefined stack>                                                                                                                                                                                                                                          
                                                                                                                             
Events:                                                                                                                                                                                                                                                    
- debug "test_controller.js started"                                                                                         
- debug "Sending events to driver page (isFirstMessage = true, isStatusUpdate = true, isDone = false)"                                                                                                                                                     
- print "dart-calling-main"                            
- print "UnimplementedError"                                                                                                                                                                                                                               
- print "    at Error._throwWithCurrentStackTrace (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.wasm:wasm-function[
212]:0xaa5f)                                                                                                                                                                                                                                               
    at JSDataViewImpl.asUnmodifiableView (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.wasm:wasm-function[740]:0x11
6fc)                                                                                                                         
    at testByteData (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.wasm:wasm-function[734]:0x115de)
    at main (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.wasm:wasm-function[94]:0x8f47)
    at main tear-off trampoline (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.wasm:wasm-function[96]:0x8f58)
    at _invokeMain (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.wasm:wasm-function[99]:0x916e)
    at Module.invoke (http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/polymorphic_unmodifiable_typed_data_test.mjs:558:28)
    at http://127.0.0.1:36223/root_build/generated_tests/dart2wasm-linux-jscm-chrome/tests_lib_typed_data_polymorphic_unmodifiable_typed_data_test/test.html?crossOriginPort=37871:29:23"
- {                                                                                                                          
      "type": "sync_exception",                                                                                                                                                                                                                            
      "value": "[object WebAssembly.Exception]",                                                                                                                                                                                                           
      "timestamp": 2.15,                       
      "stack_trace": "<undefined stack>"
}                             

which seems to be due to

 final class JSDataViewImpl implements ByteData {
  ...
  @override
  ByteData asUnmodifiableView() => throw UnimplementedError();
}

from sdk.

osa1 avatar osa1 commented on August 15, 2024

I'm implemented unmodifiable JS data view view in https://dart-review.googlesource.com/c/sdk/+/372082.

from sdk.

osa1 avatar osa1 commented on August 15, 2024

Missing asUnmodifiableView was implemented in 3b5065b.

from sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.