Had a try merging the sdk into mad branch. Merge almost FF, but segfault in ipcm.
See attachments. Marc On 02/02/15 23:08, Francesco Salvestrini wrote:
Hi Marc, 2015-02-02 19:08 GMT+01:00 Marc Sune <marc.sune@xxxxxxxx>:Did a quick test. I merged temporally current IRATI/stack/master into bisdn/rina-sdk succesfully (minor conflicts due to policy code). I only tried out the MAd to see if it was booting and correctly registering to the IPCManager. So far same results as in the previous HEAD, so everything OK.I've created the 'sdk' branch in the repo. The 'master' and 'sdk' branches now differ for the SDK related changes. The next step is to try merging 'sdk' into a temporary branch containing the Management Agent changes. I'll be applying the fixes for the plugins loading in the following days (free form names instead of the "canonical" lib<plugin>.so). Therefore, try merging BUT DO NOT promote the sdk->ma merge anywhere, for the time being (just use a temporary branch just to see what happens).@Francesco: could we add a trace to the kernel modules with the version (better GIT hash) to be 100% sure modules are correctly updated and loaded, printed during insmod/modprobe time? Also for policies.Might land in the 'sdk' branch as one of the "tooling fixes and rearrangements" sort of changes briefly introduced last week. Ciao, FrancescoMarc On 02/02/15 16:47, Francesco Salvestrini wrote:Hi all, I've just pushed the 1st bunch of contributions from the FP7-IRATI project (IRATI 3rd prototype) into the repository (branch 'master'). To git@xxxxxxxxxx:/IRATI/stack 5b0ea0e..8af7720 master -> master To git@xxxxxxxxxx:/IRATI/stack * [new tag] v0.9.10 -> v0.9.10 * [new tag] v0.9.11 -> v0.9.11 * [new tag] v0.9.12 -> v0.9.12 * [new tag] v0.9.13 -> v0.9.13 * [new tag] v0.9.14 -> v0.9.14 * [new tag] v0.9.6 -> v0.9.6 * [new tag] v0.9.7 -> v0.9.7 * [new tag] v0.9.8 -> v0.9.8 * [new tag] v0.9.9 -> v0.9.9 NOTE: This is only the 1st part. The 2nd (and final) part is still under merge. Ciao, Francesco
root@rina:/home/marc/sandbox/bin# gdb --args ./ipcm -l DEBUG -c ../etc/ipcmanager.conf GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./ipcm...done. (gdb) r Starting program: /home/marc/sandbox/bin/ipcm -l DEBUG -c ../etc/ipcmanager.conf [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 821(1422958724)#concurrency (DBG): Lockable created successfully 821(1422958724)#concurrency (DBG): Lockable created successfully 821(1422958724)#ipcm (DBG): Config file is: ../etc/ipcmanager.conf 821(1422958724)#concurrency (DBG): Lockable created successfully 821(1422958724)#concurrency (DBG): Condition variable created successfully 821(1422958724)#logs (DBG): New log level: DEBUG 821(1422958724)#concurrency (DBG): Lockable created successfully 821(1422958724)#netlink-manager (DBG): Netlink Manager constructor called, with netlink pid = -158194144 821(1422958724)#netlink-manager (INFO): Netlink socket connected to local port -161064329 821(1422958724)#netlink-manager (DBG): Generic Netlink RINA family id: 0 821(1422958724)#core (DBG): Initialized Netlink Manager 821(1422958724)#concurrency (DBG): Lockable created successfully 821(1422958724)#concurrency (DBG): Condition variable created successfully 821(1422958724)#core (DBG): Initialized event queue [New Thread 0x7ffff6363700 (LWP 825)] 821(1422958724)#core (DBG): Started Netlink Message reader thread Program received signal SIGSEGV, Segmentation fault. 0x00007ffff65c6f00 in _IO_vfprintf_internal (s=<optimized out>, format=<optimized out>, ap=<optimized out>) at vfprintf.c:1636 1636 vfprintf.c: No such file or directory. (gdb) info threads Id Target Id Frame 2 Thread 0x7ffff6363700 (LWP 825) "ipcm" __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 * 1 Thread 0x7ffff7feb740 (LWP 821) "ipcm" 0x00007ffff65c6f00 in _IO_vfprintf_internal (s=<optimized out>, format=<optimized out>, ap=<optimized out>) at vfprintf.c:1636 (gdb) bt #0 0x00007ffff65c6f00 in _IO_vfprintf_internal (s=<optimized out>, format=<optimized out>, ap=<optimized out>) at vfprintf.c:1636 #1 0x00007ffff7b2f4fe in log (level=<optimized out>, fmt=0x7ffff7bae1d8 "#netlink-manager (DBG): Sent message of %d bytes. %s\n") at ../../src/logs.cc:183 #2 0x00007ffff7b94bae in rina::NetlinkManager::_sendMessage (this=0x18, message=0x7fffffffdc50, netlinkMessage=0x6a0320) at ../../src/netlink-manager.cc:182 #3 0x00007ffff7b94df4 in rina::NetlinkManager::sendMessage (this=0x69feb0, message=message@entry=0x7fffffffdc50) at ../../src/netlink-manager.cc:204 #4 0x00007ffff7b33bc0 in rina::RINAManager::sendMessage (this=0x6b11a0, netlinkMessage=netlinkMessage@entry=0x7fffffffdc50) at ../../src/core.cc:547 #5 0x00007ffff7b59b67 in rina::initializeIPCManager (localPort=localPort@entry=1, installationPath="/home/marc/sandbox/bin", libraryPath="/home/marc/sandbox/lib", logLevel="DEBUG", pathToLogFolder="") at ../../src/ipc-manager.cc:70 #6 0x000000000041bb23 in rinad::IPCManager::init (this=this@entry=0x7fffffffe160, logfile="", loglevel="DEBUG") at ../../../src/ipcm/ipcm.cc:80 #7 0x000000000040e3c3 in wrapped_main (argc=5, argv=0x7fffffffe678) at ../../../src/ipcm/main.cc:115 #8 0x000000000040c636 in main (argc=<optimized out>, argv=<optimized out>) at ../../../src/ipcm/main.cc:134 (gdb) t 2 [Switching to thread 2 (Thread 0x7ffff6363700 (LWP 825))] #0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 95 ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory. (gdb) bt #0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 #1 0x00007ffff65ca4af in _L_lock_976 () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff65c53b4 in _IO_vfprintf_internal (s=0x7ffff69232a0 <_IO_2_1_stdout_>, format=0x7ffff7ba30c0 "%d(%ld)", ap=ap@entry=0x7ffff6362cb8) at vfprintf.c:1314 #3 0x00007ffff65cf527 in __fprintf (stream=<optimized out>, format=<optimized out>) at fprintf.c:32 #4 0x00007ffff7b2f4f0 in log (level=level@entry=DBG, fmt=fmt@entry=0x7ffff7ba38c0 "#core (DBG): Waiting for message %d\n") at ../../src/logs.cc:182 #5 0x00007ffff7b33e3d in rina::doNetlinkMessageReaderWork (arg=0x6b11a0) at ../../src/core.cc:444 #6 0x00007ffff71520a4 in start_thread (arg=0x7ffff6363700) at pthread_create.c:309 #7 0x00007ffff6664ccd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 (gdb)
root@rina:/home/marc/sandbox/bin# valgrind ./ipcm -l DEBUG -c ../etc/ipcmanager.conf ==811== Memcheck, a memory error detector ==811== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==811== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==811== Command: ./ipcm -l DEBUG -c ../etc/ipcmanager.conf ==811== 811(1422958581)#concurrency (DBG): Lockable created successfully 811(1422958581)#concurrency (DBG): Lockable created successfully 811(1422958581)#ipcm (DBG): Config file is: ../etc/ipcmanager.conf 811(1422958581)#concurrency (DBG): Lockable created successfully 811(1422958581)#concurrency (DBG): Condition variable created successfully 811(1422958581)#logs (DBG): New log level: DEBUG 811(1422958581)#concurrency (DBG): Lockable created successfully 811(1422958581)#netlink-manager (DBG): Netlink Manager constructor called, with netlink pid = 1024 811(1422958581)#netlink-manager (INFO): Netlink socket connected to local port 104659575 811(1422958581)#netlink-manager (DBG): Generic Netlink RINA family id: -16778816 811(1422958581)#core (DBG): Initialized Netlink Manager 811(1422958581)#concurrency (DBG): Lockable created successfully 811(1422958581)#concurrency (DBG): Condition variable created successfully 811(1422958581)#core (DBG): Initialized event queue 811(1422958581)#core (DBG): Started Netlink Message reader thread 811(1422958581)#core (DBG): Waiting for message 93003844 ==811== Invalid read of size 1 ==811== at 0x6330F00: vfprintf (vfprintf.c:1636) ==811== by 0x4EA04FD: log(LOG_LEVEL, char const*, ...) (logs.cc:183) ==811== by 0x4F05BAD: rina::NetlinkManager::_sendMessage(rina::BaseNetlinkMessage*, nl_msg*) (netlink-manager.cc:182) ==811== by 0x4F05DF3: rina::NetlinkManager::sendMessage(rina::BaseNetlinkMessage*) (netlink-manager.cc:204) ==811== by 0x4EA4BBF: rina::RINAManager::sendMessage(rina::BaseNetlinkMessage*) (core.cc:547) ==811== by 0x4ECAB66: rina::initializeIPCManager(unsigned int, std::string const&, std::string const&, std::string const&, std::string const&) (ipc-manager.cc:70) ==811== by 0x41BB22: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:80) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== Address 0x69310de is 254 bytes inside a block of size 537 free'd ==811== at 0x4C2A360: operator delete(void*) (vg_replace_malloc.c:507) ==811== by 0x4EF35A7: _M_dispose (basic_string.h:555) ==811== by 0x4EF35A7: ~basic_string (basic_string.h:547) ==811== by 0x4EF35A7: ~basic_stringbuf (sstream:64) ==811== by 0x4EF35A7: ~basic_stringstream (sstream:565) ==811== by 0x4EF35A7: rina::BaseNetlinkMessage::toString() (netlink-messages.cc:150) ==811== by 0x4F05B93: rina::NetlinkManager::_sendMessage(rina::BaseNetlinkMessage*, nl_msg*) (netlink-manager.cc:182) ==811== by 0x4F05DF3: rina::NetlinkManager::sendMessage(rina::BaseNetlinkMessage*) (netlink-manager.cc:204) ==811== by 0x4EA4BBF: rina::RINAManager::sendMessage(rina::BaseNetlinkMessage*) (core.cc:547) ==811== by 0x4ECAB66: rina::initializeIPCManager(unsigned int, std::string const&, std::string const&, std::string const&, std::string const&) (ipc-manager.cc:70) ==811== by 0x41BB22: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:80) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== ==811== Invalid read of size 1 ==811== at 0x635D849: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1294) ==811== by 0x6330EC1: vfprintf (vfprintf.c:1636) ==811== by 0x4EA04FD: log(LOG_LEVEL, char const*, ...) (logs.cc:183) ==811== by 0x4F05BAD: rina::NetlinkManager::_sendMessage(rina::BaseNetlinkMessage*, nl_msg*) (netlink-manager.cc:182) ==811== by 0x4F05DF3: rina::NetlinkManager::sendMessage(rina::BaseNetlinkMessage*) (netlink-manager.cc:204) ==811== by 0x4EA4BBF: rina::RINAManager::sendMessage(rina::BaseNetlinkMessage*) (core.cc:547) ==811== by 0x4ECAB66: rina::initializeIPCManager(unsigned int, std::string const&, std::string const&, std::string const&, std::string const&) (ipc-manager.cc:70) ==811== by 0x41BB22: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:80) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== Address 0x69310de is 254 bytes inside a block of size 537 free'd ==811== at 0x4C2A360: operator delete(void*) (vg_replace_malloc.c:507) ==811== by 0x4EF35A7: _M_dispose (basic_string.h:555) ==811== by 0x4EF35A7: ~basic_string (basic_string.h:547) ==811== by 0x4EF35A7: ~basic_stringbuf (sstream:64) ==811== by 0x4EF35A7: ~basic_stringstream (sstream:565) ==811== by 0x4EF35A7: rina::BaseNetlinkMessage::toString() (netlink-messages.cc:150) ==811== by 0x4F05B93: rina::NetlinkManager::_sendMessage(rina::BaseNetlinkMessage*, nl_msg*) (netlink-manager.cc:182) ==811== by 0x4F05DF3: rina::NetlinkManager::sendMessage(rina::BaseNetlinkMessage*) (netlink-manager.cc:204) ==811== by 0x4EA4BBF: rina::RINAManager::sendMessage(rina::BaseNetlinkMessage*) (core.cc:547) ==811== by 0x4ECAB66: rina::initializeIPCManager(unsigned int, std::string const&, std::string const&, std::string const&, std::string const&) (ipc-manager.cc:70) ==811== by 0x41BB22: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:80) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== ==811== Invalid read of size 1 ==811== at 0x636E60B: __GI_mempcpy (memcpy.S:71) ==811== by 0x635D796: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1312) ==811== by 0x6330EC1: vfprintf (vfprintf.c:1636) ==811== by 0x4EA04FD: log(LOG_LEVEL, char const*, ...) (logs.cc:183) ==811== by 0x4F05BAD: rina::NetlinkManager::_sendMessage(rina::BaseNetlinkMessage*, nl_msg*) (netlink-manager.cc:182) ==811== by 0x4F05DF3: rina::NetlinkManager::sendMessage(rina::BaseNetlinkMessage*) (netlink-manager.cc:204) ==811== by 0x4EA4BBF: rina::RINAManager::sendMessage(rina::BaseNetlinkMessage*) (core.cc:547) ==811== by 0x4ECAB66: rina::initializeIPCManager(unsigned int, std::string const&, std::string const&, std::string const&, std::string const&) (ipc-manager.cc:70) ==811== by 0x41BB22: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:80) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== Address 0x69310de is 254 bytes inside a block of size 537 free'd ==811== at 0x4C2A360: operator delete(void*) (vg_replace_malloc.c:507) ==811== by 0x4EF35A7: _M_dispose (basic_string.h:555) ==811== by 0x4EF35A7: ~basic_string (basic_string.h:547) ==811== by 0x4EF35A7: ~basic_stringbuf (sstream:64) ==811== by 0x4EF35A7: ~basic_stringstream (sstream:565) ==811== by 0x4EF35A7: rina::BaseNetlinkMessage::toString() (netlink-messages.cc:150) ==811== by 0x4F05B93: rina::NetlinkManager::_sendMessage(rina::BaseNetlinkMessage*, nl_msg*) (netlink-manager.cc:182) ==811== by 0x4F05DF3: rina::NetlinkManager::sendMessage(rina::BaseNetlinkMessage*) (netlink-manager.cc:204) ==811== by 0x4EA4BBF: rina::RINAManager::sendMessage(rina::BaseNetlinkMessage*) (core.cc:547) ==811== by 0x4ECAB66: rina::initializeIPCManager(unsigned int, std::string const&, std::string const&, std::string const&, std::string const&) (ipc-manager.cc:70) ==811== by 0x41BB22: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:80) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== 811(1422958582)#netlink-manager (DBG): Sent message of 110301407 bytes. 0 811(1422958582)#ipcm (DBG): IPC Manager daemon initialized ==811== Invalid read of size 1 ==811== at 0x6330F00: vfprintf (vfprintf.c:1636) ==811== by 0x4EA04FD: log(LOG_LEVEL, char const*, ...) (logs.cc:183) ==811== by 0x41BB48: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:82) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== Address 0x400 is not stack'd, malloc'd or (recently) free'd ==811== ==811== ==811== Process terminating with default action of signal 11 (SIGSEGV) ==811== Access not within mapped region at address 0x400 ==811== at 0x6330F00: vfprintf (vfprintf.c:1636) ==811== by 0x4EA04FD: log(LOG_LEVEL, char const*, ...) (logs.cc:183) ==811== by 0x41BB48: rinad::IPCManager::init(std::string const&, std::string const&) (ipcm.cc:82) ==811== by 0x40E3C2: wrapped_main(int, char**) (main.cc:115) ==811== by 0x40C635: main (main.cc:134) ==811== If you believe this happened as a result of a stack ==811== overflow in your program's main thread (unlikely but ==811== possible), you can try to increase the size of the ==811== main thread stack using the --main-stacksize= flag. ==811== The main thread stack size used in this run was 8388608. 811(1422958582)#ipcm (DBG): installation path: ==811== ==811== HEAP SUMMARY: ==811== in use at exit: 57,724 bytes in 539 blocks ==811== total heap usage: 4,270 allocs, 3,731 frees, 242,031 bytes allocated ==811== ==811== LEAK SUMMARY: ==811== definitely lost: 0 bytes in 0 blocks ==811== indirectly lost: 0 bytes in 0 blocks ==811== possibly lost: 15,196 bytes in 401 blocks ==811== still reachable: 42,528 bytes in 138 blocks ==811== suppressed: 0 bytes in 0 blocks ==811== Rerun with --leak-check=full to see details of leaked memory ==811== ==811== For counts of detected and suppressed errors, rerun with: -v ==811== ERROR SUMMARY: 5 errors from 4 contexts (suppressed: 0 from 0) Killed root@rina:/home/marc/sandbox/bin#
root@rina:/home/marc/sandbox/bin# cat ../etc/ipcmanager.conf { "localConfiguration" : { "installationPath" : "/home/marc/sandbox/bin", "libraryPath" : "/home/marc/sandbox/lib", "consolePort" : 32766, "cdapTimeoutInMs" : 10000, "enrollmentTimeoutInMs" : 10000, "flowAllocatorTimeoutInMs" : 15000, "watchdogPeriodInMs" : 60000, "declaredDeadIntervalInMs" : 120000, "neighborsEnrollerPeriodInMs" : 10000, "maxEnrollmentRetries" : 3, "lengthOfFlowQueues" : 10 }, "applicationToDIFMappings" : [ { "encodedAppName" : "rina.utils.apps.echo.server-1--", "difName" : "normal.DIF" }, { "encodedAppName" : "rina.utils.apps.echo.client-1--", "difName" : "normal.DIF" }, { "encodedAppName" : "rina.utils.apps.rinaperf.server-1--", "difName" : "normal.DIF" }, { "encodedAppName" : "rina.utils.apps.rinaperf.client-1--", "difName" : "normal.DIF" }], "ipcProcessesToCreate" : [ { "type" : "shim-eth-vlan", "apName" : "test-eth-vlan", "apInstance" : "1", "difName" : "100" }, { "type" : "normal-ipc", "apName" : "test1.IRATI", "apInstance" : "1", "difName" : "normal.DIF", "difsToRegisterAt" : ["100"] } ], "difConfigurations" : [ { "difName" : "100", "difType" : "shim-eth-vlan", "configParameters" : { "interface-name" : "eth1" } }, { "difName" : "normal.DIF", "difType" : "normal-ipc", "dataTransferConstants" : { "addressLength" : 2, "cepIdLength" : 2, "lengthLength" : 2, "portIdLength" : 2, "qosIdLength" : 2, "sequenceNumberLength" : 4, "maxPduSize" : 10000, "maxPduLifetime" : 30 }, "qosCubes" : [ { "name" : "unreliablewithflowcontrol", "id" : 1, "partialDelivery" : false, "orderedDelivery" : false, "efcpPolicies" : { "dtcpPresent" : true, "dtcpConfiguration" : { "rtxControl" : false, "flowControl" : true, "flowControlConfig" : { "rateBased" : false, "windowBased" : true, "windowBasedConfig" : { "maxClosedWindowQueueLength" : 200, "initialCredit" : 50 } } } } }, { "name" : "reliablewithflowcontrol", "id" : 2, "partialDelivery" : false, "orderedDelivery" : false, "efcpPolicies" : { "dtcpPresent" : true, "dtcpConfiguration" : { "rtxControl" : true, "rtxControlConfig" : { "dataRxmsNmax" : 5, "initialRtxTime" : 20 }, "flowControl" : true, "flowControlConfig" : { "rateBased" : false, "windowBased" : true, "windowBasedConfig" : { "maxClosedWindowQueueLength" : 200, "initialCredit" : 50 } } } } } ], "knownIPCProcessAddresses" : [ { "apName" : "test1.IRATI", "apInstance" : "1", "address" : 16 }, { "apName" : "test2.IRATI", "apInstance" : "1", "address" : 17 } ], "addressPrefixes" : [ { "addressPrefix" : 0, "organization" : "N.Bourbaki" }, { "addressPrefix" : 16, "organization" : "IRATI" } ], "pdufTableGeneratorConfiguration" : { "pduFtGeneratorPolicy" : { "name" : "LinkState", "version" : "0" }, "linkStateRoutingConfiguration" : { "objectMaximumAge" : 10000, "waitUntilReadCDAP" : 5001, "waitUntilError" : 5001, "waitUntilPDUFTComputation" : 103, "waitUntilFSODBPropagation" : 101, "waitUntilAgeIncrement" : 997, "routingAlgorithm" : "Dijkstra" } } } ] }