davidepatti / noxim

Network on Chip Simulator
228 stars 120 forks source link

Noxim Simulation Not Running, Assertion Error #9

Closed mvxt closed 8 years ago

mvxt commented 8 years ago

Summary When I run noxim, I am returned an error saying it cannot find a YAML configuration file. The command I ran is this: bin$ ./noxim -sim 40000 -warmup 5000 -dimx 8 -dimy 8 -buffer 2 This returns: No YAML configuration file found! Use -config to load examples from config_examples folder

If I run the command with the -config flag, then I get a segfault with a core dump. bin$ ./noxim -config returns: Segmentation fault (core dumped)

Finally, if I run the command giving it a config file as an argument, it returns a separate error. ./noxim -config ../config_examples/default_config.yaml This returns:

        SystemC 2.3.1-Accellera --- Jun 14 2015 20:36:52
        Copyright (c) 1996-2014 by all Contributors,
        ALL RIGHTS RESERVED

                Noxim - the NoC Simulator
                (C) University of Catania

Loading configuration from file "../config_examples/default_config.yaml"... Done
Loading power configurations from file "power.yaml"... Done
noxim: libs/systemc-2.3.1/include/sysc/kernel/sc_process.h:616: void sc_core::sc_process_b::reference_increment(): Assertion `m_references_n != 0' failed.
Aborted (core dumped)

Steps To Recreate There were actually problems installing noxim. I run Ubuntu 16.04, and I ran the install script on this repo's README (see https://github.com/davidepatti/noxim/blob/master/other/setup/ubuntu.sh). The first time I ran it, there were errors due to certain files requiring compiler support for ISO C++ 2011 standard. Here is the error output:

g++ -O3 -Wall  -I../src -isystem libs/systemc-2.3.1/include -Ilibs/yaml-cpp/include -c ../src/Stats.cpp -o build/Stats.o
In file included from /usr/include/c++/5/type_traits:35:0,
                 from libs/yaml-cpp/include/yaml-cpp/node/detail/impl.h:12,
                 from libs/yaml-cpp/include/yaml-cpp/yaml.h:20,
                 from ../src/Power.h:18,
                 from ../src/Stats.h:18,
                 from ../src/Stats.cpp:11:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

So I went into the bin directory and modified the Makefile to include -std=c++11 flag in OPT, and then it compiled the rest of the files successfully, proceeding to break again on line 47 from the setup script.

Here is the output from an increased backtrace from gdb. I'm not sure what to make of it.

Loading configuration from file "config.yaml"... Done
Loading power configurations from file "power.yaml"... Done
noxim: libs/systemc-2.3.1/include/sysc/kernel/sc_process.h:616: void sc_core::sc_process_b::reference_increment(): Assertion `m_references_n != 0' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6e1d418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6e1d418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6e1f01a in __GI_abort () at abort.c:89
#2  0x00007ffff6e15bd7 in __assert_fail_base (fmt=<optimized out>, 
    assertion=assertion@entry=0x4a8710 "m_references_n != 0", 
    file=file@entry=0x4a8a00 "libs/systemc-2.3.1/include/sysc/kernel/sc_process.h", 
    line=line@entry=616, 
    function=function@entry=0x4ab8e0 <sc_core::sc_process_b::reference_increment()::__PRETTY_FUNCTION__> "void sc_core::sc_process_b::reference_increment()") at assert.c:92
#3  0x00007ffff6e15c82 in __GI___assert_fail (assertion=assertion@entry=0x4a8710 "m_references_n != 0", 
    file=file@entry=0x4a8a00 "libs/systemc-2.3.1/include/sysc/kernel/sc_process.h", 
    line=line@entry=616, 
    function=function@entry=0x4ab8e0 <sc_core::sc_process_b::reference_increment()::__PRETTY_FUNCTION__> "void sc_core::sc_process_b::reference_increment()") at assert.c:101
