JSMILE smile.em.learn causing segmentation fault

The engine.
Post Reply
suming
Posts: 4
Joined: Wed May 23, 2012 10:53 pm

JSMILE smile.em.learn causing segmentation fault

Post by suming »

Hi, using jsmile on Mac OSX. Using the following simple code:

class newEM {
public static void main(String[] args) {

Network net = new Network();

net.readFile("traffic.net");

DataSet ds = new DataSet();
ds.readFile("traffic.txt");

DataMatch[] dm = new DataMatch[ds.getVariableCount()];

EM em = new EM();
em.setSeed(0);
em.learn(ds, net, dm);
}


When I try to run this, I get the error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001277caf38, pid=4690, tid=6403
#
# JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libjsmile.jnilib+0x5af38] DSL_em::LearnDisc(DSL_dataset const&, DSL_network&, std::vector<DSL_datasetMatch, std::allocator<DSL_datasetMatch> > const&, std::vector<int, std::allocator<int> > const&, double*, DSL_progress*)+0x100a
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/coding/Coding/hs_err_pid4690.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Abort trap: 6


If I comment out the "em.learn.." line, no error. Can anyone provide some insight?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: JSMILE smile.em.learn causing segmentation fault

Post by shooltz[BayesFusion] »

suming wrote:DataMatch[] dm = new DataMatch[ds.getVariableCount()];
The DataMatch array you're passing to EM is an input parameter. Your code only allocates storage for the array and does not initialize its entries. You can call DataSet.matchNetwork if the names of your data column match the node identifiers. If this is not the case, you'll need to create appropriate DataMatch objects in your own code.
suming
Posts: 4
Joined: Wed May 23, 2012 10:53 pm

Re: JSMILE smile.em.learn causing segmentation fault

Post by suming »

Thanks! That worked.
Post Reply