Я пытаюсь отследить segfault с помощью GDB, но он занимает ненормально много времени и у него заканчивается память, прежде чем он достигнет segfault.
Если я запускаю программу, она занимает <1сек, чтобы вернуть ошибку сегментации следующим образом:
Segmentation fault (core dumped)
Если я запускаю его в GDB и отпускаю, он продолжает работать в течение нескольких минут, прежде чем использовать почти 4 ГБ памяти и вылетать. В настоящее время я только запустил его и проверил диспетчер задач, и он уже использует более гигабайта. Я периодически нажимаю Ctrl + C, чтобы посмотреть, что происходит, и похоже, что он проходит программу, но очень медленно.
Я знаю, что GDB обычно использует больше памяти, но это очень маленькая программа для класса колледжа, и она не должна использовать где-то близко к 4 ГБ памяти. Я запускаю это с помощью Bash для Windows, но я не думаю, что это проблема, потому что я пытался запустить его на школьном сервере, и это занимает столько же времени.
Распечатка заявлений cerr:
Robert Rose 3
Load cards start.
Birmingham Oranges 38
38
Begin CO
Oranges
Я не знаю, если это проблема с моим кодом или с GDB. Вот репозиторий со всем кодом: https://github.com/RobRoseKnows/umbc-cs341/tree/master/Projects/Project%202 Вы можете запустить его с make test
, resultsexpected.txt
не имеет отношения к тестированию драйвера.
Самая последняя вещь, которую я изменил, была loadCards()
метод в Game.cpp
:
Game.cpp
#include "Game.h"#include<fstream>
#include<sstream>
#include<istream>
#include<iterator>
using namespace std;Game::~Game() {
while(!m_drawPile.empty()) {
delete m_drawPile.top();
m_drawPile.pop();
}
}void Game::runSimulation(int players, Player::STRATEGY strategy) {
}void Game::printDrawPile(ofstream& fileStream) {
fileStream << "---------- Draw Pile ----------" << endl;
stack<Card*> drawPileCopy = m_drawPile;
while(!drawPileCopy.empty()) {
Card* top = drawPileCopy.top();
drawPileCopy.pop();
top->printCard(fileStream);
}
}void Game::printResults(ofstream& fileStream) {
}void Game::loadCards(string filename) {
ifstream fileIn;
fileIn.open(filename.c_str(), fileIn.in);
cerr << "Load cards start." << endl;
while(!fileIn.eof()) {
Card* newCard = new Card;
// Get the string representations of each of the values.
string dest;
string commName;
string payStr;
fileIn >> dest;
fileIn >> commName;
fileIn >> payStr;
cerr << dest << " " << commName << " " << payStr << endl;
int pay;
istringstream(payStr) >> pay;
cerr << pay << endl;
Objective* newObjective = createObjective(dest, commName, pay);
cerr << newObjective->getCommodity()->getName() << " to "<< newObjective->getDestination() << " for "<< newObjective->getPayoff() << endl;
newCard->addObjective(newObjective);
m_drawPile.push(newCard);
}
fileIn.close();
cerr << "Load cards end." << endl;
}Objective* Game::createObjective(string dest, string commName, int pay) {
cerr << "Begin CO" << endl;
Commodity* commodity = m_bank.getCommodity(commName);
cerr << commodity->getName();
return new Objective(dest, commodity, pay);
}
Game.h
#ifndef GAME_H_
#define GAME_H_
#include<vector>
#include<stack>
#include<iostream>
using namespace std;
#include "Player.h"#include "CommodityStore.h"#include "Card.h"#include "Objective.h"
class Game {
public:
~Game();
void runSimulation(int players, Player::STRATEGY strategy);
void printDrawPile(ofstream& fileStream);
void printResults(ofstream& fileStream);
void loadCards(string filename);
private:
stack<Card*> m_drawPile;
vector<Player*> m_players;
CommodityStore m_bank;
Objective* createObjective(string dest, string commName, int pay);
};
#endif
И вот некоторые файлы, на которые ссылается эта функция:
Objective.cpp
#include "Objective.h"#include "Commodity.h"
#include <ostream>
using namespace std;
Objective::Objective(string dest, Commodity* comm, int pay) {
m_sDestination = dest;
m_pCommodity = comm;
m_iPayoff = pay;
}
// Delete the dynamic memory.
Objective::~Objective() {
m_pCommodity = NULL;
}
// Prints the objective out to the ofstream.
// Prints in the format: "<commodity> to <destination> for <payoff>"void Objective::printObjective(ofstream & fileStream) {
fileStream << m_pCommodity->getName() << " to " << m_sDestination << " for " << m_iPayoff << endl;
}
Objective.h
#ifndef OBJECTIVE_H_
#define OBJECTIVE_H_
#include<fstream>
using namespace std;
class Commodity;
class Objective {
public:
// Constructor that takes destination, commodity and payoff.
Objective(string dest, Commodity* comm, int pay);
// Deconstructor
~Objective();
// Prints the objective to an ofsteam.
// Prints in the format: "<commodity> to <destination> for <payoff>"void printObjective(ofstream & fileStream);/* Implement Getters in the header file */
// Return the destination.
string getDestination() const {
return m_sDestination;
}
// Returns the pointer to a commodity.
Commodity* getCommodity() const {
return m_pCommodity;
}
// Returns the payoff for this objective.
int getPayoff() const {
return m_iPayoff;
}
private:
string m_sDestination;
Commodity* m_pCommodity;
int m_iPayoff;
};
#endif
CommodityStore.cpp
Я установил точку останова в нижней части файла (пометил строку в комментариях), потому что думал, что именно в этом может быть ошибка. Я собирался проверить размер карты, как только отладчик достиг этой точки, но этого не произошло.
#include "CommodityStore.h"
#include<fstream>
#include<istream>
#include<iostream>
using namespace std;CommodityStore::~CommodityStore() {
// Special thanks: http://stackoverflow.com/a/4844904/1021259 for this line:
typedef map<string, Commodity*>::iterator it_type;
for(it_type itr = m_store.begin(); itr != m_store.end(); itr++) {
// I originally had it deleting the itr->second but that didn't work so now I'm
// using the iterator to get the key rather than than the object.
delete m_store[itr->first];
}
}// loadCommodities()
// Takes a filename and inserts the commodities in the file into the map.
void CommodityStore::loadCommodities(string filename) {
ifstream fileIn;
fileIn.open(filename.c_str(), fileIn.in);while(!fileIn.eof()) {
string commodityName;
string commodityColor;
fileIn >> commodityName;
fileIn >> commodityColor;
// cerr << commodityName << " " << commodityColor << endl;
// Create the new commodity and add it to the map.
Commodity* newComm = new Commodity(commodityName, commodityColor);
m_store[commodityName] = newComm;
}
fileIn.close();
// Special thanks: http://stackoverflow.com/a/237280/1021259
}void CommodityStore::printCommodities(ofstream& fileStream) {
fileStream << "---------- Commodities ----------" << endl;
// Special thanks: http://stackoverflow.com/a/4844904/1021259 for this line:
typedef map<string, Commodity*>::iterator it_type;
for(it_type itr = m_store.begin(); itr != m_store.end(); itr++) {
Commodity* on = m_store[itr->first];
fileStream << on->getName() << " " << on->colorToString(on->getColor()) << endl;
}
fileStream << "--------------------------" << endl;
}
Commodity* CommodityStore::getCommodity(string name) {
cerr << name << endl; // <<<<<<<<<<< THIS IS WHERE I PUT A BREAKPOINT
return m_store[name];
}
CommodityStore.h
#ifndef CS_H_
#define CS_H_
#include "Commodity.h"
#include<map>
#include<string>
using namespace std;
class CommodityStore {
public:~CommodityStore();
/****
* Name: loadCommodities()
* PreCondition: Requires a list of commodities with name and color on the same line delimited
* by a space. Each one should only be one word long. Different commodities
* should be on different lines.
* PostCondition: All the commodities in the given file should now be in the map m_store.
**/
void loadCommodities(string filename);
// This is for testing only.
void printCommodities(ofstream& fileStream);
Commodity* getCommodity(string name) ;
private:
map<string, Commodity*> m_store;
};
#endif
Driver.cpp
#include <iostream>
#include <fstream>
using namespace std;
#include "Game.h"#include "CommodityStore.h"
void printGreeting();
int main(int argc, char ** argv) {
printGreeting();
string cardFileName = "";
string commodFileName = "";
// string playerFileName = "";
// string strat = "";
if(argc >= 2) {
cardFileName = argv[1];
commodFileName = argv[2];
// playerFileName = argv[3];
// strat = argv[4];
} else {
std::cerr << "Not enough arguments." << endl;
return 1;
}
CommodityStore store = CommodityStore();
Game game = Game();
store.loadCommodities(commodFileName);
game.loadCards(cardFileName);
ofstream fileOut;
fileOut.open("results.txt", fileOut.out);
store.printCommodities(fileOut);
game.printDrawPile(fileOut);
fileOut.close();
}
void printGreeting() {
std::cerr << "Robert Rose 3" << endl;
}
Выход Valgrind:
[robrose2@linux1 PROJ2]make val CARDS=cards.txt COMMODITIES=commodities.txt
valgrind --leak-check=full -v ./a.out cards.txt commodities.txt
==16914== Memcheck, a memory error detector
==16914== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==16914== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==16914== Command: ./a.out cards.txt commodities.txt
==16914==
--16914-- Valgrind options:
--16914-- --leak-check=full
--16914-- -v
--16914-- Contents of /proc/version:
--16914-- Linux version 2.6.32-642.4.2.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue Aug 23 19:58:13 UTC 2016
--16914-- Arch and hwcaps: AMD64, amd64-sse3-cx16-avx
--16914-- Page sizes: currently 4096, max supported 4096
--16914-- Valgrind library directory: /usr/lib64/valgrind
--16914-- Reading syms from /afs/umbc.edu/users/r/o/robrose2/home/CMSC341/PROJ2/a.out
--16914-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux
--16914-- object doesn't have a dynamic symbol table
--16914-- Reading syms from /lib64/ld-2.12.so
--16914-- Scheduler: using generic scheduler lock implementation.
--16914-- Reading suppressions file: /usr/lib64/valgrind/default.supp
==16914== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-16914-by-robrose2-on-linux1.gl.umbc.edu
==16914== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-16914-by-robrose2-on-linux1.gl.umbc.edu
==16914== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-16914-by-robrose2-on-linux1.gl.umbc.edu
==16914==
==16914== TO CONTROL THIS PROCESS USING vgdb (which you probably
==16914== don't want to do, unless you know exactly what you're doing,
==16914== or are doing some strange experiment):
==16914== /usr/lib64/valgrind/../../bin/vgdb --pid=16914 ...command...
==16914==
==16914== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==16914== /path/to/gdb ./a.out
==16914== and then give GDB the following command
==16914== target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=16914
==16914== --pid is optional if only one valgrind process is running
==16914==
--16914-- REDIR: 0x39d6617d10 (strlen) redirected to 0x38049551 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--16914-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so
--16914-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so
--16914-- REDIR: 0x39d6617b20 (index) redirected to 0x4a07c30 (index)
--16914-- REDIR: 0x39d6617ba0 (strcmp) redirected to 0x4a08570 (strcmp)
--16914-- Reading syms from /usr/lib64/libstdc++.so.6.0.13
--16914-- object doesn't have a symbol table
--16914-- Reading syms from /lib64/libm-2.12.so
--16914-- Reading syms from /lib64/libgcc_s-4.4.7-20120601.so.1
--16914-- object doesn't have a symbol table
--16914-- Reading syms from /lib64/libc-2.12.so
--16914-- REDIR: 0x39d6a84e60 (strcasecmp) redirected to 0x480155c (_vgnU_ifunc_wrapper)
--16914-- REDIR: 0x39d6a87120 (strncasecmp) redirected to 0x480155c (_vgnU_ifunc_wrapper)
--16914-- REDIR: 0x39d6a82dd0 (__GI_strrchr) redirected to 0x4a07ab0 (__GI_strrchr)
--16914-- REDIR: 0x39d6a812f0 (__GI_strlen) redirected to 0x4a07fb0 (__GI_strlen)
--16914-- REDIR: 0x39d6a7f870 (strcmp) redirected to 0x480155c (_vgnU_ifunc_wrapper)
--16914-- REDIR: 0x39d6b28550 (__strcmp_sse42) redirected to 0x4a084d0 (strcmp)
--16914-- REDIR: 0x39d6a812b0 (strlen) redirected to 0x480155c (_vgnU_ifunc_wrapper)
--16914-- REDIR: 0x39d6b33820 (__strlen_sse42) redirected to 0x4a07f90 (strlen)
Robert Rose 3--16914-- REDIR: 0x39d6a89800 (memcpy) redirected to 0x4a08b60 (memcpy)
3
--16914-- REDIR: 0x39dd6bd0a0 (operator new(unsigned long)) redirected to 0x4a0757a (operator new(unsigned long))
--16914-- REDIR: 0x39dd6bb2f0 (operator delete(void*)) redirected to 0x4a05f8f (operator delete(void*))
--16914-- REDIR: 0x39d6a7aba0 (malloc) redirected to 0x4a069ac (malloc)
--16914-- REDIR: 0x39dd6bd1d0 (operator new[](unsigned long)) redirected to 0x4a07110 (operator new[](unsigned long))
--16914-- REDIR: 0x39dd6bb330 (operator delete[](void*)) redirected to 0x4a05adf (operator delete[](void*))
--16914-- REDIR: 0x39d6a7ba00 (free) redirected to 0x4a063a9 (free)
Load cards start.
Birmingham Oranges 38
38
Oranges
Begin CO
Oranges
==16914== Invalid read of size 8
==16914== at 0x39DD69D258: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x4040BF: Commodity::getName() const (Commodity.h:48)
==16914== by 0x403F4E: Game::createObjective(std::string, std::string, int) (Game.cpp:112)
==16914== by 0x403C56: Game::loadCards(std::string) (Game.cpp:87)
==16914== by 0x401D11: main (Driver.cpp:44)
==16914== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==16914==
==16914==
==16914== Process terminating with default action of signal 11 (SIGSEGV)
==16914== Access not within mapped region at address 0x0
==16914== at 0x39DD69D258: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x4040BF: Commodity::getName() const (Commodity.h:48)
==16914== by 0x403F4E: Game::createObjective(std::string, std::string, int) (Game.cpp:112)
==16914== by 0x403C56: Game::loadCards(std::string) (Game.cpp:87)
==16914== by 0x401D11: main (Driver.cpp:44)
==16914== If you believe this happened as a result of a stack
==16914== overflow in your program's main thread (unlikely but
==16914== possible), you can try to increase the size of the
==16914== main thread stack using the --main-stacksize= flag.
==16914== The main thread stack size used in this run was 10485760.
==16914==
==16914== HEAP SUMMARY:
==16914== in use at exit: 12,381 bytes in 100 blocks
==16914== total heap usage: 134 allocs, 34 frees, 22,616 bytes allocated
==16914==
==16914== Searching for pointers to 100 not-freed blocks
==16914== Checked 184,744 bytes
==16914==
==16914== 27 bytes in 1 blocks are possibly lost in loss record 2 of 16
==16914== at 0x4A075FC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16914== by 0x39DD69C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D867: std::string::append(char const*, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD67AF8D: std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x403AC3: Game::loadCards(std::string) (Game.cpp:76)
==16914== by 0x401D11: main (Driver.cpp:44)
==16914==
==16914== 32 bytes in 1 blocks are possibly lost in loss record 3 of 16
==16914== at 0x4A075FC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16914== by 0x39DD69C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D867: std::string::append(char const*, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD67AF8D: std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x403AAA: Game::loadCards(std::string) (Game.cpp:75)
==16914== by 0x401D11: main (Driver.cpp:44)
==16914==
==16914== 34 bytes in 1 blocks are possibly lost in loss record 4 of 16
==16914== at 0x4A075FC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16914== by 0x39DD69C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69DDA9: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69DF6B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x401BF1: main (Driver.cpp:31)
==16914==
==16914== 35 bytes in 1 blocks are possibly lost in loss record 5 of 16
==16914== at 0x4A075FC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16914== by 0x39DD69C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D867: std::string::append(char const*, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD67AF8D: std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x403A91: Game::loadCards(std::string) (Game.cpp:74)
==16914== by 0x401D11: main (Driver.cpp:44)
==16914==
==16914== 40 bytes in 1 blocks are possibly lost in loss record 6 of 16
==16914== at 0x4A075FC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16914== by 0x39DD69C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69DDA9: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69DF6B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x401C0E: main (Driver.cpp:32)
==16914==
==16914== 885 bytes in 29 blocks are possibly lost in loss record 14 of 16
==16914== at 0x4A075FC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16914== by 0x39DD69C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD69D867: std::string::append(char const*, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x39DD67AF8D: std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x404B66: CommodityStore::loadCommodities(std::string) (CommodityStore.cpp:51)
==16914== by 0x401CBE: main (Driver.cpp:43)
==16914==
==16914== LEAK SUMMARY:
==16914== definitely lost: 0 bytes in 0 blocks
==16914== indirectly lost: 0 bytes in 0 blocks
==16914== possibly lost: 1,053 bytes in 34 blocks
==16914== still reachable: 11,328 bytes in 66 blocks
==16914== suppressed: 0 bytes in 0 blocks
==16914== Reachable blocks (those to which a pointer was found) are not shown.
==16914== To see them, rerun with: --leak-check=full --show-reachable=yes
==16914==
==16914== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 6 from 6)
==16914==
==16914== 1 errors in context 1 of 7:
==16914== Invalid read of size 8
==16914== at 0x39DD69D258: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) (in /usr/lib64/libstdc++.so.6.0.13)
==16914== by 0x4040BF: Commodity::getName() const (Commodity.h:48)
==16914== by 0x403F4E: Game::createObjective(std::string, std::string, int) (Game.cpp:112)
==16914== by 0x403C56: Game::loadCards(std::string) (Game.cpp:87)
==16914== by 0x401D11: main (Driver.cpp:44)
==16914== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==16914==
--16914--
--16914-- used_suppression: 4 U1004-ARM-_dl_relocate_object
--16914-- used_suppression: 2 glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
==16914==
==16914== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 6 from 6)
make: *** [val] Segmentation fault
[robrose2@linux1 PROJ2]
Задача ещё не решена.
Других решений пока нет …