由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Segmentation fault
相关主题
超牛的debugask for help about AMD cluster
有人用Boost.MPI吗?有人发现最近valgrind有问题么?
关于valgrind 的一个问题Strange problem with CGI (转载)
走了,你们慢聊问个C++ Segmentation Fault的问题
qsub callback questionsocket被block在accept的时候不能close……
dereference a NULL pointer in C[合集] C++,一个函数完成后出segmentaion fault
我写的这个C++错在哪里?如何区分read page fault 和 write page fault
我写的C++ ParallelForLoop,感兴趣的来下载测试C++ Segment Fault
相关话题的讨论汇总
话题: qsub话题: fault话题: pbs话题: your
进入Programming版参与讨论
1 (共1页)
n***a
发帖数: 1373
1
I have a C code wich is running totally fine at my local linux marchine.
But if I qsub it to PBS to run, PBS will terminate the program for "
Segmentation fault".
What could be the problem for that?
m*****e
发帖数: 4193
2
Bug?

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

n***a
发帖数: 1373
3
Are you sure?
m*****e
发帖数: 4193
4
I think bug-free programs don't crash, no?

【在 n***a 的大作中提到】
: Are you sure?
n***a
发帖数: 1373
5
But why my program runs fine at my local linux? If it crashes anywhere, then
there must be bug as you said.
p*u
发帖数: 2454
6
if it crashes everywhere, it's not a bug, it's an error.

then

【在 n***a 的大作中提到】
: But why my program runs fine at my local linux? If it crashes anywhere, then
: there must be bug as you said.

l*********b
发帖数: 8
7
check whether your machine and the target have same arch, same libc, etc..
recompile if necessary

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

u****u
发帖数: 229
8
pointer... I bet it's the pointer.

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

q*****g
发帖数: 72
9
check if your program has memory leak

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

l*********b
发帖数: 8
10
memory leak won't cause segfault

【在 q*****g 的大作中提到】
: check if your program has memory leak
相关主题
dereference a NULL pointer in Cask for help about AMD cluster
我写的这个C++错在哪里?有人发现最近valgrind有问题么?
我写的C++ ParallelForLoop,感兴趣的来下载测试Strange problem with CGI (转载)
进入Programming版参与讨论
k****f
发帖数: 3794
11
看看是不是用了什么文件或者库,

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

n***a
发帖数: 1373
12

Thanks for you all.
Won't memory leak cause segfault?

【在 l*********b 的大作中提到】
: memory leak won't cause segfault
n***a
发帖数: 1373
13

You are right.

【在 p*u 的大作中提到】
: if it crashes everywhere, it's not a bug, it's an error.
:
: then

l*********b
发帖数: 8
14
memory leak is silent. segfault is cause by illegal address access

【在 n***a 的大作中提到】
:
: You are right.

p*u
发帖数: 2454
15
use a debugger to figure out where the seg fault occurs.

【在 n***a 的大作中提到】
:
: You are right.

P*****f
发帖数: 2272
16
I assume you are working under a cluster production environment. Probably
there are some environment seting different from the testing node. If you
are running parallel program, you better use something like totalview to
debug it. But still hard to figure it out. I will suggest you login to the
remote machine when your job get scheduled, then runit as in a local machine
. That will be easier to debug

I have a C code wich is running totally fine at my local linux marchine.
But if I qsub it to PB

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

n***a
发帖数: 1373
17

It's a long time simulation. Almost impossible to debug.

【在 p*u 的大作中提到】
: use a debugger to figure out where the seg fault occurs.
n***a
发帖数: 1373
18

Thanks. 长知识呀。

【在 l*********b 的大作中提到】
: memory leak is silent. segfault is cause by illegal address access
t****t
发帖数: 6806
19
1. does it core dump at the beginning of running or after a while?
if after a while, it's probably not because of library and/or environment. i
assume you load your library and supporting files at the beginning; if not
then that's not the case.
2. if core dump after a while, a. make your program run on a smaller scale
and debug; b. compile with -g and -O0 so that at core dump, you can use the
core to debug (at least you know which line caused dump).

【在 n***a 的大作中提到】
:
: Thanks. 长知识呀。

k****f
发帖数: 3794
20
用valgrind看看有没有内存错误
把所有的valgrind找到的错误修改好,再去qsub

【在 n***a 的大作中提到】
:
: Thanks. 长知识呀。

相关主题
问个C++ Segmentation Fault的问题如何区分read page fault 和 write page fault
socket被block在accept的时候不能close……C++ Segment Fault
[合集] C++,一个函数完成后出segmentaion faultpython一问
进入Programming版参与讨论
n***a
发帖数: 1373
21
Thanks a lot for all your kind help.
I will try and report here later.
g****c
发帖数: 299
22
you may need to tell the qsub how much memory your code need. qsub will submit your job to the system have enough available memory. requirement of your code may pass the default limit of qsub setting.
in the qsub script file sth like
#!/bin/bash
#
#$ -cwd
#$ -j y
#$ -S /bin/bash
#
P4_GLOBMEMSIZE=300000000000
MPI_DIR=/opt/mpich/gnu
export P4_GLOBMEMSIZE
had better man qsub in your system.

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

k*k
发帖数: 508
23
at least it usually doesn't cause seg fault immediately..
and ur code works on local machine, memory leak causing crashing
doesn't make sense.

【在 n***a 的大作中提到】
: Thanks a lot for all your kind help.
: I will try and report here later.

m*********t
发帖数: 399
24
我猜想你的程序是用到了网络通讯收发package并且定义了 #pragma pack 1 的数据结
构。
Segment Fault 基本上都是因为你访问了非4-byte align的内存地址。
检查代码里有没有 #pragma pack 1 的数据结构定义,并且把某成员地址强行 cast 到
一个 int 指针。

【在 n***a 的大作中提到】
: I have a C code wich is running totally fine at my local linux marchine.
: But if I qsub it to PBS to run, PBS will terminate the program for "
: Segmentation fault".
: What could be the problem for that?

g*****g
发帖数: 34805
25
dangling pointer, array out of bound etc.
if it hanppens to point to a not in used area,
it's fine, otherwise...

then

【在 n***a 的大作中提到】
: But why my program runs fine at my local linux? If it crashes anywhere, then
: there must be bug as you said.

n***a
发帖数: 1373
26

I corrected something like delete [] and delete, while the seg fault still
happened. But less often. So I think there are other mem leaks in my program
. I will keep looking for them.
Thanks for all of you.

【在 g*****g 的大作中提到】
: dangling pointer, array out of bound etc.
: if it hanppens to point to a not in used area,
: it's fine, otherwise...
:
: then

1 (共1页)
进入Programming版参与讨论
相关主题
C++ Segment Faultqsub callback question
python一问dereference a NULL pointer in C
在线问一个qsub的问题。我写的这个C++错在哪里?
SGE qsub我写的C++ ParallelForLoop,感兴趣的来下载测试
超牛的debugask for help about AMD cluster
有人用Boost.MPI吗?有人发现最近valgrind有问题么?
关于valgrind 的一个问题Strange problem with CGI (转载)
走了,你们慢聊问个C++ Segmentation Fault的问题
相关话题的讨论汇总
话题: qsub话题: fault话题: pbs话题: your