- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我的一个应用程序因 SIGBUS 信号而崩溃。以下是来自 gdb 的堆栈跟踪。基本上,dlopen 调用失败了。我正在运行 CentOS 6.3 64 位。
Program received signal SIGBUS, Bus error.
0x0000003cfc6175de in strcpy () from /lib64/ld-linux-x86-64.so.2
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.9.x86_64 libgcc-4.4.7-11.el6.x86_64 libstdc++-4.4.7-11.el6.x86_64
(gdb) bt
#0 0x0000003cfc6175de in strcpy () from /lib64/ld-linux-x86-64.so.2
#1 0x0000003cfc6090b2 in _dl_load_cache_lookup () from /lib64/ld-linux-x86-64.so.2
#2 0x0000003cfc608612 in _dl_map_object () from /lib64/ld-linux-x86-64.so.2
#3 0x0000003cfc612b05 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#4 0x0000003cfc60e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#5 0x0000003cfc6125aa in _dl_open () from /lib64/ld-linux-x86-64.so.2
#6 0x0000003cfca00f66 in dlopen_doit () from /lib64/libdl.so.2
#7 0x0000003cfc60e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8 0x0000003cfca0129c in _dlerror_run () from /lib64/libdl.so.2
#9 0x0000003cfca00ee1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#10 0x00000000004b4425 in my_open_dbus_func (f_name=0x558f2d "libdbus-glib-1.so.2")
我试着用这两行写了一个简单的程序,效果很好:
void * h = dlopen( "libdbus-glib-1.so.2", RTLD_LAZY );
dlclose( h );
我还尝试在 valgrind 下运行我原来的应用程序,它没有任何问题。
非常感谢任何帮助/指点。
最佳答案
尝试在dlopen
之后检查h
是否不为NULL。我可以假设 dlclose
可能会因作为参数给出的 NULL 指针而崩溃。
关于dlopen 崩溃(接收 SIGBUS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31544567/
我必须在 android 项目中使用 opencv。一切正常,直到我最近不得不使用 c++ exception_ptr。此后,使用std::rethrow_exception导致SIGBUS(信号SI
我的进程在同一台机器上的 2 个账户中运行良好,但是当我将进程复制到其他账户并运行进程时,我得到了核心转储。当我最后用 strace 运行这个过程时,我得到: --- SIGBUS (Bus erro
这个问题纯粹出于好奇;就我个人而言,我曾看到此信号被发出,但很少见。 我在 the C chatroom 上问过是否有可靠的方法来重现它。在这个房间里,user @Antti Haapala找到一个。
这是我写的示例代码。 #include #include #include #include #include int main() { int fd; long pages
我尝试使用 iText 5.5.0 和文档示例进行签名: private static void pdfSign(String srcFile, String dstFile) throws Exce
我的应用在 iPhone 4 iOS 7.1.3 上崩溃。在 iOS 9 和 iP6 上一切正常。 这是由使用两种泛型类型实例化相当复杂的泛型类引起的。 我可以提供有关实现的详细信息,但该类有数百行。
我的程序最近因以下堆栈而崩溃; Program terminated with signal 7, Bus error. #0 0x00007f0f323beb55 in raise () from
我的调用堆栈显示如下: --- called from signal handler with signal 10 (SIGBUS) --- 001301b8 allocate__t24__def
我的 Android 应用程序在以下代码段的第 4 行报告 SIGBUS 错误(这是一个函数序言): MOV R12, SP STMFD SP!, {R4-R12,LR,PC} SUB R11, R1
在 objective-c 中将自定义对象添加到 mutableArray 时出现内存 SIGBUS 错误。 @interface stak : NSObject { NSString *id
编辑 1:示例程序的平台是 x86_64。 编辑 2: 我正在编辑它以便更好地理解。下面是两个不同的问题。第一个问题是无效的读/写会导致 SIGBUS 吗?第二个问题是 Valgrind 对 SIGB
我目前正在开展一个项目,该项目运行在经过大量修改的 Linux 版本上,该版本已打补丁以能够访问 VMEbus。大部分总线处理已完成,我有一个 VMEAccess 类,它使用 mmap 写入/dev/
我试图在只读内存上捕获错误但无法捕获?如果我处理了错误,那么它的程序可以继续,或者只有选项是退出/中止? #include #include #include #include #include
我想为内存映射文件 io 编写一个包装器,它要么无法映射文件,要么返回一个在取消映射之前有效的映射。使用普通 mmap 时,如果底层文件在映射时被截断或删除,就会出现问题。根据 mmap 的 linu
那是在堆栈跟踪中,我不明白这个错误: 0 CoreFoundation 0x30f57648 ___CFBasicHashFindBucket_Linear_NoCollision + 92
我正在尝试通过映射一个 1 MiB 文件(与 RAM 大小相对应)来为基本 CPU 建模。我想读/写这个文件。目前,我收到 ram[2] = 1 的 SIGBUS 错误,我收集到这是由于尝试在文件范围
我的子进程正在尝试访问 PCI 地址空间。它在大多数时候都运行良好。 但是,有时子进程会进入僵尸状态。 dmesg 日志显示以下总线错误。 [ 501.134156] Caused by (from
我的一个应用程序因 SIGBUS 信号而崩溃。以下是来自 gdb 的堆栈跟踪。基本上,dlopen 调用失败了。我正在运行 CentOS 6.3 64 位。 Program received sign
以下从教程网站获取的基本 SDL2 代码引起了一些奇怪的问题: #include #include #include #include #define SCREENH 768 #define
我无法用以下汇编代码产生“总线错误”。这里我使用的内存地址不是合法的“规范地址”。那么,我该如何触发该错误? 我在带有 NASM 2.14.02 的 Ubuntu 20.04 LTS 下运行这段代码,
我是一名优秀的程序员,十分优秀!