KDE Developer
|
KJS ~ Javascript ~ ECMAScript ~ QtScript
KJS != QtScript It's not bad to have Script-Plasmoids. But C++ is simply faster. With signal() we could prevent a crash of the whole application with little overhead. That's a better solution then scripting or multiple processes. And it could also show a KCrash-message for reporting the Bug. Should there be an own thread for this idea?
Last edited by The User on Mon Apr 27, 2009 5:58 pm, edited 1 time in total.
|
Registered Member
|
I read some of the posts, very interesting but this from Aaron Seigo shines: "the above applies only to scripted plugins, not C++ plugins. C++ can crash the application, but the plasma shell restarts itself." So scripted plugins are safe but C++ not then, why we must use C++ to doing a stupid plasmoid that can be writen in javascript? I supposed that writing code in C++ must be "cool" regardless of the number of memory leaks and the quality of the programmer. Please note that I pretend to be sarcastic . On the other side, "but the plasma shell restarts itself" as a solution is... well..., I have no words. I'm considering use the same argument with my customers . customer: Ignacio, your program crash and I lost all my open invoice. me: Yes, but the programs restarts again with an empty invoice. I do not understand why you complaints. I think that I will stop using plasmoids written in C++ with exception of Panel and Folder View. The last was not very stable in the past but now it seems to be rock solid, at least I can use nepomuk without a plasma crash .
Last edited by Ignacio Serantes on Tue Apr 28, 2009 7:58 am, edited 1 time in total.
Ignacio Serantes, proud to be a member of KDE forums since 2008-Nov.
|
KDE Developer
|
Hey Ignacio! (and all the others)
It's possible to stop a crash! I'll say Python but it could be any scripting language in this example: A common error is a "division by zero". In Python you'll gett a "ZeroDivisionError". The execution can't be continued. It's like a crash on script-level. Maybe more often than divisions by zero you have SIGSEGV, null-pointer-dereference. This means a unbound reference to some data was used to access some data. It's like sending a letter without specifying the adress. In Python you can also try to dereference the "None"-reference. You'll get an error because the None-type can't be used for anything. Again the Python-Plasmoid will crash but the process will survive. In C++ you would get SIGSEGV. But! In C there is a function signal() (try `man signal`). You can specify the code executed after a SIGSEGV or anything else. And there is a second error-concept (not signals) in C++ called exceptions. Also a "thrown" exception will roll back the execution until causes SIGABORT. But exceptions can be stopped. When the applicatiiion receives a signal you can throw an exception. In another location in the program the exception can be handled, e.g. in Corona. So the crash would be stopped but Corona could also show a KCrash-dialog for reporting the bug and could remove the Plasmoid. Plasma would continue running. The User Edit: C++-Hackers, try it! Somebody gave me the information and a few minutes ago I could write some code using those exceptions. It's pretty simple:
So you can execute it:
Last edited by The User on Mon Apr 27, 2009 9:37 pm, edited 1 time in total.
|
Registered Member
|
I'm not C, or C++ programmer so I can't evaluate if this is true or not but, if it's possible I wonder why Plasma don't implement a mecanism like this. Well, it has the wonderful restart but a second option don't sounds bad .
Ignacio Serantes, proud to be a member of KDE forums since 2008-Nov.
|
Registered Member
|
I think there is a compromise; allot of the C++ plasmoids are stable now so running them as a separate process would be a waste of resources. I think the ideal solution is to have a separate process (as Option) called plasma-unstable that holds all plasmoids that aren't scripts and aren't considered stable. This will allow the user to add new unstable plasmoids without crashing plasma as a whole.
|
KDE Developer
|
But a Process-Plasmoid would need ugly code without bringing new features...
|
Administrator
|
It would probably be best to implement the exception handling at the KDE Libs or Qt level instead of in each application.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
KDE Developer
|
I have created an idea-thread: [KDELibs] Catch Crashes in Modular Applications
Last edited by The User on Tue Apr 28, 2009 12:16 pm, edited 1 time in total.
|
Registered Member
|
plasma definitely should not crash because of a single plasmoid... but.. i don't think a single process for every plasmoid is a good solution.. (in fact it sounds somehow horrible to me)
there has to be another professional way ..
Kubuntu 12.04 x64 | KDE SC 4.8
Nvidia 8800 GTS | Core2Duo E6600 | 4 GB RAM |
Registered Member
|
Like, "Make the plasmoids more stable before including them in a default install", perhaps?
In fact, I find I get very, VERY few plasma crashes as of late... I can't remember the last plasma crash I had, and that's something of a feat.
Madman, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Aaron has said that this is infeasible and won't happen.
Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965 |
Registered users: Bing [Bot], Evergrowing, Google [Bot]