#4  0x000000000044b77a in sc_core::sc_process_b::reference_increment (this=<optimized out>)
    at libs/systemc-2.3.1/include/sysc/kernel/sc_process.h:616
#5  sc_core::sc_process_handle::sc_process_handle (this=<optimized out>, orig=...)
    at libs/systemc-2.3.1/include/sysc/kernel/sc_process_handle.h:214
#6  0x0000000000452c90 in sc_core::sc_spawn<sc_boost::_bi::bind_t<void, sc_boost::_mfi::mf0<void, tlm_utils::simple_target_socket<Target, 32u, tlm::tlm_base_protocol_types>::fw_process>, sc_boost::_bi::list1<sc_boost::_bi::value<tlm_utils::simple_target_socket<Target, 32u, tlm::tlm_base_protocol_types>::fw_process*> > > > (opt_p=0x7fffffffcc80, name_p=0x768be8 "b2nb_thread_0", object=...)
    at libs/systemc-2.3.1/include/sysc/kernel/sc_spawn.h:119
#7  tlm_utils::simple_target_socket<Target, 32u, tlm::tlm_base_protocol_types>::fw_process::fw_process (
    p_own=0x768160, this=0x768278, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at libs/systemc-2.3.1/include/tlm_utils/simple_target_socket.h:203
#8  tlm_utils::simple_target_socket<Target, 32u, tlm::tlm_base_protocol_types>::simple_target_socket (
    n=0x4a86e7 "socket", this=0x768160)
    at libs/systemc-2.3.1/include/tlm_utils/simple_target_socket.h:73
#9  Target::Target (h=0x75c1e0, id=0, 
    nm=<error reading variable: access outside bounds of object referenced via synthetic pointer>, 
    this=0x768070) at ../src/Target.h:34
#10 Hub::Hub (this=0x75c1e0, nm=..., id=<optimized out>, tr=<optimized out>) at ../src/Hub.h:157
#11 0x0000000000442d54 in NoC::buildMesh (this=this@entry=0x715930) at ../src/NoC.cpp:39
#12 0x000000000041f417 in NoC::NoC (this=0x715930) at ../src/NoC.h:79
#13 sc_main (arg_num=<optimized out>, arg_vet=<optimized out>) at ../src/Main.cpp:54
#14 0x00007ffff7acce64 in sc_elab_and_sim ()
   from /usr/local/systemc-2.3.1/lib-linux64/libsystemc-2.3.1.so
#15 0x00007ffff6e08830 in __libc_start_main (main=0x4094b0 <main@plt>, argc=3, argv=0x7fffffffdaf8, 
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdae8)
    at ../csu/libc-start.c:291
#16 0x000000000040f449 in _start ()

System Info lsb-release:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"

cpu:

Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
64-bit

Any help is much appreciated. I might try installing a previous version of noxim for now.

mvxt commented 8 years ago

So... I honestly have no idea what the actual issue turned out to be. But I managed to fix it. I don't know which of these steps resolved the issue, but here's the full list of things I did:

  1. Purged the libyaml-cpp-dev and libyaml-cpp0.5 (previously installed)
  2. Purged previous installations of SystemC (previously installed)
  3. Go to https://github.com/davidepatti/noxim/blob/master/other/setup/ubuntu.sh and instead of running the command provided on noxim's README, run each of the commands in the ubuntu.sh manually until line 45.
  4. Before making noxim, open Makefile with your favorite text editor and change line 24 from: OPT := -O3 To: OPT := -O3 -std=gnu++11
  5. Run make, and then execute the program with a config file as an argument.

My educated guess is that the option to set -std=gnu++11 was what fixed it. There shouldn't have been any conflict with previously installed libraries because smonteleone's script downloads the YAML and SystemC libraries separately into noxim. When I previously upgraded to noxim's latest version and installed it, I added in '-std=c++11' as a flag to OPT due to errors while making. This resulted in all of the errors and issues reported above.

Hope this helps someone!