c++ - 修复由于 OpenSSL 中的 SIGILL 而导致的崩溃

标签 c++ openssl mips openwrt

我在这里阅读了几个关于 OpenSSL 尝试不同指令来测试 cpu 是否支持它们的事实的问答,这会导致 SIGILL。但这些答案通常表明 OP 在 gdb 下运行应用程序,但我不是。因此,每当我调用 OpenSSL 库时,我在 OpenWrt MIPS 路由器上的应用程序实际上在使用 OpenSSL 时崩溃了。崩溃是非法指令。我实际上没有回溯,尽管我的应用程序是调试版本。它在 Ubuntu 和 MacOS 上运行良好。 我确保我的可执行文件和 ssl 库都具有相同的 cpu 架构。

cat/proc/cpuinfo 的结果:

system type             : Atheros AR9330 rev 1
machine                 : 8devices Carambola2 board
processor               : 0
cpu model               : MIPS 24Kc V7.4
BogoMIPS                : 265.42
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

让我担心的是,工具链 toolchain-mips_34kc_gcc-5.2.0_musl-1.1.11 在其名称中提到了 34kc。我想知道是否可以使用此工具链为 24 Kc cpu 构建。尽管除了 openssl 之外的其他一切都工作正常。

那么您能否回答我有哪些解决方案?

最佳答案

我不知道问题出在哪里,但该应用程序无法使用工具链中提供的 openssl 库并复制到目标板。当 libopenssl 通过 opkg 从官方 carambola2 存储库安装时,问题就消失了。所以它一定是有些不兼容。

关于c++ - 修复由于 OpenSSL 中的 SIGILL 而导致的崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39655787/

相关文章:

c++ - 使用 C 或 C++ 的数据结构?

arrays - 组装多个数组内存分配

c++ - 字符串没有针对字符串文字进行足够优化

objective-c - OpenSSL:打印 EC_POINT 的 X 和 Y

node.js - 如何在 Node.js 中重现 Bash HMAC 加密

php - get the key parameter is not a valid public key 错误在 openssl_public_encrypt()

makefile - OpenWRT 的 Elixir 包构建指南

MIPS:如果从同一寄存器加载指令,加载字是否会产生数据危险?

c++ - 通过引用修改单独函数中 Rcpp::List 的子部分

c++ - 是否可以为 boost::random::uniform_int_distribution<> 设置确定性种子?