Fatal error EXCEPTION_ACCESS_VIOLATION

Hi there,
I’m getting the fatal error when running touch query and the DB will crash immediately. The query I’m running is a simple touch script:
SELECT touch(SELECT * FROM asset_price WHERE Date = '2020-01-01');
It first happened when I insert some new data and run the touch script.
May I know how to fix this issue?
QuestDB version: 8.2.2, Windows binary

Crash log (first half, full log exceeds post limit):

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000001e1af0f6e2f, pid=17144, tid=1892
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.13+11 (17.0.13+11) (build 17.0.13+11)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.13+11 (17.0.13+11, mixed mode, tiered, compressed oops, compressed class ptrs, parallel gc, windows-amd64)
# Problematic frame:
# J 1435 c2 sun.misc.Unsafe.getByte(J)B jdk.unsupported@17.0.13 (8 bytes) @ 0x000001e1af0f6e2f [0x000001e1af0f6e00+0x000000000000002f]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#

---------------  S U M M A R Y ------------

Command Line: -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:ErrorFile=E:\Investment\QuestDB\db\hs_err_pid+%p.log --module-path=E:\Investment\questdb-8.2.2-rt-windows-x86-64\bin\questdb.jar -Dcontainerized=false -Djdk.module.main=io.questdb io.questdb/io.questdb.ServerMain -d E:\Investment\QuestDB

Host: 12th Gen Intel(R) Core(TM) i7-12700, 20 cores, 63G,  Windows 11 , 64 bit Build 26100 (10.0.26100.3037)
Time: Thu Feb 27 21:21:31 2025 Malay Peninsula Standard Time elapsed time: 58.291010 seconds (0d 0h 0m 58s)

---------------  T H R E A D  ---------------

Current thread (0x000001e1e6230300):  JavaThread "shared_13" [_thread_in_Java, id=1892, stack(0x000000636dc00000,0x000000636dd00000)]

Stack: [0x000000636dc00000,0x000000636dd00000],  sp=0x000000636dcfe640,  free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x000001e1af0f6e2f

The last pc belongs to nmethod (printed below).

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000


Registers:
RAX=0x000001e1dc6e79b0, RBX=0x000001e1dc6e79b0, RCX=0x0000000404000040, RDX=0x0000000404000040
RSP=0x000000636dcfe640, RBP=0x000000636dcfe6c8, RSI=0x00000008001729b0, RDI=0x000001e1dd682640
R8 =0x0000000000000000, R9 =0x0000000000000020, R10=0x0000000000000000, R11=0x000001e1af0f6e20
R12=0x0000000000000000, R13=0x000000636dcfe668, R14=0x000000636dcfe730, R15=0x000001e1e6230300
RIP=0x000001e1af0f6e2f, EFLAGS=0x0000000000010202


Register to memory mapping:

RIP=0x000001e1af0f6e2f is at entry_point+47 in (nmethod*)0x000001e1af0f6c90
Compiled method (c2)   58295 1435       4       sun.misc.Unsafe::getByte (8 bytes)
 total in heap  [0x000001e1af0f6c90,0x000001e1af0f6ea8] = 536
 relocation     [0x000001e1af0f6de8,0x000001e1af0f6df8] = 16
 main code      [0x000001e1af0f6e00,0x000001e1af0f6e60] = 96
 stub code      [0x000001e1af0f6e60,0x000001e1af0f6e78] = 24
 scopes data    [0x000001e1af0f6e78,0x000001e1af0f6e80] = 8
 scopes pcs     [0x000001e1af0f6e80,0x000001e1af0f6ea0] = 32
 dependencies   [0x000001e1af0f6ea0,0x000001e1af0f6ea8] = 8
RAX={method} {0x000001e1dc6e79b8} 'getByte' '(J)B' in 'sun/misc/Unsafe'
RBX={method} {0x000001e1dc6e79b8} 'getByte' '(J)B' in 'sun/misc/Unsafe'
RCX=0x0000000404000040 is an oop: sun.misc.Unsafe 
{0x0000000404000040} - klass: 'sun/misc/Unsafe'
 - ---- fields (total size 2 words):
RDX=0x0000000404000040 is an oop: sun.misc.Unsafe 
{0x0000000404000040} - klass: 'sun/misc/Unsafe'
 - ---- fields (total size 2 words):
