It is currently Fri Dec 13, 2019 9:22 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [PATCH] Patch for Dynamips.
PostPosted: Sun Nov 11, 2012 6:04 am 
Offline

Joined: Sun Nov 04, 2012 8:11 pm
Posts: 19
Location: Buenos Aires, Argentina
Hi! I wrote this patch for Dynamips 0.2.8-RC3-x86 stable Community Edition:

Code:
--- dynamips-0.2.8-RC3-community/common/dev_gt.c    2011-04-11 07:52:37.000000000 -0300
+++ dynamips-0.2.8-RC3-patched/common/dev_gt.c  2012-11-11 01:10:13.180850829 -0300
@@ -1383,6 +1383,9 @@
    if (chan_id >= GT_MPSC_CHANNELS)
       return(-1);

+   if (d == NULL)
+      return(0);
+
    channel = &d->mpsc[chan_id];

    if (channel->nio != NULL) {

Code:
#- Crash test
model = 3725
debug = 0
autostart = False
sparsemem = False
ghostios = True

[localhost]
    port = 7200
    workingdir = /tmp
    udp = 10000
   
    [[3725]]
        image = /opt/ios/c3725-advipservicesk9-mz.124-23.image
        ram = 128
        rom = 16
        nvram = 64
        confreg = 0x2102
   
    [[router ZZZ]]
        model = 3725
        s0/0 = ZZZ s0/1


When I use a 2691, 3725 or a 3745 router with a serial in slot 0 (.net above), run Dynagen and immediately exit (with the exit command), the Dynamips Hypervisor crash with a segment fault. This does not happen when run Dynagen, start the router, and exit (without stop). If I run Dynagen, start and stop the router and then exit, Dynamips Hypervisor crash again. If I use a serial in another slot with network module (s1/1, s2/1, s3/1), Dynamips Hypervisor not crash.

When the router is powered on, the function dev_gt96100_mpsc_set_nio is called once. When the router is powered off, the function dev_gt96100_mpsc_unset_nio is called once. And when exit from Dynagen, the function dev_gt96100_mpsc_unset_nio is called again. In this second call, the 'd' variable is NULL, which causes the crash.

I have tested this in Ubuntu 10.10 and Ubuntu 12.04LTS.

Regards.-




Top
 Profile  
 
 Post subject: Re: [PATCH] Patch for Dynamips.
PostPosted: Fri Nov 16, 2012 6:05 pm 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Hi,

Thanks for the patch :)

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: [PATCH] Patch for Dynamips.
PostPosted: Thu Nov 29, 2012 2:41 am 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
I have integrated your patch to Dynamips's dev repository http://code.gns3.net/dynamips-community

I'll carry on with your other patches.

Thanks again.



_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO