C++ Boost read_json 崩溃,我有 #define BOOST_SPIRIT_THREADSAFE

2023-12-31

最近其他人升级了我们的 boost 库,现在当 read_json 函数被大量调用时我会看到这个 coredump。以前从未见过这个。我在代码中有#define BOOST_SPIRIT_THREADSAFE,这就是为什么以前没有发生这种情况。真的需要帮助!谢谢!

程序因信号 11(分段错误)而终止。

    #0  0x00007f062ce0d094 in std::mem_fun1_t<int, boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >, boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> >*>::operator() (this=0x7f06120f4c90, __p=0x7f05f813faa0, __x=0x7f06120f4df0) at /usr/lib/gcc/x86_64-spcdn-linux-gnu/4.5.2/../../../../include/c++/4.5.2/bits/stl_function.h:605
            in /usr/lib/gcc/x86_64-spcdn-linux-gnu/4.5.2/../../../../include/c++/4.5.2/bits/stl_function.h
    #0  0x00007f062ce0d094 in std::mem_fun1_t<int, boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >, boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> >*>::operator() (this=0x7f06120f4c90, __p=0x7f05f813faa0, __x=0x7f06120f4df0) at /usr/lib/gcc/x86_64-spcdn-linux-gnu/4.5.2/../../../../include/c++/4.5.2/bits/stl_function.h:605
    #1  0x00007f062ce0c66e in std::binder2nd<std::mem_fun1_t<int, boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >, boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> >*> >::operator() (this=0x7f06120f4c90, __x=@0x7f06001446e0) at /usr/lib/gcc/x86_64-spcdn-linux-gnu/4.5.2/../../../../include/c++/4.5.2/backward/binders.h:154
    #2  0x00007f062ce0b87e in std::for_each<std::reverse_iterator<__gnu_cxx::__normal_iterator<boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >**, std::vector<boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >*, std::allocator<boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >*> > > >, std::binder2nd<std::mem_fun1_t<int, boost::spirit::classic::impl::grammar_helper_base<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > >, boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> >*> > > (__first=..., __last=..., __f=...) at /usr/lib/gcc/x86_64-spcdn-linux-gnu/4.5.2/../../../../include/c++/4.5.2/bits/stl_algo.h:4185
    #3  0x00007f062ce0aa88 in boost::spirit::classic::impl::grammar_destruct<boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> > > (self=0x7f06120f4df0) at /usr/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp:324
    #4  0x00007f062ce09c5f in boost::spirit::classic::grammar<boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::spirit::classic::parser_context<boost::spirit::classic::nil_t> >::~grammar (this=0x7f06120f4df0, __in_chrg=<optimized out>) at /usr/include/boost/spirit/home/classic/core/non_terminal/grammar.hpp:52
    #5  0x00007f062ce093f7 in boost::property_tree::json_parser::json_grammar<boost::property_tree::basic_ptree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::~json_grammar (this=0x7f06120f4df0, __in_chrg=<optimized out>) at /usr/include/boost/property_tree/detail/json_parser_read.hpp:162
    #6  0x00007f062ce0987f in boost::property_tree::json_parser::read_json_internal<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > > (stream=..., pt=..., filename="") at /usr/include/boost/property_tree/detail/json_parser_read.hpp:310
    #7  0x00007f062ce08eb6 in boost::property_tree::json_parser::read_json<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > > (stream=..., pt=...) at /usr/include/boost/property_tree/json_parser.hpp:45

在任何包含 json_parser.hpp 或 Spirit 的地方,都必须定义 BOOST_SPIRIT_THREADSAFE。全局定义它是最安全的,以防 boost/yourApp 的另一部分在您不知情的情况下使用 Spirit。

对于任何未定义的包含,Spirit 会烦人地在 Grammar.ipp 中创建一个静态变量,该变量将在所有 Spirit 实例之间共享。您的 Grammar_destruct 错误是因为 Spirit 在您的模块之一中缺少此定义。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