RSP=0x000000636dcfe640 is pointing into the stack for thread: 0x000001e1e6230300
RBP=0x000000636dcfe6c8 is pointing into the stack for thread: 0x000001e1e6230300
RSI=0x00000008001729b0 is a pointer to class: 
io.questdb.cairo.TableColumnMetadata {0x00000008001729b8}
 - instance size:     6
 - klass size:        87
 - access:            public synchronized 
 - state:             fully_initialized
 - name:              'io/questdb/cairo/TableColumnMetadata'
 - super:             'java/lang/Object'
 - sub:               'io/questdb/cairo/TableReaderMetadataColumn'   'io/questdb/cairo/TableWriterMetadata$WriterTableColumnMetadata'   
 - arrays:            NULL
 - methods:           Array<T>(0x000001e1dccb2030)
 - method ordering:   Array<T>(0x000001e1dc000018)
 - default_methods:   Array<T>(0x0000000000000000)
 - local interfaces:  Array<T>(0x000001e1dccb1f88)
 - trans. interfaces: Array<T>(0x000001e1dccb1f88)
 - constants:         constant pool [142] {0x000001e1dccb1a78} for 'io/questdb/cairo/TableColumnMetadata' cache=0x000001e1dccb3370
 - class loader data:  loader data: 0x000001e1e09c2c80 for instance a 'jdk/internal/loader/ClassLoaders$AppClassLoader'{0x0000000404531500}
 - source file:       'TableColumnMetadata.java'
 - class annotations:       Array<T>(0x0000000000000000)
 - class type annotations:  Array<T>(0x0000000000000000)
 - field annotations:       Array<T>(0x0000000000000000)
 - field type annotations:  Array<T>(0x0000000000000000)
 - inner classes:     Array<T>(0x000001e1dc000028)
 - nest members:     Array<T>(0x000001e1dc000028)
 - permitted subclasses:     Array<T>(0x000001e1dc000028)
 - java mirror:       a 'java/lang/Class'{0x000000040467a928} = 'io/questdb/cairo/TableColumnMetadata'
 - vtable length      24  (start addr: 0x0000000800172b78)
 - itable length      5 (start addr: 0x0000000800172c38)
 - ---- static fields (1 words):
 - static final synthetic '$assertionsDisabled' 'Z' @112 
 - ---- non-static fields (8 words):
 - private final 'replacingIndex' 'I' @12 
 - private final 'symbolCapacity' 'I' @16 
 - private final 'writerIndex' 'I' @20 
 - private 'columnType' 'I' @24 
 - private 'indexValueBlockCapacity' 'I' @28 
 - private final 'symbolTableStatic' 'Z' @32 
 - private 'dedupKeyFlag' 'Z' @33 
 - private 'symbolCacheFlag' 'Z' @34 
 - private 'symbolIndexFlag' 'Z' @35 
 - private final 'metadata' 'Lio/questdb/cairo/sql/RecordMetadata;' @36 
 - private 'columnName' 'Ljava/lang/String;' @40 
 - non-static oop maps: 36-40 
RDI=0x000001e1dd682640 is pointing into metadata
R8 =0x0 is NULL
R9 =0x0000000000000020 is an unknown value
R10=0x0 is NULL
R11=0x000001e1af0f6e20 is at entry_point+32 in (nmethod*)0x000001e1af0f6c90
Compiled method (c2)   58299 1435       4       sun.misc.Unsafe::getByte (8 bytes)
 total in heap  [0x000001e1af0f6c90,0x000001e1af0f6ea8] = 536
 relocation     [0x000001e1af0f6de8,0x000001e1af0f6df8] = 16
 main code      [0x000001e1af0f6e00,0x000001e1af0f6e60] = 96
 stub code      [0x000001e1af0f6e60,0x000001e1af0f6e78] = 24
 scopes data    [0x000001e1af0f6e78,0x000001e1af0f6e80] = 8
 scopes pcs     [0x000001e1af0f6e80,0x000001e1af0f6ea0] = 32
 dependencies   [0x000001e1af0f6ea0,0x000001e1af0f6ea8] = 8
R12=0x0 is NULL
R13=0x000000636dcfe668 is pointing into the stack for thread: 0x000001e1e6230300
R14=0x000000636dcfe730 is pointing into the stack for thread: 0x000001e1e6230300
R15=0x000001e1e6230300 is a thread


