2 Replies Latest reply: Dec 7, 2017 8:02 AM by SHADA AMAN RSS

Can anyone help me to find a solution for this message

SHADA AMAN

Hi,

I'm a student, I have a project on modifying AODV process model to Implement some functions, when I compile my AODV process model with the modification I did It compiles correctly without errors, but when I run the project I get this error

 

<<< Program Fault >>>

program abort -- Invalid Memory Access

T (100), EV (2539), MOD (top.Campus Network.Source_node.ip), KP (op_pro_invoke)

 

and this message from error log file

 

<<< Program Fault >>>

  * Time: 10:04:25 Thu Dec 01 2017

  * Product: modeler (32-bit)

  * Program: op_runsim (Version 14.5.A PL8 Build 7808 32-bit)

  * System: Windows NT 6.1 Build 7601

  * Package: process (aodv_rte) at module (top.Campus Network.Source_node.ip)

  * Function: aodv_rte_route_request_send (<args>)

  * Error: program abort -- Invalid Memory Access

               T (100), EV (2539), MOD (top.Campus Network.Source_node.ip), KP (op_pro_invoke)

 

  * Function call stack: (builds down)

------------------------------------------------------------

             Call   Block

             Count  Line# Function

------------------------------------------------------------

     0) 1    152  0x36777f0b [name not available]

     1) 1   2211  0x00004c00 [name not available]

     2) 1   1358  0x0000c400 [name not available]

     3) 1    399  m3_main

     4) 1   1074  sim_main

     5) 1   2894  sim_ev_loop

     6) 21    384  sim_strm_insert

     7) 2540    880  sim_obj_qps_intrpt

     8) 21     14  ip_rte_central_cpu [ip_central_cpu_wait -> ip_central_cpu_wait : infinite_processing_rate && INCOMING_PACKET / ip_rte_central_cpu_packet_arrival ()]

     9) 1    165  ip_rte_central_cpu_packet_arrival ()

    10) 1    366  ip_rte_central_cpu_send_packet (pkptr)

    11) 1   2275  ip_rte_packet_send (module_data_ptr, pkptr, intf_ici_fdstruct_ptr, process_type)

    12) 183    750  op_pro_invoke (pro_handle, argmem_ptr)

    13) 21     21  manet_mgr [wait exit execs]

    14) 184    750  op_pro_invoke (pro_handle, argmem_ptr)

    15) 1919     13  aodv_rte [wait exit execs]

    16) 1    349  aodv_rte_pkt_arrival_handle (void)

    17) 1    651  aodv_rte_app_pkt_arrival_handle (<args>)

    18) 1   2315  aodv_rte_route_request_send (<args>)

------------------------------------------------------------

 

 

<<< Program Abort >>>

  * Time: 10:04:26 Thu Dec 01 2017

  * Product: modeler (32-bit)

  * Program: op_runsim (Version 14.5.A PL8 Build 7808 32-bit)

  * System: Windows NT 6.1 Build 7601

  * Package: op_runsim

  * Function: sim_runsim_exec

  * Error:

 

  * Function call stack: (builds down)

------------------------------------------------------------

             Call   Block

             Count  Line# Function

------------------------------------------------------------

     0) 1    525  m3_main

     1) 1    352  sim_runsim_exec

------------------------------------------------------------

 

Is there any file I didn't modify it causing this message to appear?

 

Please I need to know what this message mean and how to find a solution for it.

  • Re: Can anyone help me to find a solution for this message
    Paul Conway

    Shada,

      Please note, just because your code compiles it does not mean it is without error.  The model does not have a semantic error, but a dynamic error.

      In the aodv_rte function block, look for line 2315.  It should be within the aodv_rte_route_request_send function.
      The program aborted on the first call to this function, at line 2315.  It aborted due to an invalid memory address being dereferenced.  This could have been a NULL pointer, uninitialized pointer or a stale pointer.

      This function was called by aodv_rte_app_pkt_arrival_handle because an application packet was received without a known route to the destination.  [I learned this by stepping through the call stack starting from the aodv_rte line and reading the comments.]

      The function aodv_rte_route_request_send is meant to broadcast a route request message.

      Based upon the Version 17.5 PL5 model I am looking at, there is about 200 lines of code difference.  I don't know what changes are yours and what were added by Riverbed since Version 14.5 PL8.  So I can't help you narrow the problem down any further.

      I hope this information is helpful to you, and good luck in finding a solution for it.

      Part of programming is detective work.  Be like Sherlock Holmes and analyze the clues.

    • Re: Can anyone help me to find a solution for this message
      SHADA AMAN

      Dear Paul,

       

      Thanks a lot for the information you provide to me , I modified four functions in aodv process model and one of them is aodv_rte_route_request_send function.I tried to discover the problem in the function, but unfortunately I couldn't can you please help in find a solution for my problem .

      the function of aodv_rte_route_request is as follows:

       

       

       

      static void

      aodv_rte_route_request_send (AodvT_Route_Entry* route_entry_ptr, InetT_Address dest_addr, int ttl_value, double request_expiry_time, int rreq_retry)

      {

      int dest_seq_num;

      AodvT_Packet_Option* rreq_option_ptr;

      Packet* rreq_pkptr;

      Packet* ip_rreq_pkptr;

      char addr_str [INETC_ADDR_STR_LEN];

      char node_name [OMSC_HNAME_MAX_LEN];

      char temp_str [256];

      Ici* ip_iciptr;

      int mcast_major_port = IPC_MCAST_ALL_MAJOR_PORTS;

      long tmprng = 0,tmpSHA1 = 0,nbytes;/* These variables upto the int type have been defined to help implement my approach */

      unsigned char seed[20];

      unsigned char top_hash[20];

      int type,length,hash_function,max_hop_count,i;

       

      /*int                         dseq_num,v,fmult;

      double                         mdseq_num = 4294967300;

      int                         dnum = 1000;*/

       

       

      /** Broadcasts a route request message **/

      FIN (aodv_rte_route_request_send (<args>));

       

      /* Initialize the type,length, hash_function and max_hop_count variables */

      type = 64;

      length = 36;/*Number of total bytes in the RREQ extension not including type and length fields in bytes */

      hash_function = 2;

      max_hop_count = ttl_value;

      /*dseq_num =route_entry_ptr-> dest_seq_num;

      v = mdseq_num - dseq_num ;

      fmult = max_hop_count * v;*/

       

      /*Generate a random seed value and initialize the hash field extension with it */

      nbytes = 20;

      tmprng = RNG_NonceData(seed,nbytes);

       

      if(tmprng != 0){

      /*print to enable debugging */

      op_prg_odb_print_major (pid_string, "Error while calculating random number seed in aodv_rte_route_request_send", OPC_NIL);

      }

       

       

      /* Generate the top_hash by hashing the seed max_hop_count times */

       

      tmpSHA1 = SHA1_BytesHash(top_hash,seed,nbytes);

       

       

      for(i=1;i<max_hop_count;i++){

      tmpSHA1 = SHA1_BytesHash(top_hash,top_hash,nbytes);

      }

       

      if(tmpSHA1 != 0){

      /*print to enable debugging */

      op_prg_odb_print_major (pid_string, "Error while calculating hash chain in aodv_rte_route_request_send", OPC_NIL);

      }

       

       

        /* Check if the destination was previous known but */

      /* is marked invalid or whether it expired. */

      /* Get the last known destination sequence number  */

      /* to set in the route request packet. */

      if (aodv_route_table_entry_param_get (route_entry_ptr, AODVC_ROUTE_ENTRY_DEST_SEQ_NUM, &dest_seq_num) == OPC_COMPCODE_FAILURE)

      {

      /* No entry exists to the destination. This */

      /* could be the case if the route expired or a */

      /* route was never discovered */

      dest_seq_num = AODVC_DEST_SEQ_NUM_INVALID;

      }

       

      /* Increment the originating sequence number */

      sequence_number++;

       

      /* Create a route request option */

      rreq_option_ptr = aodv_pkt_support_rreq_SHA1_option_create(OPC_FALSE, OPC_FALSE,

      grat_route_reply_flag, dest_only_flag, OPC_TRUE, 0, route_request_id, dest_addr,

      dest_seq_num, INETC_ADDRESS_INVALID, sequence_number,type,length,hash_function,max_hop_count,top_hash,seed);

       

      if (inet_address_family_get (&dest_addr) == InetC_Addr_Family_v4)

      {

      /* This is an IPv4 destination */

       

      /* Insert the option in an AODV RREQ packet */

      rreq_pkptr = aodv_pkt_support_pkt_create (rreq_option_ptr, AODVC_RREQ_SHA1_IPV4_SIZE);

       

      /* Encapsulate the AODV packet in an IP datagram */

      ip_rreq_pkptr = aodv_rte_ip_datagram_create (rreq_pkptr, InetI_Broadcast_v4_Addr, OPC_NIL,

      ttl_value, InetI_Broadcast_v4_Addr, OPC_NIL);

      }

      else

      {

      /* This is an IPv6 destination */

       

      /* Insert the option in an AODV RREQ packet */

      rreq_pkptr = aodv_pkt_support_pkt_create (rreq_option_ptr, AODVC_RREQ_IPV6_SIZE);

       

      /* Encapsulate the AODV packet in an IP datagram */

      ip_rreq_pkptr = aodv_rte_ip_datagram_create (rreq_pkptr, InetI_Ipv6_All_Nodes_LL_Mcast_Addr, OPC_NIL,

      ttl_value, InetI_Ipv6_All_Nodes_LL_Mcast_Addr, OPC_NIL);

       

      /* Install the ICI for IPv6 case */

      ip_iciptr = op_ici_create ("ip_rte_req_v4");

      op_ici_attr_set_int32 (ip_iciptr, "multicast_major_port", mcast_major_port);

      op_ici_install (ip_iciptr);

      }

       

      if (LTRACE_ACTIVE)

      {

      inet_address_print (addr_str, dest_addr);

      inet_address_to_hname (dest_addr, node_name);

      sprintf (temp_str, "destined to node %s (%s) with Request ID (%d)", addr_str, node_name, route_request_id);

      op_prg_odb_print_major (pid_string, "Broadcasting a route request packet", temp_str, OPC_NIL);

      }

       

      /* Insert the route request in the request table */

      aodv_request_table_orig_rreq_insert (request_table_ptr, route_request_id, dest_addr,

      ttl_value, request_expiry_time, rreq_retry);

       

      /* Update the statistics for the routing traffic sent */

      aodv_support_routing_traffic_sent_stats_update (local_stat_handle_ptr, global_stat_handle_ptr,

      ip_rreq_pkptr);

       

      /* Update the statistics for the total route requests sent */

      op_stat_write (local_stat_handle_ptr->total_requests_sent_shandle, 1.0);

      op_stat_write (global_stat_handle_ptr->total_requests_sent_global_shandle, 1.0);

       

      /* Send the packet to the CPU with jitter which will broadcast it */

      /* after processing the packet */

      manet_rte_to_cpu_pkt_send_schedule_with_jitter (module_data_ptr, parent_prohandle,

      parent_pro_id, ip_rreq_pkptr);

       

      /* Clear the ICI if installed */

      op_ici_install (OPC_NIL);

       

      /* Increment the request ID */

      route_request_id++;

       

      /* Set the last broadcast sent time */

      last_broadcast_sent_time = op_sim_time ();

       

      FOUT;

      }