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

Implement throwing of ArgumentError from API implementation code #8233

Closed
sgjesse opened this issue Jan 31, 2013 · 3 comments
Closed

Implement throwing of ArgumentError from API implementation code #8233

sgjesse opened this issue Jan 31, 2013 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgjesse
Copy link
Contributor

sgjesse commented Jan 31, 2013

In some cases the API implementation code (in runtime/vm/dart_api_impl.cc) needs to throw exceptions, most likely ArgumentError.

There is an implementation of that in https://codereview.chromium.org/12089071/, but it hits an ASSERT in debug mode.

@sgjesse
Copy link
Contributor Author

sgjesse commented Jan 31, 2013

See https://codereview.chromium.org/12089071/diff/1004/runtime/vm/dart_api_impl.cc?column_width=80 for then implementation which causes this ASSERT in debug mode:

#­0 0xf7fdb430 in __kernel_vsyscall ()
#­1 0xf7ce41df in raise () from /lib/i386-linux-gnu/libc.so.6
#­2 0xf7ce7825 in abort () from /lib/i386-linux-gnu/libc.so.6
#­3 0x080a5484 in dart::DynamicAssertionHelper::Fail (this=0xf35fe1ec,
    format=0x85e9f75 "expected: %s") at runtime/platform/assert.cc:40
#­4 0x081438bb in dart::Handles<2, 64, 4>::VerifyScopedHandleState (
    this=0xf35fef50) at runtime/vm/handles_impl.h:267
#­5 0x08142fa9 in dart::HandleScope::HandleScope (this=0xf35fe448,
    __in_chrg=<optimized out>) at runtime/vm/handles.cc:102
#­6 0x080ec56e in dart::JumpToExceptionHandler (program_counter=4085139106,
    stack_pointer=4083148320, frame_pointer=4083148368, exception_object=...,
    stacktrace_object=...) at runtime/vm/exceptions.cc:135
#­7 0x080ec9b2 in dart::ThrowExceptionHelper (incoming_exception=...,
    existing_stacktrace=...) at runtime/vm/exceptions.cc:227
#­8 0x080ed1d0 in dart::Exceptions::Throw (exception=...)
    at runtime/vm/exceptions.cc:380
#­9 0x0806c109 in dart::ThrowArgumentError (
    exception_message=0x85d1128 "List contains non-int elements")
    at runtime/vm/dart_api_impl.cc:2105
#­10 0x0806c62f in dart::Dart_ListGetAsBytes (list=0xf3300db4, offset=0,
    native_array=0xf3300ac0 "\001\002\003\363\020\001\060\363\300T
\bM",
    length=4) at runtime/vm/dart_api_impl.cc:2157
#­11 0x080addf2 in Builtin_Socket_WriteList (args=0xf35fe584)
    at runtime/bin/socket.cc:208
#­12 0xf5bc015e in ?? ()
#­13 0xf37e607d in ?? ()
#­14 0xf37e5960 in ?? ()
#­15 0xf37e54a7 in ?? ()
#­16 0xf37e5381 in ?? ()
#­17 0xf37e4494 in ?? ()
#­18 0xf37e4263 in ?? ()
#­19 0xf37dea86 in ?? ()
#­20 0xf37de8ef in ?? ()
#­21 0xf37de5f7 in ?? ()
#­22 0xf37de509 in ?? ()
#­23 0xf37dddb0 in ?? ()
#­24 0xf37ddb09 in ?? ()
#­25 0xf37e416f in ?? ()
#­26 0xf37e407d in ?? ()
#­27 0xf37e3f39 in ?? ()
#­28 0xf37e1fe7 in ?? ()
#­29 0xf37d4b5c in ?? ()
#­30 0xf37d4834 in ?? ()
#­31 0xf37d6567 in ?? ()
#­32 0xf37d4b80 in ?? ()
#­33 0xf37d4834 in ?? ()
#­34 0xf37d6567 in ?? ()
#­35 0xf37d4b80 in ?? ()
#­36 0xf37d4834 in ?? ()
#­37 0xf37d45fa in ?? ()
#­38 0xf37e19fe in ?? ()
#­39 0xf37dce7b in ?? ()
#­40 0xf37dc81b in ?? ()
#­41 0xf37d4279 in ?? ()
#­42 0xf37c0078 in ?? ()
#­43 0x080d94d4 in dart::DartEntry::InvokeStatic (function=..., arguments=...,
    arguments_descriptor=...) at runtime/vm/dart_entry.cc:88
#­44 0x080d9321 in dart::DartEntry::InvokeStatic (function=..., arguments=...)

@iposva-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Unassigned label.

@sgjesse sgjesse added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. labels Jun 5, 2013
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@iposva-google iposva-google added the closed-obsolete Closed as the reported issue is no longer relevant label May 19, 2016
@iposva-google
Copy link
Contributor

Some of the corresponding API code has been cleaned in the meantime.

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, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants