NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/45013 assertion failure in ucomstart in ucom.c with a two CDC ACM devices



The following reply was made to PR kern/45013; it has been noted by GNATS.

From: Michael van Elst <mlelstv%serpens.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/45013 assertion failure in ucomstart in ucom.c  with a two
 CDC ACM devices
Date: Mon, 1 Oct 2012 21:08:49 +0200

 The crash happens also in -current with no CDC ACM but one uftdi device.
 
 Apparently the failing assertion in ucom.c is a bit bold, because it
 assumes that TS_BUSY t_state always correlates with no free output
 buffer. I don't think that you can rely on this.
 
 I have changed the assertion as following:
 
 Index: ucom.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/ucom.c,v
 retrieving revision 1.99
 diff -u -r1.99 ucom.c
 --- ucom.c     6 Mar 2012 03:35:29 -0000       1.99
 +++ ucom.c     1 Oct 2012 19:03:29 -0000
 @@ -1002,7 +1002,10 @@
                goto out;
  
        ub = SIMPLEQ_FIRST(&sc->sc_obuff_free);
 -      KASSERT(ub != NULL);
 +      if (ub == NULL) {
 +              SET(tp->t_state, TS_BUSY);
 +              goto out;
 +      }
        SIMPLEQ_REMOVE_HEAD(&sc->sc_obuff_free, ub_link);
  
        if (SIMPLEQ_FIRST(&sc->sc_obuff_free) == NULL)
 
 
 
 Greetings,
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index