• Bug#164753: [Fwd: Bubblemon crash on network interface down [patch]]

    From Johan Walles@1:229/2 to Thomas Morin on Sun Aug 15 18:00:10 2004
    From: [email protected]

    While I don't doubt you when you say this makes you not see the crash
    anymore, AFAICT the patch is faulty.

    There is a global list called "interfaces". The lines you mention...

    interface->next = interfaces;
    interfaces = interface;

    ... puts the new interface at the start of the interfaces list.

    There are two cases. Either interfaces is NULL, in which case this will happen:

    interface->next = NULL;
    interfaces = interface;

    Or, interfaces points to firstInterface:

    interface->next = firstInterface;
    interfaces = interface;

    Both cases seem like an ordinary list insert to me.

    With your patch, instead of linking the new interface onto the start of
    the list, the function puts the new interface as the *only* interface on
    the list.

    Cheers //Johan

    Thomas Morin wrote:


    ------------------------------------------------------------------------

    Subject:
    Bubblemon crash on network interface down [patch]
    From:
    Thomas Morin <[email protected]>
    Date:
    Thu, 12 Aug 2004 22:31:57 +0200
    To:
    [email protected]

    To:
    [email protected]
    CC:
    [email protected], [email protected], [email protected]


    |retitle| 164753 removing a network card segfaults bubblemon
    tags 164753 + patch
    thanks

    Hi,

    I've been running into this bug many times in the last days : each time
    I unplug my laptop network connector, bubblemon is segfaulting.
    Today I looked more closely :
    - same backtrace as the one mentioned in this bug report, ending in the netload_reportBack function
    - I noticed a strange thing in the netload_forcedFindInterface function (called by netload_reportBack), in the portion which is run when no interface is found (netload.c, line 72):

    (interface is a chain struct)

    interface->next = interfaces;
    interfaces = interface;

    This obviously a loop : the chained structure loops onto itself (interfaces->next == interfaces).

    I patched :
    - interface->next = interfaces;
    + interface->next = NULL;

    Then I recompiled the package, installed it, and now the crash doesn't
    happen anymore.
    Yay!

    Now I don't know why it is segfaulting in netload_reportBack (this is
    weird because the struct is not read in this function).
    But well, this loop is definitely a bug, and fixing it seems to avoid
    the segfault (YMMV).

    Could you please apply this patch please ?
    (upstream CC'd)

    I hope this helps,

    -Thomas



    ------------------------------------------------------------------------

    --- netload.c.orig 2004-08-12 19:55:29 +0200
    +++ netload.c 2004-08-12 19:40:39 +0200
    @@ -72,7 +72,7 @@

    interface->isAlive = 0;

    - interface->next = interfaces;
    + interface->next = NULL;
    interfaces = interface;
    }



    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)