C++ Boost read_json 崩溃,我有 #define BOOST_SPIRIT_THREADSAFE 的相关文章

  • Web 客户端和 Expect100Continue

    使用 WebClient C NET 时设置 Expect100Continue 的最佳方法是什么 我有下面的代码 我仍然在标题中看到 100 continue 愚蠢的 apache 仍然抱怨 505 错误 string url http
  • 为什么两个不同的 Base64 字符串的转换会返回相等的字节数组?

    我想知道为什么从 base64 字符串转换会为不同的字符串返回相同的字节数组 const string s1 dg const string s2 dq byte a1 Convert FromBase64String s1 byte a2
  • 不支持将数据直接绑定到存储查询(DbSet、DbQuery、DbSqlQuery)

    正在编码视觉工作室2012并使用实体模型作为我的数据层 但是 当页面尝试加载时 上面提到的标题 我使用 Linq 语句的下拉控件往往会引发未处理的异常 下面是我的代码 using AdventureWorksEntities dw new
  • 类模板参数推导 - clang 和 gcc 不同

    下面的代码使用 gcc 编译 但不使用 clang 编译 https godbolt org z ttqGuL template
  • 从Web API同步调用外部api

    我需要从我的 Web API 2 控制器调用外部 api 类似于此处的要求 使用 HttpClient 从 Web API 操作调用外部 HTTP 服务 https stackoverflow com questions 13222998
  • OleDbDataAdapter 未填充所有行

    嘿 我正在使用 DataAdapter 读取 Excel 文件并用该数据填充数据表 这是我的查询和连接字符串 private string Query SELECT FROM Sheet1 private string ConnectStr
  • 在 ASP.NET 5 中使用 DI 调用构造函数时解决依赖关系

    Web 上似乎充斥着如何在 ASP NET 5 中使用 DI 的示例 但没有一个示例显示如何调用构造函数并解决依赖关系 以下只是众多案例之一 http social technet microsoft com wiki contents a
  • C++ OpenSSL 导出私钥

    到目前为止 我成功地使用了 SSL 但遇到了令人困惑的障碍 我生成了 RSA 密钥对 之前使用 PEM write bio RSAPrivateKey 来导出它们 然而 手册页声称该格式已经过时 实际上它看起来与通常的 PEM 格式不同 相
  • 创建链表而不将节点声明为指针

    我已经在谷歌和一些教科书上搜索了很长一段时间 我似乎无法理解为什么在构建链表时 节点需要是指针 例如 如果我有一个节点定义为 typedef struct Node int value struct Node next Node 为什么为了
  • 显示UnityWebRequest的进度

    我正在尝试使用下载 assetbundle统一网络请求 https docs unity3d com ScriptReference Networking UnityWebRequest GetAssetBundle html并显示进度 根
  • 如何在 Python 中追加到 JSON 文件?

    我有一个 JSON 文件 其中包含 67790 1 kwh 319 4 现在我创建一个字典a dict我需要将其附加到 JSON 文件中 我尝试了这段代码 with open DATA FILENAME a as f json obj js
  • 如何序列化/反序列化自定义数据集

    我有一个 winforms 应用程序 它使用强类型的自定义数据集来保存数据进行处理 它由数据库中的数据填充 我有一个用户控件 它接受任何自定义数据集并在数据网格中显示内容 这用于测试和调试 为了使控件可重用 我将自定义数据集视为普通的 Sy
  • 覆盖子类中的字段或属性

    我有一个抽象基类 我想声明一个字段或属性 该字段或属性在从该父类继承的每个类中具有不同的值 我想在基类中定义它 以便我可以在基类方法中引用它 例如覆盖 ToString 来表示 此对象的类型为 property field 我有三种方法可以
  • 链接器错误:已定义

    我尝试在 Microsoft Visual Studio 2012 中编译我的 Visual C 项目 使用 MFC 但出现以下错误 error LNK2005 void cdecl operator new unsigned int 2
  • 如何从两个不同的项目中获取文件夹的相对路径

    我有两个项目和一个共享库 用于从此文件夹加载图像 C MainProject Project1 Images 项目1的文件夹 C MainProject Project1 Files Bin x86 Debug 其中有project1 ex
  • 如何将带有 IP 地址的连接字符串放入 web.config 文件中?

    我们当前在 web config 文件中使用以下连接字符串 add name DBConnectionString connectionString Data Source ourServer Initial Catalog ourDB P
  • 基于 OpenCV 边缘的物体检测 C++

    我有一个应用程序 我必须检测场景中某些项目的存在 这些项目可以旋转并稍微缩放 更大或更小 我尝试过使用关键点检测器 但它们不够快且不够准确 因此 我决定首先使用 Canny 或更快的边缘检测算法 检测模板和搜索区域中的边缘 然后匹配边缘以查
  • 哪种 C 数据类型可以表示 40 位二进制数?

    我需要表示一个40位的二进制数 应该使用哪种 C 数据类型来处理这个问题 如果您使用的是 C99 或 C11 兼容编译器 则使用int least64 t以获得最大的兼容性 或者 如果您想要无符号类型 uint least64 t 这些都定
  • C++ 标准是否指定了编译器的 STL 实现细节?

    在写答案时this https stackoverflow com questions 30909296 can you put a pimpl class inside a vector我遇到了一个有趣的情况 这个问题演示了这样一种情况
  • 使用.NET技术录制屏幕视频[关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 有没有一种方法可以使用 NET 技术来录制屏幕 无论是桌面还是窗口 我的目标是免费的 我喜欢小型 低

随机推荐

  • Puppeteer 流程​​逻辑,检查导航是否发生(与等待)

    寻找一些反馈 在 Puppeteer 中 我想检查导航是否发生 如果发生则执行某些操作 否则如果未发生则执行其他操作 例如重试 我想出的两种方法是 if await page url finalURL let t 0 busy while
  • Selenium WebDriver Click() 在 IE9 中失败

    我看过很多其他类似的帖子 不幸的是无法解决这个问题 所以这里 我正在使用 Selenium WebDriver C 实现 版本 2 15 来驱动一个相当简单的网页 该页面包含一个表单 其中有两个用于用户名和密码的 以及一个用于提交表单的 我
  • 使用 tidyverse 和 broom 进行许多回归:相同的因变量,不同的自变量

    此链接显示了在我们具有相同的自变量但可能有许多不同的因变量的情况下如何回答我的问题 使用 broom 和 tidyverse 对不同的因变量进行回归 https stackoverflow com questions 51642146 us
  • Magento 2:重新索引不起作用

    我做不到重新索引 in 玛根托2 谷歌之后我得到了解决方案We can reindex with shell command php dev shell indexer php reindexall 但它给出了错误 Could not op
  • 无法使用 C# 客户端反序列化日期时间属性 Neo4j

    我正在尝试使用 C 客户端从 Neo4j 中获取强类型对象 这一切都有效 直到我添加DateTime财产 我已成功将数据插入 Neo4j 数据库 并且可以使用控制台查看它 我还可以查询数据 但无法返回任何强类型对象 因为反序列化似乎失败 我
  • Linux C++:如何跨多个文件正确使用模板专业化?

    我有一个奇怪的问题 在 Windows 上 使用 Visual Studio 2010 以及 Intel 编译器 一切都按预期链接 但是 当我尝试在 Linux 上使用 CLang 3 0 编译代码时 它会编译 如果我只使用单个 CPP 文
  • 如何测量 Android wifi 连接中的上传/下载速度和延迟

    我需要一些 api 或操作代码 通过它们我可以测量 android 应用程序的上传 下载速度和 wifi 连接的延迟 您使用的是 2 2 Froyo 或更高版本吗 如果是这样 请在您的应用程序中导入流量统计信息 并在您的应用程序使用互联网时
  • C# 数据绑定不更新 WPF

    我正在尝试在后面的 C 代码而不是 XAML 中进行数据绑定 在 Expression Blend 2 中创建的 XAML 绑定到我的 CLR 对象工作正常 我的 C 实现仅在应用程序启动时更新 之后对 CLR 的后续更改不会更新我的标签内
  • php 抓取并输出给定​​标签中的特定值或数字

    所以我对 php 很陌生 但在一些帮助下 我已经弄清楚如何抓取具有像 h1 class 这样的标签标识符的网站 更好的是 我已经弄清楚如何输出我想要的精确单词或值 只要它由空格分隔即可 例如 如果给定的标签名称 的输出为 30 个球 我可以
  • Android:当我在片段附近使用它时,在 runOnUiThread 附近出现错误

    我是 Android 开发新手 我想将按钮与动画链接起来 我在附近遇到错误runOnUiThread and getApplication 当我将其添加为一项活动时 这很好 但是当在MainFragment它给出了错误 但是 当我修复错误时
  • 如何在 Windows 中通过鼠标挂钩设置光标位置?

    我正在尝试创建一个小应用程序 它将检测鼠标光标何时移动到屏幕边缘并将其移动到相对的边缘 以创建连续的桌面效果 如果有意义的话 下面是其他人的一些代码 鼠标钩子部分 我通过添加 SetCursorPos 来将鼠标暂时移动到固定位置 当我运行它
  • 部署到 Lightsail 实例失败,因为找不到适合您的部署组的实例

    继自马西的回答 https stackoverflow com a 64170933 5675325 我继续尝试使用他提到的步骤 调整区域 从 GitHub 进行部署 但我得到了 部署失败 因为没有找到您的实例 部署组 检查您的部署组设置以
  • xamarin VisualStudio for ios 中没有附加设备

    当我尝试使用 Visual Studio 中的 IOS 模拟器时 我遇到了真正的麻烦 所以我使用xamarin 最新稳定版本 在VS中创建了一个hello world应用程序 我将项目设置为主项目 当我刷新与mac的连接时 我无法选择应该在
  • 如何为 HWIOAuthBundle 编写用户提供程序

    我想通过社交网络编写一个登录功能 如果用户未登录 则将其保存到数据库中 如果用户存在 则登录该用户 我应该在我的提供商中写入什么内容 文件状态 该捆绑包需要一个能够根据以下内容加载用户的服务 oauth 端点的用户响应 如果您有定制服务 应
  • 将 KeyEvent 对象列表转换为字符串

    我正在开发一个需要能够使用外部 USB 或蓝牙键盘楔的应用程序 然后 我捕获 KeyEvent 并根据需要缓存它们 开始 结束标记 因此 此时我有需要将其转换为字符串的 KeyEvent 列表 所以我需要将这些有序的 KeyEvent 转换
  • 使用 Ganglia 进行 Spark 监控

    我正在测试 Apache Spark 框架 我需要监视有关集群的某些方面 例如网络和资源 Ganglia 看起来是满足我需要的一个不错的选择 然后 我发现Spark支持Ganglia Spark监控网页上有这样的信息 要安装 Ganglia
  • 谷歌云功能美国中部时区?

    我想知道什么时区云函数代码会像 EST CST MST PST 这样运行 我部署了函数来获取它 但它返回了2018 12 05T17 54 00 207Z并且不应用任何美国时区 不是在美国运行吗 export const dateLog f
  • vb.net 从通配符获取文件名列表

    我有字符串 c debug txt 在 Debug 文件夹中有几个 txt 文件 例如 test1 txt test2 txt test3 txt 如何从此字符串 c debug txt 获取通配符文件数组 a 0 c debug test
  • 快速搜索排序向量中大于 x 的最小值

    快速意味着比 O N 更好 这与 find 的能力一样好 我知道有ismembc and ismembc2 但我认为它们都不是我正在寻找的 我阅读了文档 他们似乎正在寻找会员equal到 x 但我想要索引第一个值较大 than x 现在如果
  • C++ Boost read_json 崩溃,我有 #define BOOST_SPIRIT_THREADSAFE

    最近其他人升级了我们的 boost 库 现在当 read json 函数被大量调用时我会看到这个 coredump 以前从未见过这个 我在代码中有 define BOOST SPIRIT THREADSAFE 这就是为什么以前没有发生这种情