My linked-in driver gets unloaded after a crash

zabrane Mikael zabrane3@REDACTED
Mon Aug 2 11:45:12 CEST 2010


Hi guys,

I've implemented a toy linked-in driver called "foo_drv". Everything works
fine as soon as there's
no error in the driver side nor Erlang side.
But when a crash happens, its gets unloaded by the VM.

$ erl
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:128]
[kernel-poll:true]

Eshell V5.7.5  (abort with ^G)
1> foo_drv:start().
driver successfully loaded

2> erl_ddll:loaded_drivers().
{ok,["efile","tcp_inet","udp_inet","zlib_drv",
     "ram_file_drv","tty_sl", "foo_drv"]}

3> 1 / a. %% simulate a crash
** exception error: bad argument in an arithmetic expression
     in operator  '/'/2
        called as 1 / a

4> erl_ddll:loaded_drivers().
{ok,["efile","tcp_inet","udp_inet","zlib_drv",
     "ram_file_drv","tty_sl"]}

5> q().


Could someone tell me why my driver gets unloaded after any crash while
other drivers (eg. efile, zlib_drv ...) are still loaded?

-- 
Regards
Zabrane


More information about the erlang-questions mailing list