使用isql链接产生core文件

isql链接数据库产生core文件

  • 使用普通用户执行
bash 复制代码
[test@test ~]$ isql  -v freeswitch
Segmentation fault (core dumped)
  • 解析core文件
csharp 复制代码
[test@test~]$ gdb /bin/isql isql.core.122335 
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/isql...Reading symbols from /usr/bin/isql...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[New LWP 122335]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `isql -v freeswitch'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f1ae180edec in freelocale () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install unixODBC-2.3.1-14.el7.x86_64
(gdb) bt
#0  0x00007f1ae180edec in freelocale () from /lib64/libc.so.6
#1  0x00007f1ada501fe1 in myodbc_init() () from /usr/lib64/libmyodbc8a.so
#2  0x00007f1ada505afc in my_SQLAllocEnv(void**) () from /usr/lib64/libmyodbc8a.so
#3  0x00007f1ada506dff in SQLAllocHandle () from /usr/lib64/libmyodbc8a.so
#4  0x00007f1ae242b8c9 in __connect_part_one () from /lib64/libodbc.so.2
#5  0x00007f1ae242daf7 in SQLConnect () from /lib64/libodbc.so.2
#6  0x0000000000402809 in main ()
  • 使用root能正常链接isql
sql 复制代码
[root@test ~]# isql  -v freeswitch
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> show tables;
+-----------------------------------------------------------------+
| Tables_in_freeswitch                                            |
+-----------------------------------------------------------------+
| t_s_number                                                      |
| users                                                           |
+-----------------------------------------------------------------+
SQLRowCount returns 2
2 rows fetched

问题原因

  • root和普通用户区别: 新部署服务添加过环境变量有指定字符集
bash 复制代码
[root@test ~]# echo $LANG
en_US.UTF-8

[test@test ~]$ echo $LANG
zh_CN.GB1803

解决方法

  • 在网上查询ODBC 驱动或库的兼容性问题特别是 MySQL ODBC 驱动在处理 GB18030 时可能出现问题
  • 把指定的字符集设置为en_US.UTF-8即可。
相关推荐
tedcloud1233 小时前
UI-TARS-desktop部署教程:构建AI桌面自动化系统
服务器·前端·人工智能·ui·自动化·github
UXbot6 小时前
AI原型设计工具如何支持团队协作与快速迭代
前端·交互·个人开发·ai编程·原型模式
ZC跨境爬虫6 小时前
跟着MDN学HTML_day_48:(Node接口)
前端·javascript·ui·html·音视频
PieroPc8 小时前
CAMWATCH — 局域网摄像头监控系统 Fastapi + html
前端·python·html·fastapi·监控
巴巴博一9 小时前
2026 最新:Trae / Cursor 一键接入 taste-skill 完整教程(让 AI 前端告别“AI 味”)
前端·ai·ai编程
kyriewen9 小时前
半夜三点线上崩了,AI替我背了锅——用AI排错,五分钟定位三年老bug
前端·javascript·ai编程
kyriewen10 小时前
我让 AI 当了 24 小时全年无休的“毒舌考官”
前端·ci/cd·ai编程
hexu_blog10 小时前
vue+java实现图片批量压缩
java·前端·vue.js
IT_陈寒10 小时前
为什么你应该学习JavaScript?
前端·人工智能·后端
lifejump10 小时前
Empire(帝国)CMS 7.5 XSS注入
前端·安全·xss