LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   *** stack smashing detected *** in tcl script (https://www.linuxquestions.org/questions/linux-networking-3/%2A%2A%2A-stack-smashing-detected-%2A%2A%2A-in-tcl-script-4175460553/)

ines8989 05-03-2013 05:19 AM

*** stack smashing detected *** in tcl script
 
Hello i'am simulating a script tcl for wireless tfrc with NS2.35 ; But i have this message:

--------------------------------------
num_nodes is set 5
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
*** stack smashing detected ***: ns terminated
======= Backtrace: =========

======= Memory map: ========
00110000-0012c000 r-xp 00000000 08:01 786025 /lib/i386-linux-gnu/libgcc_s.so.1
0012c000-0012d000 r--p 0001b000 08:01 786025 /lib/i386-linux-gnu/libgcc_s.so.1
0012d000-0012e000 rw-p 0001c000 08:01 786025 /lib/i386-linux-gnu/libgcc_s.so.1
0012e000-00139000 r-xp 00000000 08:01 786045 /lib/i386-linux-gnu/libnss_files-2.13.so
00139000-0013a000 r--p 0000a000 08:01 786045 /lib/i386-linux-gnu/libnss_files-2.13.so
0013a000-0013b000 rw-p 0000b000 08:01 786045 /lib/i386-linux-gnu/libnss_files-2.13.so
00245000-00323000 r-xp 00000000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00323000-00324000 ---p 000de000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00324000-00328000 r--p 000de000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00328000-00329000 rw-p 000e2000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00329000-00330000 rw-p 00000000 00:00 0
0033a000-0033d000 r-xp 00000000 08:01 786015 /lib/i386-linux-gnu/libdl-2.13.so
0033d000-0033e000 r--p 00002000 08:01 786015 /lib/i386-linux-gnu/libdl-2.13.so
0033e000-0033f000 rw-p 00003000 08:01 786015 /lib/i386-linux-gnu/libdl-2.13.so
00482000-0048a000 r-xp 00000000 08:01 786041 /lib/i386-linux-gnu/libnss_compat-2.13.so
0048a000-0048b000 r--p 00007000 08:01 786041 /lib/i386-linux-gnu/libnss_compat-2.13.so
0048b000-0048c000 rw-p 00008000 08:0
----------------------------------------------
I didn't understand the source of this message *** stack smashing detected ***:please help me please

Thanks for you

knudfl 05-03-2013 05:57 AM

Please edit post # 1 to use code tags :
Type [/code] at text end, and [code] at start.
http://www.linuxquestions.org/questi....php?do=bbcode

And you will have to attach the tcl script : As name.tcl.txt please.
Attachments : The paper clip tool in the 'Adcanced Editor'.

-

ines8989 05-03-2013 06:13 AM

*** stack smashing detected *** in tcl script
 
1 Attachment(s)
Thank you for your reply . That's the message that i had . and in the attachement is the script tcl for wireless tfrc that i have simulated .
Quote:

Quote:

num_nodes is set 5
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
*** stack smashing detected ***: ns terminated
======= Backtrace: =========

======= Memory map: ========
00110000-0012c000 r-xp 00000000 08:01 786025 /lib/i386-linux-gnu/libgcc_s.so.1
0012c000-0012d000 r--p 0001b000 08:01 786025 /lib/i386-linux-gnu/libgcc_s.so.1
0012d000-0012e000 rw-p 0001c000 08:01 786025 /lib/i386-linux-gnu/libgcc_s.so.1
0012e000-00139000 r-xp 00000000 08:01 786045 /lib/i386-linux-gnu/libnss_files-2.13.so
00139000-0013a000 r--p 0000a000 08:01 786045 /lib/i386-linux-gnu/libnss_files-2.13.so
0013a000-0013b000 rw-p 0000b000 08:01 786045 /lib/i386-linux-gnu/libnss_files-2.13.so
00245000-00323000 r-xp 00000000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00323000-00324000 ---p 000de000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00324000-00328000 r--p 000de000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00328000-00329000 rw-p 000e2000 08:01 6094 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00329000-00330000 rw-p 00000000 00:00 0
0033a000-0033d000 r-xp 00000000 08:01 786015 /lib/i386-linux-gnu/libdl-2.13.so
0033d000-0033e000 r--p 00002000 08:01 786015 /lib/i386-linux-gnu/libdl-2.13.so
0033e000-0033f000 rw-p 00003000 08:01 786015 /lib/i386-linux-gnu/libdl-2.13.so
00482000-0048a000 r-xp 00000000 08:01 786041 /lib/i386-linux-gnu/libnss_compat-2.13.so
0048a000-0048b000 r--p 00007000 08:01 786041 /lib/i386-linux-gnu/libnss_compat-2.13.so
0048b000-0048c000 rw-p 00008000 08:0

Please help me .Thanks

knudfl 05-03-2013 06:45 AM

Editing post # 1 to code tags : Use the 'Edit' button !

And please delete the quoted text in post # 3. No reason for repeating.


The two usual pieces of information are missing :
OS Name : $ cat /etc/*release* <Enter>
Architecture : $ uname -m <Enter>

And last : Which version of gcc/g++ was used to compile ns-allinone-2.35 ?

-

ines8989 05-03-2013 06:57 AM

***stack smashing detected ***: ns terminated
 
Thanks for your reply .
Code:

num_nodes is set 5
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
*** stack smashing detected ***: ns terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0x2958d5]
/lib/i386-linux-gnu/libc.so.6(+0xe7887)[0x295887]
ns(_ZN8CMUTrace10nam_formatEP6Packeti+0xb81)[0x82d3729]
ns(_ZN8CMUTrace6formatEP6PacketPKc+0x6b)[0x82d379f]
ns(_ZN8CMUTrace4recvEP6PacketP7Handler+0x71)[0x82d3ad3]
ns(_ZN5Agent4sendEP6PacketP7Handler+0x2c)[0x81ee3c4]
ns(_ZN13TfrcSinkAgent7sendpktEd+0x197)[0x83342d9]
ns(_ZN13TfrcSinkAgent7nextpktEd+0x24)[0x83340e2]
ns(_ZN13TfrcSinkAgent4recvEP6PacketP7Handler+0x854)[0x8333e94]
ns(_ZN9Connector4sendEP6PacketP7Handler+0x2c)[0x81e5774]
ns(_ZN8CMUTrace4recvEP6PacketP7Handler+0xb9)[0x82d3b1b]
ns(_ZN10Classifier4recvEP6PacketP7Handler+0x55)[0x81e89f5]
ns(_ZN10Classifier4recvEP6PacketP7Handler+0x55)[0x81e89f5]
ns(_ZN10Classifier4recvEP6PacketP7Handler+0x55)[0x81e89f5]
ns(_ZN10Classifier4recvEP6PacketP7Handler+0x55)[0x81e89f5]
ns(_ZN14HierClassifier4recvEP6PacketP7Handler+0x30)[0x83480e4]
ns(_ZN8NsObject6handleEP5Event+0x27)[0x81e1249]
ns(_ZN9Scheduler8dispatchEP5Eventd+0x94)[0x81de438]
ns(_ZN9Scheduler3runEv+0x2c)[0x81de36c]
ns(_ZN9Scheduler7commandEiPKPKc+0x6b)[0x81de519]
ns(_ZN8TclClass12dispatch_cmdEPvP10Tcl_InterpiPPKc+0x32)[0x83fa43e]
ns[0x83fe0d1]
ns(TclInvokeStringCommand+0x77)[0x8402047]
ns[0x8406e3e]
ns[0x844f971]
ns[0x8457413]
ns[0x844f890]
ns(TclObjInterpProcCore+0x131)[0x84955d1]
ns(TclObjInterpProc+0x69)[0x8495b89]
ns(TclInvokeObjectCommand+0xf3)[0x84021c3]
ns[0x83fe209]
ns(TclInvokeStringCommand+0x77)[0x8402047]
ns[0x8406e3e]
ns[0x844f971]
ns(TclObjInterpProcCore+0x131)[0x84955d1]
ns(TclObjInterpProc+0x69)[0x8495b89]
ns(TclInvokeObjectCommand+0xf3)[0x84021c3]
ns[0x83fe0d1]
ns(TclInvokeStringCommand+0x77)[0x8402047]
ns[0x8406e3e]
ns[0x8408ab4]
ns(Tcl_EvalEx+0x3b)[0x840915b]
ns(Tcl_FSEvalFileEx+0x29c)[0x847544c]
ns(Tcl_Main+0x426)[0x847ad46]
ns(nslibmain+0x20)[0x83f96b0]
ns(main+0x1b)[0x83f980b]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x1c7113]
ns[0x81d36e1]
======= Memory map: ========
00190000-001ac000 r-xp 00000000 08:01 786025    /lib/i386-linux-gnu/libgcc_s.so.1
001ac000-001ad000 r--p 0001b000 08:01 786025    /lib/i386-linux-gnu/libgcc_s.so.1
001ad000-001ae000 rw-p 0001c000 08:01 786025    /lib/i386-linux-gnu/libgcc_s.so.1
001ae000-00324000 r-xp 00000000 08:01 786004    /lib/i386-linux-gnu/libc-2.13.so
00324000-00326000 r--p 00176000 08:01 786004    /lib/i386-linux-gnu/libc-2.13.so
00326000-00327000 rw-p 00178000 08:01 786004    /lib/i386-linux-gnu/libc-2.13.so
00327000-0032a000 rw-p 00000000 00:00 0
00336000-00354000 r-xp 00000000 08:01 785991    /lib/i386-linux-gnu/ld-2.13.so
00354000-00355000 r--p 0001d000 08:01 785991    /lib/i386-linux-gnu/ld-2.13.so
00355000-00356000 rw-p 0001e000 08:01 785991    /lib/i386-linux-gnu/ld-2.13.so
00469000-0046a000 r-xp 00000000 00:00 0          [vdso]
004eb000-004ee000 r-xp 00000000 08:01 786015    /lib/i386-linux-gnu/libdl-2.13.so
004ee000-004ef000 r--p 00002000 08:01 786015    /lib/i386-linux-gnu/libdl-2.13.so
004ef000-004f0000 rw-p 00003000 08:01 786015    /lib/i386-linux-gnu/libdl-2.13.so
008aa000-008d2000 r-xp 00000000 08:01 786034    /lib/i386-linux-gnu/libm-2.13.so
008d2000-008d3000 r--p 00028000 08:01 786034    /lib/i386-linux-gnu/libm-2.13.so
008d3000-008d4000 rw-p 00029000 08:01 786034    /lib/i386-linux-gnu/libm-2.13.so
009fc000-00a11000 r-xp 00000000 08:01 786039    /lib/i386-linux-gnu/libnsl-2.13.so
00a11000-00a12000 r--p 00015000 08:01 786039    /lib/i386-linux-gnu/libnsl-2.13.so
00a12000-00a13000 rw-p 00016000 08:01 786039    /lib/i386-linux-gnu/libnsl-2.13.so
00a13000-00a15000 rw-p 00000000 00:00 0
00a64000-00a6c000 r-xp 00000000 08:01 786041    /lib/i386-linux-gnu/libnss_compat-2.13.so
00a6c000-00a6d000 r--p 00007000 08:01 786041    /lib/i386-linux-gnu/libnss_compat-2.13.so
00a6d000-00a6e000 rw-p 00008000 08:01 786041    /lib/i386-linux-gnu/libnss_compat-2.13.so
00aa8000-00b86000 r-xp 00000000 08:01 6094      /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00b86000-00b87000 ---p 000de000 08:01 6094      /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00b87000-00b8b000 r--p 000de000 08:01 6094      /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00b8b000-00b8c000 rw-p 000e2000 08:01 6094      /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00b8c000-00b93000 rw-p 00000000 00:00 0
00eb6000-00ec1000 r-xp 00000000 08:01 786045    /lib/i386-linux-gnu/libnss_files-2.13.so
00ec1000-00ec2000 r--p 0000a000 08:01 786045    /lib/i386-linux-gnu/libnss_files-2.13.so
00ec2000-00ec3000 rw-p 0000b000 08:01 786045    /lib/i386-linux-gnu/libnss_files-2.13.so
00f19000-00f23000 r-xp 00000000 08:01 786049    /lib/i386-linux-gnu/libnss_nis-2.13.so
00f23000-00f24000 r--p 00009000 08:01 786049    /lib/i386-linux-gnu/libnss_nis-2.13.so
00f24000-00f25000 rw-p 0000a000 08:01 786049    /lib/i386-linux-gnu/libnss_nis-2.13.so
08048000-0862c000 r-xp 00000000 08:01 414275    /home/ines/ns-allinone-2.35/ns-2.35/ns
0862c000-0862f000 r--p 005e3000 08:01 414275    /home/ines/ns-allinone-2.35/ns-2.35/ns
0862f000-086cb000 rw-p 005e6000 08:01 414275    /home/ines/ns-allinone-2.35/ns-2.35/ns
086cb000-086d3000 rw-p 00000000 00:00 0
093d4000-097f8000 rw-p 00000000 00:00 0          [heap]
b7319000-b7566000 rw-p 00000000 00:00 0
b7566000-b756d000 r--s 00000000 08:01 131676    /usr/lib/i386-linux-gnu/gconv/gconv-modules.cache
b756d000-b756e000 r--p 00859000 08:01 6993      /usr/lib/locale/locale-archive
b756e000-b75ae000 r--p 002bd000 08:01 6993      /usr/lib/locale/locale-archive
b75ae000-b77ae000 r--p 00000000 08:01 6993      /usr/lib/locale/locale-archive
b77ae000-b77b1000 rw-p 00000000 00:00 0
b77c5000-b77c7000 rw-p 00000000 00:00 0
bfda9000-bfdca000 rw-p 00000000 00:00 0          [stack]
Aborted


knudfl 05-03-2013 07:10 AM

Please remove the "Backtrace" text from posts #1 and #3.

You have some difficulties finding that 'Edit' button, haven't you ? :)


And please read my edited post #4.

-

ines8989 05-03-2013 07:26 AM

*** stack smashing detected *** in tcl script
 
i use the linux mint version of linux with oracle virtual machin
this is the informations of my system
name : i686
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=12
DISTRIB_CODENAME=lisa
DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"

But the version of GCC i think that is 1.4
Please tell me haw can i avoide this message and why did i get it . :
juste an indication i have simulated the same tcl script but i have changed it to simulate tcp wireless and i did'nt have this message it runs well i have this message only while executing tfrc wireless

knudfl 05-03-2013 08:06 AM

# 7. Mint 12 : That's basically Ubuntu 11.10 .

The default compilers for Mint 12 are g++-4.4, g++-4.5, g++-4.6.
If you do nothing to choose a compiler, gcc/g++ -4.6 will be used.

Installing ns-allinone-2.35 :
1) cd ns-allinone-2.35/
2) export CC=gcc-4.4 CXX=g++-4.4 && ./install
3) cd ns-2.35/
4) cp ns ns235-orig : Then you have a backup with no patches.
5) sudo cp ns235-orig /usr/local/bin/
... Then you can type $ ns235-orig dccp-wireless.tcl : EDIT :
EDIT, sorry, this one : $ ns235-orig tfrc-wireless.tcl

-

ines8989 05-03-2013 08:12 AM

*** stack smashing detected *** in tcl script
 
Thanks a lot for your reply .

But i want to execute tfrc-wireless.tcl the code that i have sent for you not dccp-wireless.tcl .
i must write this steps before taping ns tfrc-wireless.tcl ?

knudfl 05-03-2013 11:18 AM

# 9 .

Sorry, got things mixed up .

No issues here with $ ns tfrc-wireless.tcl
... where "ns" means any properly built ns from ns-2.34 or ns-2.35 .
And $ nam wafa.nam : OK too.

Did you use any patches for ns-2.35 ? ?

What is the text in ns-2.35/Makefile, line 37 ?
Should be : CPP = g++-4.4

And what did you do to change the error from "buffer overflow .."
to "stack smashing .." ? ?
http://ubuntuforums.org/showthread.php?t=2138279

-

ines8989 05-04-2013 06:30 AM

*** stack smashing detected *** in tcl script
 
I would thank you a lot mr knudfl for your reply . I didn't use any patche for ns2.35 i juste installed it successfully.

And the message of stack smaching appears only when i execute the file tfrc-wireless.tcl i executed the same script juste i changed the agents for tcp to simulate tcp-wireless and it works well.

Before reinstalling ns2.35 i had the message buffer overflow . But after reinstalling ns2.35 successfully i have the message
stack smashing with the tfrc-wireless file .
I have seen in my makefile there is : CPP = g++

knudfl 05-04-2013 07:53 AM

# 11.
Quote:

I have seen in my makefile there is : CPP = g++
OK.
Then better set up another ns-allinone-2.35 to try achieving a better result.
You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. But do not add any PATH text to .bashrc.
Not required. The executable 'ns' will know the location of it's libraries.
Example, having multiple ns2 :
/home/name/a/ns-allinone-2.35/
/home/name/b/ns-allinone-2.35/
/home/name/c/ns-allinone-2.35/
/home/name/a/ns-allinone-2.33/
/home/name/a/ns-allinone-2.34/
/home/name/b/ns-allinone-2.34/

And how to keep track of "40" different ns2 ? Very simple :
Just use different names for the executable ns : ns235-1 ns235-2 ns234, etc.
Your file "tfrc-wireless file" was executed OK here yesterday with :
1) $ ns235 tfrc-wireless file 2) $ ns234 tfrc-wireless
3) $ ns234-tora tfrc-wireless
.... ( I have about 50 different 'ns', renamed to <other-name>.)


The correct way of installing ns-allinone-2.35 :
export CC=gcc-4.4 CXX=g++-4.4 && ./install


-

ines8989 05-04-2013 08:14 AM

*** stack smashing detected *** in tcl script
 
Thank you a lot for you help . I didn't find in the net other nsé.35.tar.gz file to install other then in the site
www.sourceforge.net

Have you please any other source to download from it ns2.35 or i suggest you me to try with the ns2.34 ?
wihile installing ns2.35 i have swited this steps :
sudo apt-get update

sudo apt-get install build-essential autoconf automake libxmu-dev

tar zxvf ns-allinone-2.35.tar.gz
cd ns-allinone-2.35

./install
are they true ? should i juste add export CC=gcc-4.4 CXX=g++-4.4 && ./install better than /install ?
Thanks for you

ines8989 05-04-2013 09:24 AM

*** stack smashing detected *** in tcl script
 
If i try with ns2.34 should i type also export CC=gcc-4.4 CXX=g++-4.4 && ./install ?

knudfl 05-04-2013 09:28 AM

# 13 .

Yes, the correct install for ns-2.35 / Ubuntu 11.10 .. 13.04 is :
export CC=gcc-4.4 CXX=g++-4.4 && ./install


You will of course have to install the "4.4 compilers" beforehand :
sudo apt-get install g++-4.4

-


All times are GMT -5. The time now is 06:14 AM.