title: Navigation hierarchy error in omnet: Simulation terminated with exit code: 139
body: <p>I am trying to navigate to a 2 level up module using following code:- </p>
  
  <pre><code>cModule* parentmod = getParentModule();
  cModule* grantParentmod = parentmod-&gt;getParentModule();
  
  for (cSubModIterator iter(*grantParentmod); !iter.end();iter++)
      EV&lt;&lt;"Current module is "&lt;&lt; iter()-&gt;getFullName() &lt;&lt;endl;
  </code></pre>
  
  <p>And the output is:- </p>
  
  <pre><code>Current module is notificationBoard
  Current module is mobility
  Current module is udpApp[0]
  Current module is udpApp[1]
  Current module is udp
  Current module is networkLayer
  Current module is routingTable
  Current module is interfaceTable
  Current module is wlan[0]
  </code></pre>
  
  <p>However when I directly try to access udpApp[0] through the following code:-</p>
  
  <pre><code>cModule* parentmod = getParentModule();
  cModule* grantParentmod = parentmod-&gt;getParentModule();
  
  cModule* udpmod = parentmod-&gt;getParentModule()-&gt;getSubmodule("udpApp[0]");
  EV&lt;&lt;"Current module is "&lt;&lt; udpmod-&gt;getFullName() &lt;&lt;endl;
  </code></pre>
  
  <p>Simulation end at run time with following error: <strong>Simulation terminated with exit code: 139</strong>, which means a segmentation fault. However if I use any other module like 'mobility' instead of 'udpApp[0]' then it works fine.</p>
  
  <p>Can anybody please help me to figure out a possible way to resolve this situation. </p>