由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 超牛的debug
相关主题
Segmentation faultpurify和valgrind的比较
有人用Boost.MPI吗?Valgrind报uninitialized value was created by a heap allocat (转载)
走了,你们慢聊c里面有什么函数可以
any good open source memory pool for Cmalloc返回的地址指向了正在被其它变量使用的内存
c ptr questionC 语言,初学者问题(3)
我写的这个C++错在哪里?关于valgrind 的一个问题
ask for help about AMD clusterC++动态内存碎片问题
a question about memory.Heap corruption (转载)
相关话题的讨论汇总
话题: malloc话题: segfault话题: filename话题: memory
进入Programming版参与讨论
1 (共1页)
c******n
发帖数: 4965
1
又一个衰人写的程序, 要拿来用,
出segfault
我就拼命查,
gdb where 出来看居然事malloc() 自己segfault
library 怎么会出错那???
幸好有另外一个地方出绰,一个文件名最后的一个子母
编成乱码了,
怎么会这样呢? 就在程序里加了一个全程变量,
进入,stop,
set my_new_var=changed_char_of_filename
然后watch my_new_var
结果是那个malloc() 开到了filename 上了,
再一看,这个衰人给filename 最开始malloc() 的地方缺\000
ft to death
then afterwards, got another strange segfault with malloc()
this time I have not idea who was writing into unallocated space,
so I had to use valgrind,
it was pretty cool, turns out it was the same stupid err
c********e
发帖数: 383
2
u mean he malloced one char less then needed?

【在 c******n 的大作中提到】
: 又一个衰人写的程序, 要拿来用,
: 出segfault
: 我就拼命查,
: gdb where 出来看居然事malloc() 自己segfault
: library 怎么会出错那???
: 幸好有另外一个地方出绰,一个文件名最后的一个子母
: 编成乱码了,
: 怎么会这样呢? 就在程序里加了一个全程变量,
: 进入,stop,
: set my_new_var=changed_char_of_filename

s*******b
发帖数: 106
3
malloc won't give Segmentation fault?
I debugged a program just recently. That program gave segmentation fault
shortly after start. Finally, I tracked down to 1 MALLOC call. That MALLOC is
inside a loop. When that malloc is called the 4th time, I got a segmentation
fault. By the way, that program uses lots of memory when it starts, like
server hundred MBs. And that Linux box doesn't have a lot of memory on it.
After I killed everything I can on that box to get more memory out of it, the
segmenat

【在 c******n 的大作中提到】
: 又一个衰人写的程序, 要拿来用,
: 出segfault
: 我就拼命查,
: gdb where 出来看居然事malloc() 自己segfault
: library 怎么会出错那???
: 幸好有另外一个地方出绰,一个文件名最后的一个子母
: 编成乱码了,
: 怎么会这样呢? 就在程序里加了一个全程变量,
: 进入,stop,
: set my_new_var=changed_char_of_filename

a**a
发帖数: 416
4
Must be some memory corrupted.

【在 s*******b 的大作中提到】
: malloc won't give Segmentation fault?
: I debugged a program just recently. That program gave segmentation fault
: shortly after start. Finally, I tracked down to 1 MALLOC call. That MALLOC is
: inside a loop. When that malloc is called the 4th time, I got a segmentation
: fault. By the way, that program uses lots of memory when it starts, like
: server hundred MBs. And that Linux box doesn't have a lot of memory on it.
: After I killed everything I can on that box to get more memory out of it, the
: segmenat

s*******b
发帖数: 106
5
I thought that myself. But it's still during that program's start-up process.
That program hasn't done anything real yet. It's still trying to set up
everything needed to run. Memory corrupted already during start up? Hmm... I
hope not....

is
segmentation
the

【在 a**a 的大作中提到】
: Must be some memory corrupted.
l*****t
发帖数: 2019
6
偶滴神呀,幸亏改行不用写这种东东

【在 c******n 的大作中提到】
: 又一个衰人写的程序, 要拿来用,
: 出segfault
: 我就拼命查,
: gdb where 出来看居然事malloc() 自己segfault
: library 怎么会出错那???
: 幸好有另外一个地方出绰,一个文件名最后的一个子母
: 编成乱码了,
: 怎么会这样呢? 就在程序里加了一个全程变量,
: 进入,stop,
: set my_new_var=changed_char_of_filename

f******y
发帖数: 2971
7
很可能是机器内存不足啊,你自己已经说了。
可以用new,再handle exception。

process.
I

【在 s*******b 的大作中提到】
: I thought that myself. But it's still during that program's start-up process.
: That program hasn't done anything real yet. It's still trying to set up
: everything needed to run. Memory corrupted already during start up? Hmm... I
: hope not....
:
: is
: segmentation
: the

1 (共1页)
进入Programming版参与讨论
相关主题
Heap corruption (转载)c ptr question
gdb with big core file我写的这个C++错在哪里?
关于SELinux (转载)ask for help about AMD cluster
dereference a NULL pointer in Ca question about memory.
Segmentation faultpurify和valgrind的比较
有人用Boost.MPI吗?Valgrind报uninitialized value was created by a heap allocat (转载)
走了,你们慢聊c里面有什么函数可以
any good open source memory pool for Cmalloc返回的地址指向了正在被其它变量使用的内存
相关话题的讨论汇总
话题: malloc话题: segfault话题: filename话题: memory