Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Browser crash when Brave Payments is enabled #7911

Closed
srirambv opened this issue Mar 27, 2017 · 11 comments
Closed

Browser crash when Brave Payments is enabled #7911

srirambv opened this issue Mar 27, 2017 · 11 comments

Comments

@srirambv
Copy link
Collaborator

  • Did you search for similar issues before submitting this one?
    Yes

  • Describe the issue you encountered:
    Browser crash when Brave Payments is enabled

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    Windows 10 x64

  • Brave Version (revision SHA):
    Brave 0.14.0
    rev 61b6b6b

  • Steps to reproduce:

    1. Do a clean install of 0.14.0 Preview 7 and launch from console
    2. Enable payments
    3. Browser crashes, no error shown in console
  • Actual result:
    Browser crash when Brave Payments is enabled

  • Expected result:
    Should not crash

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    Yes

  • Is this an issue in the currently released version?
    No

  • Can this issue be consistently reproduced?
    Yes

  • Extra QA steps:
    1.
    2.
    3.

  • Screenshot if needed:
    paymentcrash

  • Any related issues:

@NejcZdovc
Copy link
Contributor

I tried it with the latest master on macOS and it's working correctly. Does it work on preview 6?

@srirambv
Copy link
Collaborator Author

Works on preview 6
7911

@NejcZdovc
Copy link
Contributor

Strange. I am looking at changes and nothing major was changed between 6 and 7

v0.14.0dev-Preview6...dev-channel

Maybe node_modules removal or background page change?

cc @bbondy @bridiver

@srirambv
Copy link
Collaborator Author

Crash reporting seems to be disabled for Windows build. I don't see console log as well when browser crashes

@bsclifton
Copy link
Member

macOS seems to have an issue too- Preview 7 is showing me the "Create wallet" button, even though I have payments enabled and I do indeed have a wallet.

Here are logs from Windows (macOS gets the same underscore.trim() error):

brian@WIN10-x64 (dev-channel=) $ pstream/dev-channel /c/Users/brian/AppData/Local/brave/app-0.14.0/
[760:2248:0327/132202.804:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain
Crash reporting enabledannel=) $ top)             u/c/Users/brian/AppData/Local/brave/app-0.14.0/Br
[5004:6728:0327/132204.585:ERROR:crash_reporter_win.cc(190)] Cannot initialize out-of-process crash handler
ledger.js initialization failed: Error: Cannot find module 'underscore.string/trim'/app-0.14.0/Brav
Error: Cannot find module 'underscore.string/trim'/Users/brian/AppData/Local/brave/app-0.14.0/Brave
    at Module._resolveFilename (module.js:470:15)/Users/brian/AppData/Local/brave/app-0.14.0/Brave.
    at Function.Module._resolveFilename (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)/Users/brian/AppData/Local/brave/app-0.14.0/Brave.ex
    at Module.require (module.js:498:17)s/bB/c/Users/brian/AppData/Local/brave/app-0.14.0/Brave.exe
    at require (internal/module.js:20:19) R/c/Users/brian/AppData/Local/brave/app-0.14.0/Brave.exe
    at C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\ledger-publisher\index.js:6:12
    at Object.<anonymous> (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\ledger-publisher\index.js:416:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
ledger client boot error: Error: Cannot find module 'esprima-fb'
Error: Cannot find module 'esprima-fb'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\recast\lib\options.js:5:14
    at Object.<anonymous> (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\recast\lib\options.js:97:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
An uncaught exception occurred in the main process Uncaught Exception:
Error: Cannot find module 'underscore.string/trim'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\ledger-publisher\index.js:6:12
    at Object.<anonymous> (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\ledger-publisher\index.js:416:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\node-anonize2-relic-emscripten\anonize2.js:18
if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_

Error: Cannot find module 'underscore.string/trim'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\ledger-publisher\index.js:6:12
    at Object.<anonymous> (C:\Users\brian\AppData\Local\brave\app-0.14.0\resources\app.asar\node_modules\ledger-publisher\index.js:416:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
[7216:5628:0327/132222.382:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain

@bsclifton bsclifton assigned bsclifton and bbondy and unassigned bsclifton Mar 27, 2017
@bridiver
Copy link
Collaborator

underscore.string ?

@mrose17
Copy link
Member

mrose17 commented Mar 28, 2017

underscore.string is a package that contains additional functions for underscore-js

@bridiver
Copy link
Collaborator

it's listed as a dep for ledger-publisher and shows up in my local node_modules. It has also been there for a very long time. Maybe it was accidentally filtered in the changes @bbondy made?

@bbondy
Copy link
Member

bbondy commented Mar 28, 2017

Turns out to be from "Ignore non first level node_modules", checking to see what we can do to keep it.

@mrose17
Copy link
Member

mrose17 commented Mar 28, 2017

thanks!

@bbondy bbondy closed this as completed in 8a8466e Mar 28, 2017
@bbondy
Copy link
Member

bbondy commented Mar 28, 2017

Fixed now.

It turns out we did have an underscore-string dep top level from argparse, but it was old, and it had a different directory hierarchy.

It had trim under lib, and package.json specified that as the main entry
point, but our electron resolver doesn't check that.

The underscore.string that ledger-parser uses is newer and has the deps directly under underscore.string without a lib folder.

By adding the dep top level, we can ensure we use the later version
which doesn't have an extra directory that our resolver doesn't
understand.

bsclifton pushed a commit that referenced this issue Mar 28, 2017
Auditors: @bridiver

Fix #7911

It turns out we did have an underscore-string dep top level from argparse, but it was old, and it had a different directory hierarchy.
It had trim under lib, and package.json specified that as the main entry
point, but our electron resolver doesn't check that.

The underscore.string that ledger-parser uses is newer and has the deps directly under underscore.string without a lib folder.
By adding the dep top level, we can ensure we use the later version
which doesn't have an extra directory that our resolver doesn't
understand.
@alexwykoff alexwykoff changed the title Browser crash when Brave Payments is enabled Fixed browser crash when Brave Payments is enabled Mar 29, 2017
bridiver pushed a commit that referenced this issue Apr 4, 2017
Auditors: @bridiver

Fix #7911

It turns out we did have an underscore-string dep top level from argparse, but it was old, and it had a different directory hierarchy.
It had trim under lib, and package.json specified that as the main entry
point, but our electron resolver doesn't check that.

The underscore.string that ledger-parser uses is newer and has the deps directly under underscore.string without a lib folder.
By adding the dep top level, we can ensure we use the later version
which doesn't have an extra directory that our resolver doesn't
understand.
@luixxiul luixxiul changed the title Fixed browser crash when Brave Payments is enabled Browser crash when Brave Payments is enabled Sep 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.