在使用c++多线程使用libcurl抓取网页时,遇到程序随机core掉的情况,gdb 一下出错信息有这么一条:longjmp causes uninitialized stack frame。

在网上查了一下原来是curl有“CURLOPT_NOSIGNAL” ,将这个值设为1就忽略抛出的信号了~

具体解释:

CURLOPT_NOSIGNAL

Pass a long. If it is 1, libcurl will not use any functions that install signal handlers or any functions that cause signals to be sent to the process. This option is mainly here to allow multi-threaded unix applications to still set/use all timeout options etc, without risking getting signals. The default value for this parameter is 0. (Added in 7.10)

If this option is set and libcurl has been built with the standard name resolver, timeouts will not occur while the name resolve takes place. Consider building libcurl with c-ares support to enable asynchronous DNS lookups, which enables nice timeouts for name resolves without signals.

Setting CURLOPT_NOSIGNAL to 1 makes libcurl NOT ask the system to ignore SIGPIPE signals, which otherwise are sent by the system when trying to send data to a socket which is closed in the other end. libcurl makes an effort to never cause such SIGPIPEs to trigger, but some operating systems have no way to avoid them and even on those that have there are some corner cases when they may still happen, contrary to our desire. In addition, using CURLAUTH_NTLM_WB authentication could cause a

curl raise 信号出core的更多相关文章

  1. linux 出core设置问题

    我所在的环境是RedHat 1.第一步 修改/etc/security/limits.conf添加一行 user为生效的用户 user hard core unlimited 2.第二步 在普通用户的 ...

  2. std::sort运行出core(segment fault)

    http://note.youdao.com/noteshare?id=6aae09345e85ab55fe24ac959118a747

  3. [linux basic]基础--信号

    线程->信号信号,是unix和linux系统响应某些条件而产生的一个事件.接收到该信号的进程会相应地采取一些行动.raise生成表示一个信号的产生catch捕获表示接受到一个信号的产生:信号是由 ...

  4. 第8章 信号(1)_Linux信号处理机制

    1. 信号的基本概念 1.1 基本概念 (1)信号(signal)机制是linux系统中最为古老的进程之间的通信机制,解决进程在正常运行过程中被中断的问题,导致进程的处理流程会发生变化. (2)信号本 ...

  5. apue学习笔记(第十章 信号)

    本章先对信号机制进行综述,并说明每种信号的一般用法. 信号概念 每个信号都有一个名字,这些名字都以3个字符SIG开头.在头文件<signal.h>中,信号名都被定义为正整形常量. 在某个信 ...

  6. 《Unix环境高级编程》读书笔记 第10章-信号

    1.引言 信号是软件中断. 信号提供了一种处理异步事件的方法. 2. 信号概念 信号的名字都是以3个字符SIG开头. Linux3.2.0支持31种信号.FreeBSD.Linux和Solaris作为 ...

  7. Linux之信号

    产生信号五种方法: 按键产生:ctrl+c.ctrl+z.ctrl+\ 系统调用产生:如kill.raise.baort 软件条件产生:如定时器alarm 硬件异常产生:非法访问内存(段错误).除0( ...

  8. linux系统编程--信号

    信号的概念 man 7 siganl  查看man手册 信号在我们的生活中随处可见, 如:古代战争中摔杯为号:现代战争中的信号弹:体育比赛中使用的信号枪......他们都有共性:1. 简单 2. 不能 ...

  9. C和指针 第十六章 标准函数库 信号

    信号名<signal.h> 程序中大多数错误都是程序本身导致的,但是,有些程序遇到的事件却不是程序本身所引发的.比如用户终止程序,程序无法预知此类事件发生的情况,信号就是为了对此类事件做出 ...

随机推荐

  1. Mysql子查询IN中使用LIMIT

    学习下Mysql子查询IN中使用LIMIT的方法. 这两天项目里出了一个问题,mysql LIMIT使用后报错. 需求是这样的,我有3张表,infor信息表,mconfig物料配置表,maaply物料 ...

  2. U-BOOT配置过程

    摘自:<嵌入式Linux应用开发完全手册> ( Target  :         smdk2410              $1 Architecture:     arm       ...

  3. 初学者学习javascript语言应注意的那几点

    javascript在书写时应注意得那四点: 1)大小写敏感: 2)javascript是弱类型语言,声明变量是应全部使用var(因为javascript是弱类型语言): 3)字符串在定义时使用单引号 ...

  4. #技塑人生# windows2008无法远程— 注册表缺失键值导致高级防火墙服务异常

    windows2008无法远程— 注册表缺失键值导致高级防火墙服务异常 阿里云技术支持中心:章阿贵 一.远程无法访问(windows server 2008) 症状:无法远程但是系统内网络正常,防火墙 ...

  5. Debian 8 安装 Nvidia 显卡驱动

    sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-dkms 正在读取软件包列表.. ...

  6. python 基础——常用功能片段

    1. 元素去重 data = [1,2,3,4,4,5,5,6] res = set(data) 2. 元素去重排序 res = sorted(set(data)) 2. 打印重复的元素 res = ...

  7. 20145102 《Java程序设计》第2周学习总结

    20145102 <Java程序设计>第2周学习总结 教材学习内容总结 这章先介绍了基本类型,和其他语言相似,分为short整数(2字节).int整数(4字节).long整数(8字节).f ...

  8. POJ 2031 Building a Space Station (最小生成树)

    Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5173   Accepte ...

  9. 2013 长沙网络赛J题

    思路:这题对于其他能退出所有值的情况比较好像,唯一不能确定的是XXOXXOXXOXX这个形式的序列,其中XX表示未知,O表示已知. 我们令num[1]=0,那么num[4]=sum[3]-sum[2] ...

  10. poj 3728 The merchant 倍增lca求dp

    题目: zdf给出的题目翻译: 从前有一个富饶的国度,在这里人们可以进行自由的交易.这个国度形成一个n个点的无向图,每个点表示一个城市,并且有一个权值w[i],表示这个城市出售或收购这个权值的物品.又 ...