Top of Stack: (sp=0x000000636dcfe640)
0x000000636dcfe640:   3ff0000000000000 000001e1e6230300
0x000000636dcfe650:   000000636dcfe6c8 000001e1ae929634
0x000000636dcfe660:   000001e1ae929634 0000000000000000
0x000000636dcfe670:   0000000000000000 0000000404000040
0x000000636dcfe680:   000000636dcfe680 000001e1dd69502e
0x000000636dcfe690:   000000636dcfe730 000001e1dd695628
0x000000636dcfe6a0:   0000000000000000 00000006ad827770
0x000000636dcfe6b0:   000001e1dd6950b0 000000636dcfe668
0x000000636dcfe6c0:   000000636dcfe700 000000636dcfe798
0x000000636dcfe6d0:   000001e1ae9295ef 0000000000000000
0x000000636dcfe6e0:   0000000000000000 0000000000000000
0x000000636dcfe6f0:   0000000000000001 0000000000000000
0x000000636dcfe700:   0000000000000008 0000000000000000
0x000000636dcfe710:   0000000000000000 0000000000000000
0x000000636dcfe720:   0000000000010000 0000000000000000
0x000000636dcfe730:   00000006ad8279a8 000000000000000a
0x000000636dcfe740:   0000000000000000 00000006ad8279a8
0x000000636dcfe750:   000000636dcfe750 000001e1dd6951a0
0x000000636dcfe760:   000000636dcfe850 000001e1dd695628
0x000000636dcfe770:   0000000000000000 00000006ad827770
0x000000636dcfe780:   000001e1dd695360 000000636dcfe700
0x000000636dcfe790:   000000636dcfe850 000000636dcfe8a0
0x000000636dcfe7a0:   000001e1ae929520 0000000000000810
0x000000636dcfe7b0:   0000000000000000 000001e186980000
0x000000636dcfe7c0:   0000000000000000 0000000000010000
0x000000636dcfe7d0:   0000000000000000 000001e186970000
0x000000636dcfe7e0:   0000000000000000 00000006ad82af50
0x000000636dcfe7f0:   0000000000000000 0000000000000000
0x000000636dcfe800:   0000000000000008 0000000000000000
0x000000636dcfe810:   000000000000000b 000000000000000a
0x000000636dcfe820:   00000006ad81a0e8 00000006ad829388
0x000000636dcfe830:   00000006ad829278 00000006ad81b0e8 

Instructions: (pc=0x000001e1af0f6e2f)
0x000001e1af0f6d2f:   00 80 6e 0f af e1 01 00 00 80 6e 0f af e1 01 00
0x000001e1af0f6d3f:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6d4f:   00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6d5f:   00 00 00 00 00 00 00 00 00 00 6e 0f af e1 01 00
0x000001e1af0f6d6f:   00 20 6e 0f af e1 01 00 00 00 6e 0f af e1 01 00
0x000001e1af0f6d7f:   00 d0 01 00 00 ff ff ff ff 70 01 00 00 d0 01 00
0x000001e1af0f6d8f:   00 e8 01 00 00 e8 01 00 00 00 00 00 00 f0 01 00
0x000001e1af0f6d9f:   00 10 02 00 00 18 02 00 00 18 02 00 00 18 02 00
0x000001e1af0f6daf:   00 18 02 00 00 18 02 00 00 18 02 00 00 00 00 00
0x000001e1af0f6dbf:   00 9b 05 00 00 04 00 00 00 00 00 00 00 02 00 00
0x000001e1af0f6dcf:   00 00 00 00 00 00 00 00 00 df 01 00 00 02 00 00
0x000001e1af0f6ddf:   00 ff ff ff ff ff ff ff ff 14 60 24 b0 0e f0 0e
0x000001e1af0f6def:   80 11 64 09 00 00 64 0f 64 00 00 00 00 00 00 00
0x000001e1af0f6dff:   00 44 8b 52 08 49 bb 00 00 00 00 08 00 00 00 4d
0x000001e1af0f6e0f:   03 d3 49 3b c2 0f 85 66 9f 87 ff 66 90 0f 1f 40
0x000001e1af0f6e1f:   00 48 81 ec 18 00 00 00 48 89 6c 24 10 4d 8b d0
0x000001e1af0f6e2f:   41 0f be 02 48 83 c4 10 5d 49 3b a7 50 03 00 00
0x000001e1af0f6e3f:   0f 87 01 00 00 00 c3 49 ba 38 6e 0f af e1 01 00
0x000001e1af0f6e4f:   00 4d 89 97 68 03 00 00 e9 a4 08 88 ff f4 f4 f4
0x000001e1af0f6e5f:   f4 e9 9b 04 89 ff e8 00 00 00 00 48 83 2c 24 05
0x000001e1af0f6e6f:   e9 2c fb 87 ff f4 f4 f4 f4 ff 00 00 00 00 00 00
0x000001e1af0f6e7f:   00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6e8f:   00 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6e9f:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6eaf:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6ebf:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6ecf:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6edf:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6eef:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6eff:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6f0f:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000001e1af0f6f1f:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 


Stack slot to memory mapping:
stack at sp + 0 slots: 0x3ff0000000000000 is an unknown value
stack at sp + 1 slots: 0x000001e1e6230300 is a thread
stack at sp + 2 slots: 0x000000636dcfe6c8 is pointing into the stack for thread: 0x000001e1e6230300
stack at sp + 3 slots: 0x000001e1ae929634 is at code_begin+1428 in an Interpreter codelet
return entry points  [0x000001e1ae9290a0, 0x000001e1ae929c00]  2912 bytes
stack at sp + 4 slots: 0x000001e1ae929634 is at code_begin+1428 in an Interpreter codelet
return entry points  [0x000001e1ae9290a0, 0x000001e1ae929c00]  2912 bytes
stack at sp + 5 slots: 0x0 is NULL
stack at sp + 6 slots: 0x0 is NULL
stack at sp + 7 slots: 0x0000000404000040 is an oop: sun.misc.Unsafe 
{0x0000000404000040} - klass: 'sun/misc/Unsafe'
 - ---- fields (total size 2 words):


Compiled method (c2)   58304 1435       4       sun.misc.Unsafe::getByte (8 bytes)
 total in heap  [0x000001e1af0f6c90,0x000001e1af0f6ea8] = 536
 relocation     [0x000001e1af0f6de8,0x000001e1af0f6df8] = 16
 main code      [0x000001e1af0f6e00,0x000001e1af0f6e60] = 96
 stub code      [0x000001e1af0f6e60,0x000001e1af0f6e78] = 24
 scopes data    [0x000001e1af0f6e78,0x000001e1af0f6e80] = 8
 scopes pcs     [0x000001e1af0f6e80,0x000001e1af0f6ea0] = 32
 dependencies   [0x000001e1af0f6ea0,0x000001e1af0f6ea8] = 8

[Constant Pool (empty)]

[MachCode]
[Entry Point]
  # {method} {0x000001e1dc6e79b8} 'getByte' '(J)B' in 'sun/misc/Unsafe'
  # this:     rdx:rdx   = 'sun/misc/Unsafe'
  # parm0:    r8:r8     = long
  #           [sp+0x20]  (sp of caller)
  0x000001e1af0f6e00: 448b 5208 | 49bb 0000 | 0000 0800 | 0000 4d03 | d349 3bc2 

  0x000001e1af0f6e14: ;   {runtime_call ic_miss_stub}
  0x000001e1af0f6e14: 0f85 669f | 87ff 6690 | 0f1f 4000 
[Verified Entry Point]
  0x000001e1af0f6e20: 4881 ec18 | 0000 0048 | 896c 2410 | 4d8b d041 | 0fbe 0248 | 83c4 105d 

  0x000001e1af0f6e38: ;   {poll_return}
  0x000001e1af0f6e38: 493b a750 | 0300 000f | 8701 0000 

  0x000001e1af0f6e44: ;   {internal_word}
  0x000001e1af0f6e44: 00c3 49ba | 386e 0faf | e101 0000 | 4d89 9768 

  0x000001e1af0f6e54: ;   {runtime_call SafepointBlob}
  0x000001e1af0f6e54: 0300 00e9 | a408 88ff | f4f4 f4f4 

Hi @kuma ,

This looks like a possible corruption. Do you have the data for that day externally? It might be best to just drop the partition and reload the data.

The insertion data affects quite a lot of days. May I know what might be the cause of the corruption? Like any operations I need to be careful in the future.

Some risks for corruptions are these:

  • out of file handles or mmap areas
  • out of memory
  • out of disk
  • power loss

All of these should be avoided, especially if not running in sync mode.