已关闭
[Bug]: mysql_fdw 查询外表时 gaussdb 崩溃(MariaDB Connector/C 与 jemalloc 分配器混用) #332
liuzhen001创建于  5 天前关闭于  1 天前
liuzhen001
liuzhen001成员
5 天前 创建

测试类型

工具功能

测试版本

7.0.0LTS

问题描述

操作系统和硬件信息

openGauss:7.0.0 build 29918c91

  • 操作系统:openEuler 24.03 LTS
  • 架构:AArch64
  • MariaDB Connector/C:3.3.8
  • 集群:一主两备,端口 `58669

测试环境

企业版主备

被测功能

预置条件

操作步骤

openGauss 链接 jemalloc,并在主程序中导出 malloc/free。启用 RTLD_DEEPBIND 后,MariaDB Connector/C 内部出现分配器不一致:

  • 部分内存通过进程级 jemalloc 分配;

  • libmariadb 的直接 free 调用绑定到 glibc;

  • core 中 MYSQL::db 指针位于 openGauss 的 SYSV 内存区域,但最终传给 glibc free()

  • glibc 检测到无效指针后执行 abort(), 从而触发 invalid pointerSIGABRT

    SQL复制-- 复现 issue #1624

SELECT version();

SELECT fdwname,

fdwhandler,

fdwhandler::regprocedure,

fdwvalidator::regprocedure

FROM pg_foreign_data_wrapper

WHERE fdwname = 'mysql_fdw';

DROP SERVER IF EXISTS server_fdw_1624 CASCADE;

CREATE SERVER server_fdw_1624

FOREIGN DATA WRAPPER mysql_fdw

OPTIONS (host '20.20.20.212', port '3306', user 'ci_mysql', password 'hua@429*Test');

DROP FOREIGN TABLE IF EXISTS tab_fdw_1624;

CREATE FOREIGN TABLE tab_fdw_1624 (

col1 INT,

col2 VARCHAR(20)

)

SERVER server_fdw_1624

OPTIONS (dbname 'ci_db', table_name 'tab_fdw');

SELECT * FROM tab_fdw_1624;

预期输出

实际输出

image.png

日志信息

image.png

提单组织

测试团队

测试代码

likedislike
liuzhen001liuzhen001成员
5 天前 添加了label:bug
opengauss_bot
opengauss_bot成员
5 天前 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
5 天前 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
5 天前 添加了label:sig/StorageEngine
opengauss_bot
opengauss_bot成员
5 天前 评论:

Welcome To openGauss Community

Hey @liuzhen001 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: StorageEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zjh_hw .

likedislike
liuzhen001liuzhen001成员
5 天前 关联了看板:openGauss 7.0.0-LTS
zjj_sc
zjj_sc成员
5 天前 评论:

/assign

likedislike
opengauss_botopengauss_bot成员
5 天前 将 m0_57849461 设为负责人,移除负责人 TestManager
ywzq1161327784
ywzq1161327784成员
3 天前 评论:

20260912自验:
安装转测包
copy mysql_fdw相关的文件至openGauss对应目录

[douxin@openGauss62 B0912]$ find ./ -name "mysql_fdw*"
./lib/postgresql/mysql_fdw.so
./share/postgresql/extension/mysql_fdw--1.0--1.1.sql
./share/postgresql/extension/mysql_fdw--1.0.sql
./share/postgresql/extension/mysql_fdw--1.1.sql
./share/postgresql/extension/mysql_fdw.control

mysql信息:
(host '20.20.20.62', port '3376', user 'wzy1', password 'Huawei@123');
建表:

create database douxin;
use douxin;
CREATE TABLE tab_fdw (
col1 INT,
col2 VARCHAR(20)
);
insert into tab_fdw values(1, 'dx1'), (2, 'dx2');

image.png
openGauss B库用新的mysql_fdw.so
设置相关guc

gs_guc generate -S default -D $GAUSSHOME/bin -o usermapping

image.png

create extension mysql_fdw;
SELECT version();
SELECT fdwname,
fdwhandler,
fdwhandler::regprocedure,
fdwvalidator::regprocedure
FROM pg_foreign_data_wrapper
WHERE fdwname = 'mysql_fdw';

DROP SERVER IF EXISTS server_fdw_1624 CASCADE;
CREATE SERVER server_fdw_1624 FOREIGN DATA WRAPPER mysql_fdw OPTIONS (host '20.20.20.62', port '3376', user 'wzy1', password 'Huawei@123');
DROP FOREIGN TABLE IF EXISTS tab_fdw_1624;
CREATE FOREIGN TABLE tab_fdw_1624 (
col1 INT,
col2 VARCHAR(20)
)
SERVER server_fdw_1624
OPTIONS (dbname 'douxin', table_name 'tab_fdw');

SELECT * FROM tab_fdw_1624;

image.png
image.png

likedislike
ywzq1161327784ywzq1161327784成员
3 天前 issue状态由 待办的 改变为 待回归
zjj_sczjj_sc成员
1 天前 关联了pull request:[fix] mysql_fdw查询外表时 gaussdb 崩溃(MariaDB Connector/C 与 jemalloc 分配器混用)
liuzhen001
liuzhen001成员
1 天前 评论:

回归结论: 回归通过
回归版本:B022
回归记录:
image.png

likedislike
liuzhen001liuzhen001成员
1 天前 issue状态由 待回归 改变为 已验收
liuzhen001liuzhen001成员
1 天前 关闭了 issue