1

I use Qt4.8 in linux. The QPluginLoader for load plugins. If any plugin is crashed, then application crashed too. How to avoid crashing app?

Andrey Reeshkov
  • 331
  • 5
  • 14

2 Answers2

3

I'm not certain that you can armor your application against a seg-fault within a loaded library. If you can move the functionality in that library into a service communicating via a local socket or your favorite IPC method then you can simply handle the failure to communicate with the service.

EDIT

I did a little looking around to see if it is possible to catch SIGSEGV, and learned that there are software libraries that attempt to do this very thing.

So let's change 'cannot' to 'should not'.

Community
  • 1
  • 1
1

A plugin is your application: there's no separation of any sort there. If a plugin crashes, it is your process that crashes. That's what a plugin is.

Plugins are just one way of designing modular software systems, though. Nobody forces you to use them. You're free to compartmentalize modules in their own processes, using an IPC library to communicate between the component processes.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313