c++ - Call to operator new results in segmentation fault in MPI code -


so following line in mpi code results in segfault:

mya = new double[nummyelements*numrows]; 

, nummyelements , numrows both int -s , none of them garbage. in test runs nummyelements*numrows = 235074 . line of code above gets called in constructor object , double* mya member of class. using:

g++ (ubuntu/linaro 4.6.3-1ubuntu5) 4.6.3 , mpirun (open mpi) 1.4.3

for running program 1 processor i.e.

mpirun -np 1 ./program 

on laptop.

the exact error following:

[user:03753] *** process received signal *** [user:03753] signal: segmentation fault (11) [user:03753] signal code:  (128) [user:03753] failing @ address: (nil) 

after code hangs , have abort manually. don't think i'm running out of heap since when looking @ processes through top program uses 2.1% of memory.

however! interestingly enough if decrease size i.e. replace nummyelements*numrows small constant 10 or 100 don't error. can't go higher 1000.

mya = new double[1000]; 

would result in same error again.

just in case ulimit -a output:

core file size          (blocks, -c) 0 data seg size           (kbytes, -d) unlimited scheduling priority             (-e) 0 file size               (blocks, -f) unlimited pending signals                 (-i) 31438 max locked memory       (kbytes, -l) 64 max memory size         (kbytes, -m) unlimited open files                      (-n) 1024 pipe size            (512 bytes, -p) 8 posix message queues     (bytes, -q) 819200 real-time priority              (-r) 0 stack size              (kbytes, -s) 8192 cpu time               (seconds, -t) unlimited max user processes              (-u) 31438 virtual memory          (kbytes, -v) unlimited file locks                      (-x) unlimited 

does know going on here? thanks!

as mentioned in comments, turns out issue of incorrect array indexing unrelated error popped up. comments!


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -