[GH-ISSUE #1238] [Bug]: Error when exporting data on Electron #7404

Closed
opened 2026-04-10 17:13:29 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Shazib on GitHub (Jun 30, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/1238

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

No files are saved, app becomes erratic and un-usable afterwards (can't close/open budget).

I think this is due to a new security model starting in electron v21 that disallows the use of new/malloc:

https://www.electronjs.org/blog/v8-memory-cage

I will investigate this when i get time over the next couple days.

What error did you receive?

Loaded spreadsheet from cache (1000 items)
FATAL ERROR: v8_ArrayBuffer_NewBackingStore When the V8 Sandbox is enabled, ArrayBuffer backing stores must be allocated inside the sandbox address space. Please use an appropriate ArrayBuffer::Allocator to allocate these buffers, or disable the sandbox.
 1: 00007FF6331076E6 node::SetTracingController+80006
 2: 00007FF633107850 node::OnFatalError+304
 3: 00007FF635D69A12 v8::Function::NewInstance+1074
 4: 00007FF631DBD93B v8::ArrayBuffer::NewBackingStore+171
 5: 00007FF63311579D node::Buffer::New+717
 6: 00007FF63311554D node::Buffer::New+125
 7: 00007FFD7EC94810 node_register_module_v114+12384
 8: 00007FF63499FE68 v8::MicrotasksScope::PerformCheckpoint+88456
 9: 00000AFA5FE9C2F9

Where are you hosting Actual?

Other

What browsers are you seeing the problem on?

Other

Operating System

Windows 11

Originally created by @Shazib on GitHub (Jun 30, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/1238 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? No files are saved, app becomes erratic and un-usable afterwards (can't close/open budget). I _think_ this is due to a new security model starting in electron v21 that disallows the use of new/malloc: [https://www.electronjs.org/blog/v8-memory-cage](https://www.electronjs.org/blog/v8-memory-cage) I will investigate this when i get time over the next couple days. ### What error did you receive? ``` Loaded spreadsheet from cache (1000 items) FATAL ERROR: v8_ArrayBuffer_NewBackingStore When the V8 Sandbox is enabled, ArrayBuffer backing stores must be allocated inside the sandbox address space. Please use an appropriate ArrayBuffer::Allocator to allocate these buffers, or disable the sandbox. 1: 00007FF6331076E6 node::SetTracingController+80006 2: 00007FF633107850 node::OnFatalError+304 3: 00007FF635D69A12 v8::Function::NewInstance+1074 4: 00007FF631DBD93B v8::ArrayBuffer::NewBackingStore+171 5: 00007FF63311579D node::Buffer::New+717 6: 00007FF63311554D node::Buffer::New+125 7: 00007FFD7EC94810 node_register_module_v114+12384 8: 00007FF63499FE68 v8::MicrotasksScope::PerformCheckpoint+88456 9: 00000AFA5FE9C2F9 ``` ### Where are you hosting Actual? Other ### What browsers are you seeing the problem on? Other ### Operating System Windows 11
GiteaMirror added the electronbug labels 2026-04-10 17:13:29 -05:00
Author
Owner

@Shazib commented on GitHub (Jul 1, 2023):

So this issue is caused by calling export on a better-sqlite db object. Specifically line ~151 in cloud-storage.js.

I'm not 100% sure yet how to solve this. calling Buffer.alloc in that method is totally ok, but whatever export does under the surface is not allowed.

I'm considering writing the db a temp file and reading it in again as a properly allocated buffer.

At least I think its a better-sqlite object, we also use sqljs?

<!-- gh-comment-id:1615308944 --> @Shazib commented on GitHub (Jul 1, 2023): So this issue is caused by calling `export` on a `better-sqlite` db object. Specifically line ~151 in `cloud-storage.js`. I'm not 100% sure yet how to solve this. calling `Buffer.alloc` in that method is totally ok, but whatever `export` does under the surface is not allowed. I'm considering writing the db a temp file and reading it in again as a properly allocated buffer. At least I think its a better-sqlite object, we also use sqljs?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#7404