Bug 285255 - Invalid pointer access by commit 02cf7ee8
Summary: Invalid pointer access by commit 02cf7ee8
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Miscellaneous
Component: Plasma Widget (show other bugs)
Version: 0.9
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
: 285644 286549 287119 287154 287290 287306 287389 287686 287947 288738 288820 289903 290530 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-29 13:31 UTC by Will Stephenson
Modified: 2012-01-03 20:55 UTC (History)
16 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.8.98 (0.9.0_rc3)


Attachments
New crash information added by DrKonqi (17.68 KB, text/plain)
2011-12-03 16:48 UTC, Roar Lauritzsen
Details
New crash information added by DrKonqi (7.00 KB, text/plain)
2011-12-06 18:27 UTC, wolfblitz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Will Stephenson 2011-10-29 13:31:49 UTC
Version:           0.9 (using KDE 4.7.2) 
OS:                Linux

PNM crashes plasma on resume from suspend.  The reason is commit 02cf7ee8, which tries to access the members of m_activeInterface in NetworkManagerApplet::networkInterfaceRemoved(). On networkInterfaceRemoved signal, you must assume that any stored pointers to NetworkInterfaces may be the removed ones and are invalid.


void NetworkManagerApplet::networkInterfaceRemoved(const QString & uni)
 {
-    Q_UNUSED(uni);
     // update the tray icon
     m_interfaces = Solid::Control::NetworkManagerNm09::networkInterfaces();
-    KConfigGroup cg = config();
 
+    if (uni == m_activeInterface->uni()) {

in this case upon networkInterfaceRemoved, m_activeInterface is invalid.

Reproducible: Always

Steps to Reproduce:
Suspend and resume the machine.


Expected Results:  
No crash.
Comment 1 Lamarque V. Souza 2011-10-29 18:30:24 UTC
Git commit b584c6aff8b70e62ad78da3efb34b0347a67095e by Lamarque V. Souza.
Committed on 29/10/2011 at 20:26.
Pushed by lvsouza into branch 'master'.

Cache NetworkManager::Device's uni to prevent crashes when resuming from
disk and the device pointer has already been deleted but the uni is
still needed for clean up.

BUG: 285255

M  +41   -18   applet/networkmanager.cpp
M  +7    -0    applet/networkmanager.h
M  +1    -1    plasma_nm_version.h

http://commits.kde.org/networkmanagement/b584c6aff8b70e62ad78da3efb34b0347a67095e
Comment 2 Lamarque V. Souza 2011-10-29 18:38:59 UTC
Git commit 4bca48877d4c4679cc444f533fbcd54852c09f4a by Lamarque V. Souza.
Committed on 29/10/2011 at 20:26.
Pushed by lvsouza into branch 'nm09'.

Cache Solid::Control::NetworkInterface's uni to prevent crashes when resuming from
disk and the device pointer has already been deleted but the uni is
still needed for clean up.

BUG: 285255

M  +41   -18   applet/networkmanager.cpp
M  +7    -0    applet/networkmanager.h
M  +1    -1    plasma_nm_version.h

http://commits.kde.org/networkmanagement/4bca48877d4c4679cc444f533fbcd54852c09f4a
Comment 3 Lamarque V. Souza 2011-10-29 20:59:30 UTC
Git commit cfdb122c7d291585d54179f08460ccbe729f9a94 by Lamarque V. Souza.
Committed on 29/10/2011 at 22:58.
Pushed by lvsouza into branch 'master'.

Actually we cannot clear this QString or it will not work as intented.

CCBUG: 285255

M  +1    -0    applet/interfacedetailswidget.cpp
M  +0    -4    applet/networkmanager.cpp

http://commits.kde.org/networkmanagement/cfdb122c7d291585d54179f08460ccbe729f9a94
Comment 4 Lamarque V. Souza 2011-10-29 21:00:15 UTC
Git commit ecc28c8139349b44c63ff625aac49ecbf7842e26 by Lamarque V. Souza.
Committed on 29/10/2011 at 22:58.
Pushed by lvsouza into branch 'nm09'.

Actually we cannot clear this QString or it will not work as intented.

CCBUG: 285255
(cherry picked from commit cfdb122c7d291585d54179f08460ccbe729f9a94)

M  +1    -0    applet/interfacedetailswidget.cpp
M  +0    -4    applet/networkmanager.cpp

http://commits.kde.org/networkmanagement/ecc28c8139349b44c63ff625aac49ecbf7842e26
Comment 5 Lamarque V. Souza 2011-11-03 15:37:50 UTC
*** Bug 285644 has been marked as a duplicate of this bug. ***
Comment 6 Lamarque V. Souza 2011-11-14 04:20:52 UTC
*** Bug 286549 has been marked as a duplicate of this bug. ***
Comment 7 Lamarque V. Souza 2011-11-21 02:40:18 UTC
*** Bug 287119 has been marked as a duplicate of this bug. ***
Comment 8 Lamarque V. Souza 2011-11-21 12:55:43 UTC
*** Bug 287154 has been marked as a duplicate of this bug. ***
Comment 9 Lamarque V. Souza 2011-11-22 20:17:11 UTC
*** Bug 287290 has been marked as a duplicate of this bug. ***
Comment 10 Lamarque V. Souza 2011-11-23 01:10:25 UTC
*** Bug 287306 has been marked as a duplicate of this bug. ***
Comment 11 Lamarque V. Souza 2011-11-23 18:57:26 UTC
*** Bug 287389 has been marked as a duplicate of this bug. ***
Comment 12 Lamarque V. Souza 2011-11-27 16:27:28 UTC
*** Bug 287686 has been marked as a duplicate of this bug. ***
Comment 13 Lamarque V. Souza 2011-11-30 22:59:25 UTC
*** Bug 287947 has been marked as a duplicate of this bug. ***
Comment 14 Roar Lauritzsen 2011-12-03 16:48:03 UTC
Created attachment 66340 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.7.2 (4.7.2) "release 5" using Qt 4.7.4

- What I was doing when the application crashed:
Fresh install of suse 12.1 on Thinkpad X220. Closed the lid, opened it -> Crash. 100% Reproducable. Can I please get a software update soon?

- Unusual behavior I noticed:
Nothing before the crash

- Custom settings of the application:
Nothing special

-- Backtrace (Reduced):
#6  Solid::Control::NetworkInterfaceNm09::uni (this=0x0) at /usr/src/debug/networkmanagement/solidcontrolfuture/libs/solid/control/networkinterface.cpp:65
#7  0x00007f386ab50a70 in NetworkManagerApplet::networkInterfaceRemoved (this=0x100b8b0, uni=...) at /usr/src/debug/networkmanagement/applet/networkmanager.cpp:501
#8  0x00007f386ab523fa in NetworkManagerApplet::qt_metacall (this=0x100b8b0, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff52cfd990) at /usr/src/debug/networkmanagement/build/applet/networkmanager.moc:126
[...]
#10 0x00007f386a02e185 in Solid::Control::NetworkManagerNm09::Notifier::networkInterfaceRemoved (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/networkmanagement/build/solidcontrolfuture/libs/solid/control/networkmanager.moc:123
#11 0x00007f386a02e6e1 in Solid::Control::NetworkManagerNm09Private::_k_networkInterfaceRemoved (this=0xff3360, uni=...) at /usr/src/debug/networkmanagement/solidcontrolfuture/libs/solid/control/networkmanager.cpp:229
Comment 15 wolfblitz 2011-12-06 18:27:26 UTC
Created attachment 66447 [details]
New crash information added by DrKonqi

plasma-desktop (0.4) on KDE Platform 4.7.2 (4.7.2) "release 5" using Qt 4.7.4

- What I was doing when the application crashed:
Resumed my computer from suspend to RAM after it automatically suspended due to battery power running low.

-- Backtrace (Reduced):
#6  Solid::Control::NetworkInterfaceNm09::uni (this=0x0) at /usr/src/debug/networkmanagement/solidcontrolfuture/libs/solid/control/networkinterface.cpp:65
#7  0x00007f97a68e4a70 in NetworkManagerApplet::networkInterfaceRemoved (this=0xf5c230, uni=...) at /usr/src/debug/networkmanagement/applet/networkmanager.cpp:501
#8  0x00007f97a68e63fa in NetworkManagerApplet::qt_metacall (this=0xf5c230, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff647380b0) at /usr/src/debug/networkmanagement/build/applet/networkmanager.moc:126
[...]
#10 0x00007f97a5dc2185 in Solid::Control::NetworkManagerNm09::Notifier::networkInterfaceRemoved (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/networkmanagement/build/solidcontrolfuture/libs/solid/control/networkmanager.moc:123
#11 0x00007f97a5dc26e1 in Solid::Control::NetworkManagerNm09Private::_k_networkInterfaceRemoved (this=0xf4b1a0, uni=...) at /usr/src/debug/networkmanagement/solidcontrolfuture/libs/solid/control/networkmanager.cpp:229
Comment 16 Lamarque V. Souza 2011-12-12 10:50:41 UTC
*** Bug 288738 has been marked as a duplicate of this bug. ***
Comment 17 Lamarque V. Souza 2011-12-13 02:22:36 UTC
*** Bug 288820 has been marked as a duplicate of this bug. ***
Comment 18 Lamarque V. Souza 2011-12-28 14:09:15 UTC
*** Bug 289903 has been marked as a duplicate of this bug. ***
Comment 19 Thijs 2012-01-03 20:55:46 UTC
*** Bug 290530 has been marked as a duplicate of this bug. ***