Skip to content

Commit 24ea18b

Browse files
LINxianshengobdevfootka
authored
fix: crash caused by uninitialized discrete vector ptrs on Windows
* fix rpc error Co-authored-by: footka <672528926@qq.com> * fix: crash caused by uninitialized discrete vector ptrs on Windows Co-authored-by: LINxiansheng <LINxiansheng@users.noreply.github.com> --------- Co-authored-by: obdev <obdev@oceanbase.com> Co-authored-by: footka <672528926@qq.com> Co-authored-by: LINxiansheng <LINxiansheng@users.noreply.github.com>
1 parent 9ab315c commit 24ea18b

5 files changed

Lines changed: 18 additions & 32 deletions

File tree

src/share/stat/ob_dbms_stats_utils.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,12 @@ int ObDbmsStatsUtils::check_is_stat_table(share::schema::ObSchemaGetterGuard &sc
221221
if (OB_FAIL(check_is_sys_table(schema_guard, tenant_id, table_id, is_valid))) {
222222
LOG_WARN("failed to check is sys table", K(ret));
223223
}
224-
} else if (is_virtual_table(table_id)) {//check virtual table
224+
} else if (is_virtual_table(table_id)) {
225+
#ifdef _WIN32
226+
is_valid = false;
227+
#else
225228
is_valid = !is_no_stat_virtual_table(table_id);
229+
#endif
226230
} else if (OB_FAIL(schema_guard.get_table_schema(tenant_id, table_id, table_schema))) {
227231
LOG_WARN("failed to get table schema", K(ret), K(tenant_id), K(table_id));
228232
} else if (OB_ISNULL(table_schema) || OB_UNLIKELY(!table_schema->is_normal_schema())) {

src/share/vector/ob_discrete_base.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int ObDiscreteBase::to_rows(const sql::RowMeta &row_meta, sql::ObCompactRow **st
3232
if (OB_LIKELY(!is_collection_expr())) {
3333
for (int64_t i = 0; i < size; i++) {
3434
int64_t row_idx = selector[i];
35-
if (nulls_->at(row_idx)) {
35+
if (nulls_->at(row_idx) || OB_UNLIKELY(nullptr == ptrs_[row_idx])) {
3636
stored_rows[i]->set_null(row_meta, col_idx);
3737
} else {
3838
stored_rows[i]->set_cell_payload(row_meta, col_idx, ptrs_[row_idx], lens_[row_idx]);
@@ -51,7 +51,7 @@ int ObDiscreteBase::to_rows(const sql::RowMeta &row_meta, sql::ObCompactRow **st
5151
int ret = OB_SUCCESS;
5252
if (OB_LIKELY(!is_collection_expr())) {
5353
for (int64_t row_idx = 0; row_idx < size; row_idx++) {
54-
if (nulls_->at(row_idx)) {
54+
if (nulls_->at(row_idx) || OB_UNLIKELY(nullptr == ptrs_[row_idx])) {
5555
stored_rows[row_idx]->set_null(row_meta, col_idx);
5656
} else {
5757
stored_rows[row_idx]->set_cell_payload(row_meta, col_idx, ptrs_[row_idx], lens_[row_idx]);

src/sql/engine/basic/ob_chunk_datum_store.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,10 @@ static void assign_datums(const ObDatum **datums, const uint16_t selector[], con
13711371
ObDatum &dst = srow->cells()[col_idx];
13721372
dst.pack_ = src.pack_;
13731373
dst.ptr_ = reinterpret_cast<char *>(srow) + srow->row_size_;
1374-
if (!src.is_null()) {
1374+
if (!src.is_null() && OB_LIKELY(nullptr != src.ptr_)) {
13751375
T::assign_datum_value((void *)dst.ptr_, src.ptr_, src.len_);
1376+
} else if (OB_UNLIKELY(!src.is_null() && nullptr == src.ptr_)) {
1377+
dst.set_null();
13761378
}
13771379
srow->row_size_ += src.len_;
13781380
}

src/sql/engine/expr/ob_expr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,8 @@ int ObExpr::init_vector(ObEvalCtx &ctx,
10561056
int32_t *lens = get_discrete_vector_lens(ctx);
10571057
ObBitVector &nulls = get_nulls(ctx);
10581058
nulls.reset(size);
1059+
MEMSET(ptrs, 0, sizeof(char *) * size);
1060+
MEMSET(lens, 0, sizeof(int32_t) * size);
10591061
// for collection expr, we need reset ptr to frame, so that we can write collection cells
10601062
if (use_reserve_buf || is_nested_expr()) {
10611063
reset_discretes_ptr(ctx.frames_[frame_idx_], size, get_discrete_vector_ptrs(ctx));

tools/windows/installer/wix_launch_configurator.wxs

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@
1212
failed to link for some reason.
1313
-->
1414
<Fragment>
15-
<!-- Read the configurator exe path persisted to the registry during
16-
install. AppSearch runs early in every session (install, uninstall,
17-
repair) so the property is available when custom actions fire.
18-
This is critical for uninstall: the Directory-table default for
19-
INSTALL_ROOT may revert to the compile-time default, but this
20-
property always reflects the ACTUAL installed location. -->
21-
<Property Id="SEEKDB_CONFIGURATOR_EXE">
22-
<RegistrySearch Id="FindConfiguratorExe" Root="HKLM"
23-
Key="Software\SeekDB" Name="ConfiguratorExe" Type="raw" />
24-
</Property>
25-
2615
<!-- Wire the ExitDialog's Finish button to fire LaunchApplication
2716
when the checkbox is checked. WixUI shows the checkbox but
2817
does NOT include this Publish by default — we must add it.
@@ -33,34 +22,27 @@
3322
Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed" />
3423
</UI>
3524

36-
<!-- Type 34 custom action: fire-and-forget launch of Configurator (install).
37-
During install [INSTALL_ROOT] is always correctly resolved by the
38-
session, so Type 34 (Directory + ExeCommand) works fine here. -->
25+
<!-- Type 34 custom action: fire-and-forget launch of Configurator (install). -->
3926
<CustomAction Id="LaunchApplication"
4027
Directory="INSTALL_ROOT"
4128
ExeCommand="&quot;[INSTALL_ROOT]bin\seekdbConfigurator.exe&quot;"
4229
Execute="immediate"
4330
Return="asyncNoWait" />
4431

45-
<!-- Type 50 custom action: launch Configurator in remove mode (uninstall).
46-
Uses the SEEKDB_CONFIGURATOR_EXE property (populated from the
47-
registry by AppSearch) so the correct path is resolved even when
48-
the user chose a non-default install directory. Type 34 with
49-
Directory="INSTALL_ROOT" failed in that scenario because the
50-
directory property could revert to its default value during
51-
uninstall, pointing to a non-existent path.
32+
<!-- Type 34 custom action: launch Configurator in remove mode (uninstall).
33+
Runs synchronously so removal completes before MSI deletes files.
5234
Return="ignore" ensures uninstall proceeds even if user cancels. -->
5335
<CustomAction Id="RunConfiguratorRemove"
54-
Property="SEEKDB_CONFIGURATOR_EXE"
55-
ExeCommand="--remove"
36+
Directory="INSTALL_ROOT"
37+
ExeCommand="&quot;[INSTALL_ROOT]bin\seekdbConfigurator.exe&quot; --remove"
5638
Execute="immediate"
5739
Return="ignore" />
5840

5941
<!-- Schedule the removal configurator before files are deleted.
6042
Only runs on full uninstall (not upgrades). -->
6143
<InstallExecuteSequence>
6244
<Custom Action="RunConfiguratorRemove" Before="RemoveFiles"
63-
Condition="(REMOVE=&quot;ALL&quot;) AND (NOT UPGRADINGPRODUCTCODE) AND SEEKDB_CONFIGURATOR_EXE" />
45+
Condition="(REMOVE=&quot;ALL&quot;) AND (NOT UPGRADINGPRODUCTCODE)" />
6446
</InstallExecuteSequence>
6547

6648
<!-- Add bin/ to system PATH (cleanly removed on uninstall). -->
@@ -70,10 +52,6 @@
7052
Permanent="no" Part="last" Action="set" System="yes" />
7153
<RegistryValue Root="HKLM" Key="Software\SeekDB" Name="PathConfigured"
7254
Type="integer" Value="1" KeyPath="yes" />
73-
<RegistryValue Root="HKLM" Key="Software\SeekDB" Name="InstallRoot"
74-
Type="string" Value="[INSTALL_ROOT]" />
75-
<RegistryValue Root="HKLM" Key="Software\SeekDB" Name="ConfiguratorExe"
76-
Type="string" Value="[INSTALL_ROOT]bin\seekdbConfigurator.exe" />
7755
</Component>
7856
</DirectoryRef>
7957
</Fragment>

0 commit comments

Comments
 (0)