惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
N
Netflix TechBlog - Medium
G
Google Developers Blog
L
LangChain Blog
腾讯CDC
大猫的无限游戏
大猫的无限游戏
U
Unit 42
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
The GitHub Blog
The GitHub Blog
博客园_首页
GbyAI
GbyAI

C++

小孩马上高一,但是想学信奥赛 c++,有什么学 c++的书推荐? 真是意想不到的操作:有好几个人一起协作向 C++库 fmtlib 加上了 C11 包装接口,确实能用 基于 C++20 协程编写 gRPC 客户端与服务端 似乎在 C 的领域,让一个新程序“为未来准备好”是一件很麻烦的事 请教各位 centos 7.9 通过 devtoolset 启用 c++14/17 时遇到的链接问题 求大佬指点:Windows 上 c++部署最新 Paddleocr,无法通过内存识字 为 c++ 提供模式匹配 分享一下我个人开源的 C++23 协程网络框架 为什么写 C++的人年龄偏大? 大型 c++项目,在 ai 帮助下完成 Linux 平台移植,可行性多大? 少用 auto 再一次感觉到 C++的恶心 分布式存储 [求助] Linux 有什么好的引入 c++ 第三方库的方案 [求助]请教一个 C++多线程的性能问题 2026 年找 C++的开发工作,应该学习 C++的哪个版本? 分布式系统 使用匿名结构体指针作为常量来杜绝魔数,是否合理/值得? 有没有什么工具可以统计 C++项目里标识符的使用情况? 看到一些 C++ 或者 C#项目 驼峰和下划线一块用,为啥泥? [求助] Linux 系统下动态库卸载后全局变量未重置的问题 交叉编译 asop android adb 最新版的问题 [有偿] 小白, Windows UI Automation TextPattern 检测问题求助 小白问个 vcpkg 相关的问题 记录一次踩坑过程(clion + cmake + vcpkg) 用智能指针管理 ffmpeg 中的数据结构是有必要的吗? 定位重载的插件或者 IDE 想系统的学习 Modern C++,麻烦大佬们推荐一些书籍 困扰几天的问题,这是被 gcc 优化了吗? 好的 c++代码是什么样的
c++调试遇到奇怪问题
hwdq0012 · 2025-04-10 · via C++
struct DV_COMMON_EXPORT product_config {


    int detect_delay_ms = 0;


    int reject_delay_ms = 0;

    int detect_count_oneshot = 1;
    int detect_count = 0;

    int detect_count_interval = 100;
    std::string ref_image_path = "1";

    int cam_x =2;
    int cam_y =3;


    // yuv420p",rgb888
    std::string rpicam_pixel_type = "yuv420p";

    int tmp =44;
};

调试时发现从第一个字符串往后,字段都没有正常初始化

(gdb) info line
Line 1021 of "/repos/dv_app_solution/prism_all/prism/include/prism/prismJson.hpp"
   starts at address 0x7fffeb60f470 <prism::json::fromJsonString<dv_common_config>(std::string const&&)+28>
   and ends at 0x7fffeb60f478 <prism::json::fromJsonString<dv_common_config>(std::string const&&)+36>.
(gdb) list
1016	
1017	template <class T>
1018	static inline std::unique_ptr<T> fromJsonString(const std::string&& str)
1019	{
1020	    std::unique_ptr<T> model = std::make_unique<T>();
1021	    privates::jsonType<T>::type::from_jsonStr(std::move(*model), std::move(str), 0, static_cast<int>(str.length() - 1));
1022	
1023	    return model;
1024	}
1025	template <class T>
(gdb) print *model
$9 = {detect_delay_ms = 0, reject_delay_ms = 0, detect_count_oneshot = 1, detect_count = 0, detect_count_interval = 100, ref_image_path = "", cam_x = 0, 
  cam_y = 0, rpicam_pixel_type = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, tmp = 796092265}
(gdb) 

程序会在后面的逻辑中,崩溃在使用 rpicam_pixel_type 这个字段的时候,用 asan 看了是由于这个错误的字符串被认为超过 10 个 T 导致崩溃 随便把它赋值给其他变量就会崩溃

没有思路,有什么方式进一进定位吗