Skip to contentSkip to conversation

faults in dynamic libraries

DISCUSSION Tver Mit 2 participants 2 messages Jun 13, 2002

lore
Share & tools
lore

Tver Mit

author
#0 lore raw

Hi all.
I write a programm that uses plugins (on dl* functions base). When plugin code is free of bugs all is ok, but when plugin faults by any reason, my programm do so. I want my programm to work even if plugin dies. I see two ways:
1. handling signals
2. run plugin in different thread or process
but then:
in 1. what will be with resources, that plugin use ?
in 2. it'll be about 15-20 plugins running - so there will be 15-20 processes. And how to synchronise them all?

Got any ideas, opinions?

________________
Good hunt.

Tver mailto:[email protected]

#1 lore raw
Quoted 10 lines · Tver Mit

I write a programm that uses plugins (on dl* functions base). When plugin code is free of bugs all is ok, but when plugin faults by any reason, my programm do so. I want my programm to work even if plugin dies. I see two ways:
1. handling signals
2. run plugin in different thread or process
but then:
in 1. what will be with resources, that plugin use ?
in 2. it'll be about 15-20 plugins running - so there will be 15-20 processes. And how to synchronise them all?

Got any ideas, opinions?

If a plugin shares its address space with the main program, a bug can corrupt that address space, killing the main program.

Running plugins in a separate process is the only reliable mechanism, but it probably isn't practical. Even then, a plugin may still be able to interfere with the main process if they share system resources such as file descriptors.

Signature · 1 line
Glynn Clements <[email protected]>