Skip to content

Calling Intl.v8BreakIterator makes the process crash #3111

Description

@targos
node -p "new Intl.v8BreakIterator()"


#
# Fatal error in , line 0
# Failed to create ICU break iterator, are ICU data files missing?
#

==== C stack trace ===============================

 1: V8_Fatal
 2: v8::internal::BreakIterator::InitializeBreakIterator(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::JSObject>)
 3: v8::internal::Runtime_CreateBreakIterator(int, v8::internal::Object**, v8::internal::Isolate*)
 4: 0x35e1cb4060bb
[1]    14295 illegal hardware instruction (core dumped)  node -p "new Intl.v8BreakIterator()"

This is the line where it happens:

FATAL("Failed to create ICU break iterator, are ICU data files missing?");

I guess that the feature v8 is trying to load is not available with small-icu ? Anyway it seems wrong to experience a fatal error in this case.

Activity

  1. added
    v8 engineIssues and PRs related to the V8 dependency.
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Sep 29, 2015
  2. evanlucas commented on Sep 29, 2015

    @evanlucas
    Contributor

    Yea, I'm seeing this also. It works when built with full-icu, but fails with small-icu

  3. bnoordhuis commented on Sep 29, 2015

    @bnoordhuis
    Member

    /cc @nodejs/intl

  4. srl295 commented on Sep 30, 2015

    @srl295
    Member

    V8 wanted this to be a fatal instead of just a soft error (exception or
    something. )

    Yes small Icu doesn't have the data needed for this undocumented feature.
    Takes significant space- Use full Icu.

    If this is an important feature lets get it added to ecma402

    El martes, 29 de septiembre de 2015, Ben Noordhuis notifications@github.com
    escribió:

    /cc @nodejs/intl https://github.com/orgs/nodejs/teams/intl

    —
    Reply to this email directly or view it on GitHub
    #3111 (comment).

  5. srl295 commented on Oct 6, 2015

    @srl295
    Member

    Should we "delete" the Intl.v8BreakIterator property if we know at startup that it can't function? Thoughts anyone?

  6. caridy commented on Oct 6, 2015

    @caridy

    Does anyone know what Intl.v8BreakIterator does?

    Maybe @ajklein knows more about this method.

  7. ajklein commented on Oct 6, 2015

    @ajklein
    Contributor

    @nciric would know much better than I (this is the best I could find: https://code.google.com/p/v8-i18n/wiki/BreakIterator).

  8. nciric commented on Oct 7, 2015

    @nciric

    Break iterator does character/sentence segmentation in a locale friendly way. It relies on largish data files, and that's one of the reasons we added it to the Intl.* for Chrome/V8. Intl.v8BreakIterator is not part of ECMA 402 spec.

    Feel free to remove support for it from node. V8 may needed it for some internal projects.

  9. Fishrock123 commented on Oct 7, 2015

    @Fishrock123
    Contributor

    Should we "delete" the Intl.v8BreakIterator property if we know at startup that it can't function? Thoughts anyone?

    Nah just make it throw.

  10. self-assigned this
    on Oct 24, 2015
  11. srl295 commented on Oct 24, 2015

    @srl295
    Member

    OK. Current thought:

    • if the user sets a data path using env var or parameter (or in detect "full-icu" module #3460 full ICU is detected) , set process.icu_data_dir to that data path in node.cc
    • in node.js:
           if (process.config.variables.icu_small && !process.icu_data_dir) {
              Intl.v8BreakIterator=function(){throw Error('Data not available…');}
          }
    
  12. caridy commented on Oct 24, 2015

    @caridy

    Does node exposes any other v8 specific functionality? I'm worry about portability of the code if you use v8BreakIterator().

  13. srl295 commented on Oct 27, 2015

    @srl295
    Member

    @caridy no, nothing like that is exposed.

  14. 14 remaining items

  15. added a commit that references this issue on May 3, 2016
    c99f231
  16. srl295 commented on May 4, 2016

    @srl295
    Member
    $ node -p "new Intl.v8BreakIterator()"
    {}
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

i18n-apiIssues and PRs related to Node.js internationalization support.v8 engineIssues and PRs related to the V8 dependency.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions