mangesht / cs555sim

Automatically exported from code.google.com/p/cs555sim
0 stars 0 forks source link

Segmentation fault on running sim binary #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

 Execute the sim

What is the expected output? What do you see instead?

  -bash-3.00# ./sim 
Cur Time hh 3 MM 0 SS 9 gmtoff = -28800 
Cur Time hh 3 MM 0 SS 9 gmtoff = -28800 
Cur Time hh 3 MM 0 SS 9 gmtoff = -28800 
Cur Time hh 3 MM 0 SS 9 gmtoff = -28800 
Cur Time hh 3 MM 0 SS 9 gmtoff = -28800 
Adding first item
Insertion done 
Added arrival for time 0.421144 
Time : 0.421144 
Processing event 0 
Packet pushed to pktBuffer 
Adding first item
Insertion done 
Added arrival for time 0.442291 
Inserting 
In forward direction 
Calling after 
Insertion done 
Service started for packet aTime = 0.421144 by server = 1 to be over by 0.670886
Time : 0.442291 
Processing event 0 
Packet pushed to pktBuffer 
Inserting 
In backward direction 
Start = 0.670886 tail = 0.670886 pos = 0.670886 item = 0.454470 
Insertion done 
Added arrival for time 0.454470 
Inserting 
In backward direction 
Start = 0.454470 tail = 0.670886 pos = 0.454470 item = 0.449362 
Insertion done 
Service started for packet aTime = 0.442291 by server = 0 to be over by 0.449362
Time : 0.449362 
Processing event 1 
Time : 0.454470 
Processing event 0 
Packet pushed to pktBuffer 
Inserting 
In backward direction 
Start = 0.670886 tail = 0.670886 pos = 0.670886 item = 0.537366 
Insertion done 
Added arrival for time 0.537366 
Inserting 
In backward direction 
Start = 0.537366 tail = 0.670886 pos = 0.537366 item = 0.454470 
Insertion done 
Service started for packet aTime = 0.454470 by server = 1 to be over by 0.454470
Time : 0.454470 
Processing event 1 
Time : 0.537366 
Processing event 0 
Packet pushed to pktBuffer 
Inserting 
In forward direction 
Calling after 
Insertion done 
Added arrival for time 0.975575 
Inserting 
In backward direction 
Start = 0.670886 tail = 0.975575 pos = 0.670886 item = 0.537366 
Insertion done 
Service started for packet aTime = 0.537366 by server = 0 to be over by 0.537366
Time : 0.537366 
Processing event 1 
Time : 0.670886 
Processing event 1 
Segmentation fault (core dumped)
-bash-3.00# 

What version of the product are you using? On what operating system?

 -bash-3.00# cat /etc/redhat-release 
Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
-bash-3.00# 

Please provide any additional information below.

-bash-3.00# gdb sim core.11291 
GNU gdb Red Hat Linux (6.3.0.0-1.96rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...(no debugging symbols 
found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

Core was generated by `./sim'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libstdc++.so.6...(no debugging symbols 
found)...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x009e9183 in initstate_r ()
   from /lib/tls/libc.so.6
(gdb) print
The history is empty.
(gdb) 

Original issue reported on code.google.com by sshah...@hawk.iit.edu on 3 Dec 2012 at 11:23

GoogleCodeExporter commented 8 years ago
Its bare minimum done.
 I need to print seed. I guess I commented those lines. The use of same
seed  will reproduce the issue.
What causes Segmentation fafault

Original comment by mangesh....@gmail.com on 3 Dec 2012 at 2:01

GoogleCodeExporter commented 8 years ago
I ran gdb it shows

#0  0x009e9183 in initstate_r ()
   from /lib/tls/libc.so.6

-bash-3.00# grep initstate_r *
Binary file sim matches
simLibAdv.h:    int r= initstate_r(seed,state,64,rand_state);
-bash-3.00# 

Common problem with this function is discussed in the below forum but I have no 
idea what is causing the segmentaion fault in this function call.
http://stackoverflow.com/questions/4167034/c-initstate-r-crashing

Original comment by sshah...@hawk.iit.edu on 3 Dec 2012 at 3:31