To allow compiling the asn code with `-DEMIT_ASN_DEBUG=1`. Otherwise it will fail with an unresolved symbol because librspro is compiled as shared-object. Further initialize it as disable (0).
Fix: Remove slot mapping at bankd when client disconnects
If a client disconnects before removing the slot mapping, the worker must undefine its 'bank_id' and 'slot_nr' and must change its state to 'UNMAPPED'.
send_signal_to_worker() searches for a worker that has a given bank and slot. If a client re-connects to a different worker and if the bank and slot would be still assigned to the old worker, the old worker could receive signals when assigning or removing slot mapping. The new worker would not be mapped.
Fix: Prevent race conditions when accessing slotmap in bankd
If a client connects to a worker, the worker will check if there is an existing mapping between a reader and this client. If it exists, slotmap_by_client() will return a pointer. If the mapping is deleted at this time by the server, the worker uses a pointer to a mapping entry that has just been freed.
To prevent this, the worker locks the slot map and calls the new function slotmap_by_client_nolock(). After it has finished working with the returned pointer, it unlocks the slot map again. A possible delete by the main thread would be delayed.
If a client disconnects from a worker thread while the worker is responding to a to a request from that client, the socket is closed and SIGPIPE is sent to the worker, causing the application to exit.
To prevent this, all workers have a dummy handler to prevent this. Now the worker can handle the closing of the socket.