sqlcxt() 导致分段错误
让我们说明 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您遇到的问题很可能是 C 代码中的某种指针错误/内存分配错误。这些东西从来都不容易找到。有些事情你可能会
尝试:
我希望这会有所帮助。请添加更多详细信息,我会再检查一下这个问题,看看是否可以帮助您。
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:
I hope that this helps. Please add more details and I will check back on this question and see if I can help you .
这可能是您的程序中的分配错误。当我出现这种行为时,那总是我的错。我在 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.
对我有用的解决方案:删除 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.