sqlcxt() 导致分段错误

发布于 2024-08-13 08:52:12 字数 729 浏览 2 评论 0原文

让我们说明 sqlcxt() 可能导致分段错误的条件,我在 unix 上工作,使用 ProC 进行与 Oracle 数据库的数据库连接。

我的程序崩溃了,core文件显示崩溃是由于sqlcxt()函数导致

A loadobject was found with an unexpected checksum value.
See `help core mismatch' for details, and run `proc -map'
to see what checksum values were expected and found.

......

dbx: warning: Some symbolic information might be incorrect.

t@null (l@1) program terminated by signal SEGV

 (no mapping at the fault address)0xffffffffffffffff:     
<bad address 0xffffffffffffffff>
Current function is dbMatchConsortium
  442               **sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);**

Lets state the conditions where sqlcxt() can cause segmentation fault, I am woking on unix, using ProC for database connections to Oracle database.

My program crashes and the core file shows that the crash is due to the sqlcxt() function

A loadobject was found with an unexpected checksum value.
See `help core mismatch' for details, and run `proc -map'
to see what checksum values were expected and found.

...

dbx: warning: Some symbolic information might be incorrect.

...

t@null (l@1) program terminated by signal SEGV

 (no mapping at the fault address)0xffffffffffffffff:     
<bad address 0xffffffffffffffff>
Current function is dbMatchConsortium
  442               **sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);**

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

通知家属抬走 2024-08-20 08:52:12

您遇到的问题很可能是 C 代码中的某种指针错误/内存分配错误。这些东西从来都不容易找到。有些事情你可能会
尝试:

  1. 看看是否可以注释掉(或#ifdef)程序的某些部分,以及问题是否消失。如果是这样,那么您可以接近错误部分
  2. 在调试器中运行您的程序。
  3. 与其他人一起进行代码审查 - 这通常会导致发现多个问题(通常在我的代码中有效)。

我希望这会有所帮助。请添加更多详细信息,我会再检查一下这个问题,看看是否可以帮助您。

There is a decent chance that the problem you are having is some sort of pointer-error / memory allocation error in your C code. These things are never easy to find. Some things that you might
try:

  1. See if you can comment out (or #ifdef) out sections of your program and if the problem disappears. If so then you can close in on the bad section
  2. Run your program in a debugger.
  3. Do a code review with somebody else - this will often lead to finding more than one problem (Usually works in my code).

I hope that this helps. Please add more details and I will check back on this question and see if I can help you .

蘸点软妹酱 2024-08-20 08:52:12

这可能是您的程序中的分配错误。当我出现这种行为时,那总是我的错。我在 Solaris/SPARC 和 Oracle 10g 上进行开发。有一次是双重释放(即我两次释放同一个指针),第二次在程序的 Oracle 部分中有一个核心是当我释放一个不是分配的内存块的指针时。
如果您使用的是 Solaris,您可以尝试使用 libumem 分配库(通过 google 搜索了解详细信息)来查看行为是否发生变化。

It's probably an allocation error in your program. When I got this kind of behaviour it was always my fault. I develop on Solaris/SPARC and Oracle 10g. Once it was a double free (i.e. I freed the same pointer twice) and the second time I had a core in the Oracle part of the program was when I freed a pointer which was not an allocated memory block.
If you're on Solaris you can try the libumem allocation library (google it for details) to see if the behaviour change.

苍景流年 2024-08-20 08:52:12

对我有用的解决方案:删除 ProC & 创建的 c 文件make(recompile)

Pro c 文件(*.pc) 在 c 文件中进行“编译”/预处理,有时“编译”它们时可能会出现一些错误(在我的情况下,它没有剩余空间)并且即使构建成功,执行它们时我也会在 sqlcxt libclntsh.so 中收到 SIGSEGV 信号。

pstack &如果情况并非如此,gdb 可以帮助您进行调试。

A solution that worked for me: Delete the c files created by ProC & make(recompile)

Pro c files(*.pc) are 'compiled'/preprocessed in c files and sometimes when 'compiling' them some errors may occur (in my case it wasn't any more space left) and even if the build succeeds I would get a SIGSEGV signal in sqlcxt libclntsh.so when executing them.

pstack & gdb could help you for debugging if that's not the case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文