GridGraph icon indicating copy to clipboard operation
GridGraph copied to clipboard

Segmentation fault when running any of the example programs

Open tonyfleck76 opened this issue 8 years ago • 10 comments

Specifically, I am trying to run bfs on the LiveJournal graph provided as the example. I successfully got the graph preprocessed, but running ./bin/bfs /LiveJournal_Grid 0 8 breaks. When I run it with GDB, I get this error message:

Program received signal SIGSEGV, Segmentation fault. _IO_vfscanf_internal (s=0x0, format=0x406b7d "%d %d %ld %d", argptr=argptr@entry=0x7fffffffd2e8, errp=errp@entry=0x0) at vfscanf.c:347 347 vfscanf.c: No such file or directory.

Am I doing something wrong when running the program or is there an issue with the way it compiled?

tonyfleck76 avatar Jul 13 '16 16:07 tonyfleck76

Hi @tonyfleck76 , can you provide me the detailed commands you used including preprocessing?

coolerzxw avatar Jul 14 '16 01:07 coolerzxw

Well, I first ran it on the graph downloaded from the link provided in the README. I then ran

./bin/preprocess -i /data/LiveJournal -o /data/LiveJournal_Grid -v 4847571 -p 4 -t 0

on it and got an error. When I looked at the issues I saw the other open one had some code to convert the LiveJournal file into binary form. I ran it through that and then ran the same prepocessing command. That appeared to have worked and gave me the LiveJournal_Grid directory that I have been passing as an argument to the bfs program.

tonyfleck76 avatar Jul 14 '16 16:07 tonyfleck76

Well, the preprocessed files are located at "/data/LiveJournal_Grid", but it seems that you passed "/LiveJournal_Grid" to the bfs program. Is this the problem (i.e. so fscanf failed to get content from the file)?

coolerzxw avatar Jul 15 '16 01:07 coolerzxw

Unfortunately that is not it. Sorry, I should have changed that to show that I did not create a data directory. LiveJournal_Grid is in the main GridGraph directory.

tonyfleck76 avatar Jul 15 '16 14:07 tonyfleck76

What does the LiveJournal_Grid folder look like (e.g. sizes of the files under the folder) ?

coolerzxw avatar Jul 18 '16 01:07 coolerzxw

ls LiveJournal_Grid/ block-0-0 block-1-0 block-2-0 block-3-0 column parent block-0-1 block-1-1 block-2-1 block-3-1 column_offset row block-0-2 block-1-2 block-2-2 block-3-2 degree row_offset block-0-3 block-1-3 block-2-3 block-3-3 meta

Also, I worked out the segfault issue, but get this error instead.

GridGraph/core/bigvector.hpp:89: void BigVector<T>::init(std::__cxx11::string, size_t) [with T = int; std::__cxx11::string = std::__cxx11::basic_string<char>; size_t = long unsigned int]: Assertion 'fd!= -1' failed. Aborted (core dumped)

tonyfleck76 avatar Jul 18 '16 16:07 tonyfleck76

-rw-r--r-- 1 tony tony 269334576 Jul 13 10:56 block-0-0
-rw-r--r-- 1 tony tony  51552688 Jul 13 10:56 block-0-1
-rw-r--r-- 1 tony tony  19681928 Jul 13 10:56 block-0-2
-rw-r--r-- 1 tony tony   2791952 Jul 13 10:56 block-0-3
-rw-r--r-- 1 tony tony  55155664 Jul 13 10:56 block-1-0
-rw-r--r-- 1 tony tony  50074176 Jul 13 10:56 block-1-1
-rw-r--r-- 1 tony tony  12396840 Jul 13 10:56 block-1-2
-rw-r--r-- 1 tony tony   6498848 Jul 13 10:56 block-1-3
-rw-r--r-- 1 tony tony  19986976 Jul 13 10:56 block-2-0
-rw-r--r-- 1 tony tony  12129536 Jul 13 10:56 block-2-1
-rw-r--r-- 1 tony tony  19227224 Jul 13 10:56 block-2-2
-rw-r--r-- 1 tony tony   5787824 Jul 13 10:56 block-2-3
-rw-r--r-- 1 tony tony   2751472 Jul 13 10:56 block-3-0
-rw-r--r-- 1 tony tony   6035224 Jul 13 10:56 block-3-1
-rw-r--r-- 1 tony tony   5335752 Jul 13 10:56 block-3-2
-rw-r--r-- 1 tony tony  13209504 Jul 13 10:56 block-3-3
-rw-r--r-- 1 tony tony 551950184 Jul 13 10:56 column
-rw-r--r-- 1 tony tony       136 Jul 13 10:56 column_offset
-rw-rw-r-- 1 tony tony  19390284 Jul 13 11:00 degree
-rw-rw-r-- 1 tony tony        20 Jul 13 10:56 meta
-rw-rw-r-- 1 tony tony  19390284 Jul 13 10:57 parent
-rw-r--r-- 1 tony tony 551950184 Jul 13 10:56 row
-rw-r--r-- 1 tony tony       136 Jul 13 10:56 row_offset

I thought this might be a bit more useful.

tonyfleck76 avatar Jul 18 '16 20:07 tonyfleck76

You might try inserting the following statement at Ln.89 in "core/bigvector.hpp" (before the assertion):

perror("error message: ");

It could tell us what the exact error is. Thanks.

coolerzxw avatar Jul 19 '16 01:07 coolerzxw

bin/bfs LiveJournal_Grid/ 0 16
Error message: : Invalid argument
bfs: GridGraph/core/bigvector.hpp:90: void BigVector<T>::init(std::__cxx11::string, size_t) [with T = int; std::__cxx11::string = std::__cxx11::basic_string<char>; size_t = long unsigned int]: Assertion `fd!=-1' failed.
Aborted (core dumped)

tonyfleck76 avatar Jul 19 '16 15:07 tonyfleck76

It seems that O_DIRECT is not supported... What is the kernel version? And the type of the file system? I found some similar cases via Google but I am not sure what exactly causes the problem.

coolerzxw avatar Jul 21 '16 02:07 coolerzxw