UpdateBeliefs segmentation fault

The engine.
Post Reply
qiubix
Posts: 3
Joined: Sun Oct 12, 2014 5:16 pm

UpdateBeliefs segmentation fault

Post by qiubix »

Hi, I'm developing a component using SMILE to implement Bayes network, and I am blocked by a segmentation fault. I'm using an unusual custom framework, which is hard to debug. I discovered, that this segmentation fault occurs on the line:

Code: Select all

theNet.UpdateBeliefs();
Interesting thing is that everything seems to work perfectly for small networks (about 20 nodes), but when I test this in production environment with data on which this system is supposed to work (it creates network with about 3000 nodes), it crashes on this line. Because I cannot easily go with debugger line by line and look at the variables, and various logs tell me nothing, I am looking for any kind of help or guidance, what might cause this error. If I'd have at least general idea, what may be the reason, I'd know which part of system or algorithm building/evaluating network should I examine closely.

I don't have much experience with gdb, but it's the only way I found to debug this. Here is stacktrace result, maybe somebody who knows, whats' going on behind UpdateBeliefs() method will know what might be causing the problem just by looking at the sequence of calls.

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc03e8700 (LWP 6966)]
0x00007fffc0560ca8 in TsClique::SortNodes() () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
(gdb) bt
#0  0x00007fffc0560ca8 in TsClique::SortNodes() () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#1  0x00007fffc04ad508 in TsTriangulator::Triangulate(unsigned int) () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#2  0x00007fffc04aa9b8 in TsJoinTree::Triangulate(unsigned int) () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#3  0x00007fffc04ab5b0 in TsJoinTree::UpdateBeliefsEx(bool*, unsigned int) () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#4  0x00007fffc04a8d82 in (anonymous namespace)::DoClustering(DSL_network*, bool*, int, int&) () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#5  0x00007fffc04a959e in TsClustering(DSL_network*) () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#6  0x00007fffc049138f in DSL_network::CallBNAlgorithm() () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#7  0x00007fffc048f450 in DSL_network::UpdateBeliefs() () from /home/qiubix/DCL/BayesNetwork/dist/lib/libprocSOMEvaluation.so
#8  0x00007fffc047b24e in Processors::Network::SOMEvaluation::evaluate (this=0x86b2d0) at /home/qiubix/DCL/BayesNetwork/src/Components/SOMEvaluation/SOMEvaluation.cpp:101
#9  0x00007fffc047aff7 in Processors::Network::SOMEvaluation::onInstance (this=0x86b2d0) at /home/qiubix/DCL/BayesNetwork/src/Components/SOMEvaluation/SOMEvaluation.cpp:86
Thank you in advance for any help, I am really desperate, it's really bugging me blocking my work for days.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: UpdateBeliefs segmentation fault

Post by shooltz[BayesFusion] »

Can you send me the network you're using? If it contains sensitive information, you can remove it using GeNIe's Network|Obfuscate command.

The segfault and stack dump suggest a simple failure when allocating memory. However, the only place in TsClique::SortNodes which allocates uses relatively small blocks (at least when compared to the size of clique potential matrices etc).
qiubix
Posts: 3
Joined: Sun Oct 12, 2014 5:16 pm

Re: UpdateBeliefs segmentation fault

Post by qiubix »

Do you mean network exported to xdsl file? I have never used GeNIe's commands.
I'm aware that this segfault is probably caused by something basic, obviously I'm violating memory allocation rules somewhere, but apparently I cannot look at my code objectively.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: UpdateBeliefs segmentation fault

Post by shooltz[BayesFusion] »

I meant the xdsl file saved with a DSL_network::WriteFile call. The obfuscation is not needed on my side; you may want to do it if the network contains some intellectual property you want to protect.
qiubix
Posts: 3
Joined: Sun Oct 12, 2014 5:16 pm

Re: UpdateBeliefs segmentation fault

Post by qiubix »

I've sent you xdsl file in PM. I know my response wasn't entirely clear, I know how to write network to a file using SMILE API, I just indicated that I've never used GeNIe so far, so that if you want me to perform any additional operations on network using GeNIe, I have to get familiar with it first.
By the way, network doesn't need any obfuscation.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: UpdateBeliefs segmentation fault

Post by shooltz[BayesFusion] »

qiubix wrote:I've sent you xdsl file in PM.
It works fine here. However, the node count is 1331 - significantly less than 3k you mentioned in your original email.
Post Reply