Skip to content

Electron 1.8.x crash with native crypto module in renderer process #11358

Closed

Description

@vuamitom
  • Electron version: 1.8.2-beta.3
  • Operating system: Windows 10

Expected behavior

Electron does not crash. And run crypto successfully.

Actual behavior

Electron crashes when use crypto module in renderer process. Output stacktrace:

[26544:1206/184200.743:FATAL:partition_alloc.cc(934)] Check failed: page->num_allocated_slots != -1.
Backtrace:
GetHandleVerifier [0x00007FF712AAD9D5+25013]
GetHandleVerifier [0x00007FF712B1FE73+493139]
(No symbol) [0x00007FF712AA4EA4]
IsSandboxedProcess [0x00007FF715A8EDDD+46693001]
IsSandboxedProcess [0x00007FF714A1159B+29401671]
v8::internal::OptimizingCompileDispatcher::Unblock [0x00007FFEDFC1C847+1831]
v8::internal::OptimizingCompileDispatcher::Unblock [0x00007FFEDFC1CA68+2376]
v8::internal::GCIdleTimeHandler::ResetNoProgressCounter [0x00007FFEDF8CB30E+5566]
v8::internal::ScavengeJob::NotifyIdleTask [0x00007FFEDF8C7112+1938]
v8::internal::GCTracer::AddScopeSample [0x00007FFEDF8B90D0+13872]
v8::internal::ScopeInfo::Empty [0x00007FFEDF91BFC1+13761]
v8::internal::Factory::NewRawOneByteString [0x00007FFEDF928925+117]
v8::internal::IdentityMapBase::NextIndex [0x00007FFEDFBA5ED0+2960]
v8::internal::IdentityMapBase::NextIndex [0x00007FFEDFBA5E7B+2875]
v8::internal::HandleScope::NumberOfHandles [0x00007FFEDF84EC4A+2458]
v8::internal::HandleScope::NumberOfHandles [0x00007FFEDF854199+24297]
v8::internal::HandleScope::NumberOfHandles [0x00007FFEDF8507AC+9468]
v8::internal::Factory::TryNewFixedArray [0x00007FFEDF92DE21+3825]
(No symbol) [0x000000D638DD3DFF]

How to reproduce

// load crypto module in renderer process

const crypto = require('crypto');
const data =  'lG9E+/g4JmRmedDAnihtBD4Dfaha/GFOjd+xUOQI05UtfVX3DjUXvrS98p7kZQwY3LNhdiFo7MY5rGft8yBuDhKuNNag9vRx/44IuClDhdQ=';
const key = 'q90K9yBqhWZnAMCMTOJfPQ==';
let iv = Buffer.from('0'.repeat(32), 'hex'),
     input = Buffer.from(data, 'base64'),
     key = Buffer.from(key, 'base64'),                    
     decipher = crypto.createDecipheriv('aes-128-cbc', key, iv),                            
     ciphertext = Buffer.concat([decipher.update(input), decipher.final()]); // this line crashes electron

Activity

  1. welcome commented on Dec 6, 2017

    @welcome

    👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

    To help make it easier for us to investigate your issue, please follow the contributing guidelines.

  2. alexeykuzmin commented on Dec 7, 2017

    @alexeykuzmin
    Contributor
  3. shingo-nakamura commented on Dec 18, 2017

    @shingo-nakamura

    Node.js: 8.8.1
    Electron: v1.8.1 beta
    OS: Both Windows 10 and OSX Sierra 10.12.6

    My Electron app crashed.
    I can reproduce this issue like this

    const crypto = require('crypto');
    let decipher = crypto.createDecipher('aes-256-ctr’, ’key’);
    let dec = decipher.update(‘password’, 'hex', 'utf8');
    dec += decipher.final('utf8');
    
  4. zcbenz commented on Dec 26, 2017

    @zcbenz
    Contributor

    I'm merging this to #11457.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions