Hello when I try to connect to a VPN using networkmanager the whole plasmashell crashes. The crash happens even if I have plasma-nm applet in my system and connect to the VPN using a cli tool such as nmtui or nm-cli this is the backtrace Thread 1 "plasmashell" received signal SIGSEGV, Segmentation fault. 0x00007fff39443179 in NetworkStatus::<lambda(const Ptr&, const Ptr&)>::operator() (__closure=<optimized out>, right=..., left=...) at /home/whites/Downloads/plasma-nm/src/plasma-nm-5.7.2/libs/declarative/networkstatus.cpp:168 168 return NetworkStatus::connectionTypeToSortedType(left->type()) <= NetworkStatus::connectionTypeToSortedType(right->type()); this bug is quite recent for me (and I used the VPN stuff for years). Please ask if you need more info. thanks Reproducible: Always Steps to Reproduce: 1. add the plasma-nm applet to the panel 2. open the applet and click on the "connect" button of the VPN OR try to connect to the VPN using a CLI tool such as nm-tui Actual Results: plasmashell crashes (but the VPN connects successfully) Expected Results: plasma should not have crashed
Could you please provide complete backtrace?
unluckily that's the complete backtrace. I got it using gdb on plasmashell. I don't know how to get a more verbose backtrace. can you help me?
Do you know the compiler version used to compile Plasma NM? That can be a compiler bug.
(In reply to Lamarque V. Souza from comment #3) > Do you know the compiler version used to compile Plasma NM? That can be a > compiler bug. The bug First happened with the distribution packages (arch). As soon as i get back to my notebook I'll tell you my GCC version
Hmmm std::sort() expects the lambda to return true if left is less than right, but it returns true when they are equal too. According to this [1] that can lead to an unsorted array internally and that can lead to a crash like this one. Can you recompile the lamba to use < instead of <= and test if it solves your problem? [1] http://stackoverflow.com/questions/7767998/should-stdsort-work-with-lambda-function-in-c0x-c11
Will try asap(In reply to Lamarque V. Souza from comment #5) > Hmmm std::sort() expects the lambda to return true if left is less than > right, but it returns true when they are equal too. According to this [1] > that can lead to an unsorted array internally and that can lead to a crash > like this one. Can you recompile the lamba to use < instead of <= and test > if it solves your problem? > > [1] > http://stackoverflow.com/questions/7767998/should-stdsort-work-with-lambda- > function-in-c0x-c11 Will try asap
Created attachment 100347 [details] patch that fixes this issue
great catch @Lamarque V. Souza your suggestion fixes the problem for me. I attached the patch I applied.
Git commit 669c25e2153c64733ed6f64c9600aa182c0eb156 by Lamarque V. Souza. Committed on 28/07/2016 at 11:57. Pushed by lvsouza into branch 'master'. Fix crash when activating VPN connection. std::sort() expects the lambda to return true if left is less than right, but it returns true when they are equal too. According to this [1] that can lead to an unsorted array internally and that can lead to a crash like this one. [1] http://stackoverflow.com/questions/7767998/should-stdsort-work-with-lambda-function-in-c0x-c11 M +1 -1 libs/declarative/networkstatus.cpp http://commits.kde.org/plasma-nm/669c25e2153c64733ed6f64c9600aa182c0eb156
Git commit e6e341a5c2c1bc9292e1e67603ea52795e33fe8a by Lamarque V. Souza. Committed on 28/07/2016 at 13:20. Pushed by lvsouza into branch 'Plasma/5.7'. Fix crash when activating VPN connection. std::sort() expects the lambda to return true if left is less than right, but it returns true when they are equal too. According to this [1] that can lead to an unsorted array internally and that can lead to a crash like this one. [1] http://stackoverflow.com/questions/7767998/should-stdsort-work-with-lambda-function-in-c0x-c11 M +1 -1 libs/declarative/networkstatus.cpp http://commits.kde.org/plasma-nm/e6e341a5c2c1bc9292e1e67603ea52795e33fe8a