From 5f3239963ed408038b1adb5b82b8156d9f25003d Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 11 Aug 2016 16:28:00 +0200 Subject: [PATCH] segfault with gcc --- contrib/moses2/Main.cpp | 4 ++++ contrib/moses2/System.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/moses2/Main.cpp b/contrib/moses2/Main.cpp index 7c4f0be09..e3dd79a5a 100644 --- a/contrib/moses2/Main.cpp +++ b/contrib/moses2/Main.cpp @@ -30,6 +30,10 @@ int main(int argc, char** argv) Moses2::System system(params); timer.check("Loaded"); + if (params.GetParam("show-weights")) { + return 0; + } + //cerr << "system.numThreads=" << system.options.server.numThreads << endl; Moses2::ThreadPool pool(system.options.server.numThreads, system.cpuAffinityOffset, system.cpuAffinityOffsetIncr); diff --git a/contrib/moses2/System.cpp b/contrib/moses2/System.cpp index 874093a55..05ba89490 100644 --- a/contrib/moses2/System.cpp +++ b/contrib/moses2/System.cpp @@ -44,7 +44,7 @@ System::System(const Parameter ¶msArg) : if (params.GetParam("show-weights")) { cerr << "Showing weights then exit" << endl; featureFunctions.ShowWeights(weights); - exit(1); + return; } cerr << "START featureFunctions.Load()" << endl;