Skip to content

VM crashes on RegExp.hasMatch(null). #227

@whesse

Description

@whesse

What steps will reproduce the problem?

  1. Create the dart file:
    void main() {
      const RegExp(@­"^\w+$").hasMatch(null);
    }
  2. Run it in the VM.

What is the expected output? What do you see instead?
Here is the debug trace of the crash:

../runtime/vm/object.h:2385: error: expected: raw() != null()

Program received signal SIGABRT, Aborted.
0xf7fdf430 in __kernel_vsyscall ()
(gdb) bt

­0 0xf7fdf430 in __kernel_vsyscall ()

­1 0xf7be5921 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64

­2 0xf7be8d52 in abort () at abort.c:92

­3 0x08061cf0 in dart::DynamicAssertionHelper::Fail (this=0xffffc344,

    format=0x81bc935 "expected: %s") at ../runtime/vm/assert.cc:39

­4 0x08056ecc in dart::String::raw_ptr (this=0xffffca04)

    at ../runtime/vm/object.h:2385

­5 0x08056b59 in dart::String::Length (this=0xffffca04)

    at ../runtime/vm/object.h:2287

­6 0x0812441e in dart::GetTwoByteData (str=...)

    at ../runtime/lib/regexp_jsc.cc:20

­7 0x081247b2 in dart::Jscre::Execute (regex=..., str=..., start_index=0)

    at ../runtime/lib/regexp_jsc.cc:114

­8 0x0812432b in dart::DN_HelperJSSyntaxRegExp_ExecuteMatch (

    arguments=0xffffcc24) at ../runtime/lib/regexp.cc:73

­9 0x08124241 in dart::DN_JSSyntaxRegExp_ExecuteMatch (args=0xffffcc24)

    at ../runtime/lib/regexp.cc:68

What version of the product are you using? On what operating system?

Revision 508, Debug_ia32, running on linux.

Please provide any additional information below.

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions