Dear NS-users,

This is a mysterious queue access problem.
>From Mac802_11, I need to access link layer queue variables. Naturally, 
I tried

In mac/mac-802_11.cc,

       LL *l = (LL *)uptarget_;
       fprintf(stdout,"Queue Lnegth: %d\n",l->ifq()->length());

Result is segmentation fault.  I believe I access (LL *)uptarget_ 
without difficulty.
Also according to GDB, "l->ifq()" is a proper (Queue *) instance.

Whenever I try to access any of the member function of ifq(), I get seg 
fault.
I will appreciate it if you have a quick look and provide a 2 line solution.

Thank you,
Jiwoong

------
GNU gdb Red Hat Linux (6.5-15.fc6rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host 
libthread_db library "/lib64/libthread_db.so.1".

(gdb) ns j
Undefined command: "ns".  Try "help".
(gdb) run j
Starting program: /root/ns-allinone-2.30/bin/ns j
num_nodes is set 2
Starting Simulation...

Program received signal SIGSEGV, Segmentation fault.
0x000000000048e55e in Queue::length (this=0x300000003) at 
./queue/queue.h:134
134             int length() { return pq_->length(); }  /* number of 
pkts currently in
(gdb) up
#1  0x00000000004e9621 in Mac802_11::send (this=0xda3690, p=0xe28f00, 
h=0xda6b00) at mac/mac-802_11.cc:2237
2237            fprintf(stdout,"Queue Lnegth: %d\n",l->ifq()->length());
(gdb) display l
1: l = (class LL *) 0xdc0580
(gdb)



Reply via email to