avatar
n*a
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?
avatar
m*e
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?

avatar
n*a
3
Are you sure?
avatar
m*e
4
I think bug-free programs don't crash, no?

【在 n***a 的大作中提到】
: Are you sure?
avatar
n*a
5
But why my program runs fine at my local linux? If it crashes anywhere, then
there must be bug as you said.
avatar
p*u
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.

avatar
l*b
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?

avatar
u*u
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?

avatar
q*g
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?

avatar
l*b
10
memory leak won't cause segfault

【在 q*****g 的大作中提到】
: check if your program has memory leak
avatar
k*f
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?

avatar
n*a
12

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

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

You are right.

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

avatar
l*b
14
memory leak is silent. segfault is cause by illegal address access

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

avatar
p*u
15
use a debugger to figure out where the seg fault occurs.

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

avatar
P*f
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?

avatar
n*a
17

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

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

Thanks. 长知识呀。

【在 l*********b 的大作中提到】
: memory leak is silent. segfault is cause by illegal address access
avatar
t*t
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. 长知识呀。

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

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

avatar
n*a
21
Thanks a lot for all your kind help.
I will try and report here later.
avatar
g*c
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?

avatar
k*k
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.

avatar
m*t
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?

avatar
g*g
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.

avatar
n*a
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。