[etherlab-dev] [Patch] User-mode deactivate bug

Gavin Lambert gavinl at compacsort.com
Tue May 27 02:17:45 CEST 2014


Hi,

When using the user-mode library, I found that calling
ecrt_master_deactivate does not properly release the domain memory mapping.
In particular, the following sequence:

 - ecrt_request_master
 - (domain set up)
 - ecrt_master_activate
 - ecrt_master_deactivate
 - (domain set up)
 - ecrt_master_activate
 - ecrt_master_deactivate
 - ecrt_master_release

Does *not* result in actually releasing the master kernel module -- the
master thread remains running and the master module cannot be unloaded until
the application process terminates.

It's especially noticeable when the first domain is non-empty and the second
is empty -- during ecrt_master_release the call to munmap will fail with
EINVAL because master->process_data is non-NULL but
master->process_data_size is 0.

The attached patch resolves this by moving the munmap to
ecrt_master_deactivate instead of ecrt_master_release.

Regards,
Gavin Lambert


-------------- next part --------------
A non-text attachment was scrubbed...
Name: lib-deactivate.patch
Type: application/octet-stream
Size: 743 bytes
Desc: not available
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20140527/8f25b12e/attachment.obj>


More information about the etherlab-dev mailing list