Skip to content

Randomly cause crash in electron with mikro-orm #193

Open
@flyguolai

Description

@flyguolai

Issue Title: [Crash in index.node: INVALID_POINTER_READ_c0000005" or "V8 FieldTypeDependency Error]


Environment

  • OS: [e.g., Windows 10 21H2 x64]
  • Node.js Version: [if applicable, e.g., Node.js v22.16.0]
  • Electron Version: [if applicable, e.g., Electron 34.1.1]
  • Hardware: [e.g., Intel i7-12500h, 16GB RAM]
  • Version: [v0.5.1]

Description

[Clearly describe the issue, including:]
1.The Toolchain is mikro-orm -> libsql-js ->libsql
2.Electron crashed after the error occured, in the crashpad file can see the callstack, and the FAILURE_BUCKET_ID is INVALID_POINTER_READ_c0000005_index.node!Unknown
3.Occured often in version 0.4.7 when mikro-orm doing some query(U/R), after upgrade to 0.5.1 seems never occured on my machine but occured in other user‘s machine. After multiple attempts, we still cannot reproduce the described behavior.
4.Using the enctyption with mikro-orm

driverOptions: {
        connection: {
            encryptionKey: CIPHER_KEY,
        },
    },

I have no way to fix it , but seems like libsql seems know something about the crash.
If need more information, tell me and i would show it in the issue (without some bussiness info)

Steps to Reproduce

Randomly and not sure would be fixed after we upgrade the libsql to v0.5.13


Error Logs

[Attach relevant logs or error messages. Anonymize sensitive data!]

!analyze -v
..*** WARNING: Unable to verify checksum for ntdll.dll
..............................................................
.................................
Loading unloaded module list
.
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Unable to verify timestamp for OUR_PRODUCT.exe
*** WARNING: Unable to verify checksum for USER32.dll
*** WARNING: Unable to verify checksum for ole32.dll
*** WARNING: Unable to verify checksum for twinapi.appcore.dll
*** WARNING: Unable to verify checksum for KERNELBASE.dll

KEY_VALUES_STRING: 1

    Key  : AV.Type
    Value: Read

    Key  : Analysis.CPU.mSec
    Value: 1968

    Key  : Analysis.Elapsed.mSec
    Value: 71320

    Key  : Analysis.IO.Other.Mb
    Value: 46

    Key  : Analysis.IO.Read.Mb
    Value: 1

    Key  : Analysis.IO.Write.Mb
    Value: 58

    Key  : Analysis.Init.CPU.mSec
    Value: 375

    Key  : Analysis.Init.Elapsed.mSec
    Value: 21882

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 113

    Key  : Analysis.Version.DbgEng
    Value: 10.0.27829.1001

    Key  : Analysis.Version.Description
    Value: 10.2503.24.01 amd64fre

    Key  : Analysis.Version.Ext
    Value: 1.2503.24.1

    Key  : Failure.Bucket
    Value: INVALID_POINTER_READ_c0000005_index.node!Unknown

    Key  : Failure.Exception.Code
    Value: 0xc0000005

    Key  : Failure.Exception.IP.Address
    Value: 0x7ffc5b71b494

    Key  : Failure.Exception.IP.Module
    Value: index

    Key  : Failure.Exception.IP.Offset
    Value: 0x5bb494

    Key  : Failure.Hash
    Value: {f00a8241-5ec5-b7e7-619a-1845d27c3309}

    Key  : Failure.ProblemClass.Primary
    Value: INVALID_POINTER_READ

    Key  : Timeline.Process.Start.DeltaSec
    Value: 308

    Key  : WER.Process.Version
    Value: 1.2.1.0


FILE_IN_CAB:  5b3c65a3-6d40-436d-b394-78fb16c9a723.dmp

NTGLOBALFLAG:  0

CONTEXT:  (.ecxr)
rax=0000000000000001 rbx=0000000000000008 rcx=0000025c879e63e0
rdx=0000000000000001 rsi=0000025c83dd9940 rdi=0000025c879e63e0
rip=00007ffc5b71b494 rsp=000000ce45ffcac0 rbp=0000000000000000
 r8=7ffffffffffffffc  r9=0000000000000009 r10=0000000000000000
r11=000000ce45ffc6f0 r12=000024bc00288178 r13=000024bc00160080
r14=0000000000000001 r15=000024bc00289ff0
iopl=0         nv up ei pl nz na pe nc
cs=0033  ss=0000  ds=0000  es=0000  fs=0053  gs=002b             efl=00010202
index!napi_register_module_v1+0x48d884:
00007ffc`5b71b494 0fb64171        movzx   eax,byte ptr [rcx+71h] ds:0000025c`879e6451=??
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ffc5b71b494 (index!napi_register_module_v1+0x000000000048d884)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 0000025c879e6451
Attempt to read from address 0000025c879e6451

PROCESS_NAME:  OUR PRODUCT.exe

READ_ADDRESS:  0000025c879e6451 

ERROR_CODE: (NTSTATUS) 0xc0000005 - 0x%p            0x%p                    %s

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000000

EXCEPTION_PARAMETER2:  0000025c879e6451

STACK_TEXT:  
000000ce`45ffcac0 00007ffc`5b460ff2     : 00000000`00000008 00000000`00000000 0000025c`83dd9940 ffffffff`ffffffff : index!napi_register_module_v1+0x48d884
000000ce`45ffcb00 00007ffc`5b5c3512     : 00000265`026c6c7d 00000265`026c6c7d 00000265`00ae3e00 00007ff6`0a265bd7 : index!napi_register_module_v1+0x1d33e2
000000ce`45ffcb40 00007ffc`5b1eae32     : 0000025c`879ae920 000000ce`45ffce90 000024bc`032dc8c0 00000265`00000000 : index!napi_register_module_v1+0x335902
000000ce`45ffcb80 00007ffc`5b1d1cd2     : 000024bc`00288100 00000000`00000000 000024bc`00289ff0 000024bc`00288190 : index+0x8ae32
000000ce`45ffcbb0 00007ff6`0a268f34     : 00000000`00000000 00000004`00000001 000000ce`00000001 000024bc`00288190 : index+0x71cd2
000000ce`45ffcd90 00000000`00000000     : 00000004`00000001 000000ce`00000001 000024bc`00288190 000024bc`000ae6f0 : OUR_PRODUCT+0x2fa8f34


STACK_COMMAND: ~0s; .ecxr ; kb

SYMBOL_NAME:  index+48d884

MODULE_NAME: index

IMAGE_NAME:  index.node

FAILURE_BUCKET_ID:  INVALID_POINTER_READ_c0000005_index.node!Unknown

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

FAILURE_ID_HASH:  {f00a8241-5ec5-b7e7-619a-1845d27c3309}

Followup:     MachineOwner
---------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions