alibaba / alibaba/DataX

sqlserverreader程序崩溃,数据类型datetime

Open
#664 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
17.4k
Forks
5.7k
PR merge metrics
No merged PRs in 30d

Description

sqlserverreader
数据抽到第900多行时候报错。(fetchsize默认1024,调小fetchsize没作用)
转换type:datetime 值:null

崩溃行:
CommonRdbmsReader
```
case Types.TIMESTAMP:
record.addColumn(new DateColumn(rs.getTimestamp(i)));
break;
```
可能出错的地方
```
/**
* 构建值为ts(java.sql.Timestamp)的DateColumn,使用Date子类型为DATETIME
* */
public DateColumn(final java.sql.Timestamp ts) {
this(ts == null ? null : ts.getTime());
this.setSubType(DateType.DATETIME);
}
``` /**
* 构建值为stamp(Unix时间戳)的DateColumn,使用Date子类型为DATETIME
* 实际存储有date改为long的ms,节省存储
* */
public DateColumn(final Long stamp) {
super(stamp, Column.Type.DATE, (null == stamp ? 0 : 8));
}
``
public Column(final Object object, final Type type, int byteSize) {
this.rawData = object;
this.type = type;
this.byteSize = byteSize;
}
``

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001096d03b1, pid=25240, tid=0x000000000001fe03
#
# JRE version: Java(TM) SE Runtime Environment (8.0_191-b12) (build 1.8.0_191-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.191-b12 mixed mode bsd-amd64 )
# Problematic frame:
# J 1726 C2 com.alibaba.datax.plugin.rdbms.reader.CommonRdbmsReader$Task.buildRecord(Lcom/alibaba/datax/common/plugin/RecordSender;Ljava/sql/ResultSet;Ljava/sql/ResultSetMetaData;ILjava/lang/String;Lcom/alibaba/datax/common/plugin/TaskPluginCollector;)Lcom/alibaba/datax/common/element/Record; (810 bytes) @ 0x00000001096d03b1 [0x00000001096cfee0+0x4d1]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#

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

Current thread (0x00007fa3d51f0000): JavaThread "0-0-0-reader" [_thread_in_Java, id=130563, stack(0x0000700005905000,0x0000700005a05000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000018

Registers:
RAX=0x0000000000000000, RBX=0x0000000000000000, RCX=0x0000000000000000, RDX=0x0000000000001d70
RSP=0x0000700005a044c0, RBP=0x000000014b3118a0, RSI=0x000000014805db38, RDI=0x00000000000020d4
R8 =0x0000000000000001, R9 =0x000000014808ec18, R10=0x0000001db5673e01, R11=0x0000000147f47140
R12=0x000000000000079f, R13=0x0000000000000011, R14=0x000000014805db38, R15=0x00007fa3d51f0000
RIP=0x00000001096d03b1, EFLAGS=0x0000000000010246, ERR=0x0000000000000004
TRAPNO=0x000000000000000e

Top of Stack: (sp=0x0000700005a044c0)
0x0000700005a044c0: 0000000165653c80 000000100000001c
0x0000700005a044d0: 0000000148099318 000000014b3118a0
0x0000700005a044e0: 000000014808ec18 0000000147f27ee0
0x0000700005a044f0: 000000014808ec18 0000000142d10118
0x0000700005a04500: 0000001100000024 000000014b30f200
0x0000700005a04510: 0000000000000000 000000014b30f220
0x0000700005a04520: 000000014b30f248 0000000000000001
0x0000700005a04530: 0000000000000001 0000000000029b07
0x0000700005a04540: 00007fa3d51f0000 000000000000011d
0x0000700005a04550: 0000000000000051 000000000000079f
0x0000700005a04560: 00000001656f8200 0000000165668f88
0x0000700005a04570: 0000000000000024 0000000148099318
0x0000700005a04580: 0000000142d10118 0000000147f27ee0
0x0000700005a04590: 0000700005a045d0 0000700005a045c0
0x0000700005a045a0: 0000000165668dd8 00000001475a5c58
0x0000700005a045b0: 000000014808ec18 00000001096cfef0
0x0000700005a045c0: 0000001db5673e01 0000000000000206
0x0000700005a045d0: 0000700005a04760 0000000109673704
0x0000700005a045e0: 00000001475a5850 0000000149e8bd08
0x0000700005a045f0: 0000000000000007 0000000109493be7
0x0000700005a04600: 0000700005a04668 0000000109095ce0
0x0000700005a04610: 0000000109095ce0 0000000000000433
0x0000700005a04620: 0000000000008652 0000700005a04628
0x0000700005a04630: 0000000165651ab3 0000700005a04688
0x0000700005a04640: 00000001656525d8 0000000165700fa0
0x0000700005a04650: 0000000165651af8 0000000000000000
0x0000700005a04660: 0000000148099318 000000014808ec18
0x0000700005a04670: 000000014b30e540 0000000147f27ee0
0x0000700005a04680: 00000001475a5c58 0000000100000024
0x0000700005a04690: 0000000142d10118 000000014b30e818
0x0000700005a046a0: 0000700005a046f0 00000001091c866c
0x0000700005a046b0: 0000700005a04700 00000001091c866c

Instructions: (pc=0x00000001096d03b1)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with CommonRdbmsReader$Task.buildRecord and the DateColumn constructors shown in the report. Reproduce the SQL Server extraction with a nullable datetime value near the reported 900th row, then inspect the JVM crash behavior around timestamp handling. Done means the reader completes extraction without the SIGSEGV while handling the reported null datetime.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.