issues 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <a name="wapi"></a>
  2. * ~/.wapi error message
  3. Q: What does the following error message mean?
  4. <pre>
  5. Failed to attach shared memory!
  6. Falling back to non-shared handles
  7. </pre>
  8. A: To properly implement the handle semantics expected by .NET
  9. applications where a handle number is all that its needed to pass
  10. a descriptor from one process to another and have it just work.
  11. Handles are used to specify: files, events, locks, semaphores,
  12. sockets, pipes and processes descriptors. So two Mono processes
  13. can share any of those resources just by exchanging the handle
  14. tokens (a number) between them.
  15. This is accomplished by using a helper process that is launched by
  16. the first Mono invocation (that is why you see two mono processes
  17. running on your machine).
  18. The various Mono processes communicate with each other with a local
  19. file in the ~/.wapi directory (one per hostname, so this works fine
  20. over NFS).
  21. If the system crashes, or all of the Mono processes are killed
  22. without a chance to shut down properly those files will remain
  23. there, but there will no longer be an owner for them. If a new
  24. Mono start up, it will notice that the file exists, but it will
  25. fail to contact the helper process, issuing the above warning.
  26. Q: How do I fix the problem?
  27. A: If you are sure that no other Mono process is running, you can just
  28. delete the contents of the ~/.wapi directory:
  29. <pre>
  30. rm -i ~/.wapi/*
  31. </pre>
  32. If you can not delete those files (because say, you have a running
  33. Mono, you can disable the use of the shared handles setup by
  34. setting the MONO_DISABLE_SHM environment variable as well:
  35. <pre>
  36. # Notice: Highly discouraged
  37. bash$ export MONO_DISABLE_SHM=1
  38. </pre>
  39. The above is highly discouraged as that will make process execution
  40. fail, and without that many things like XSP/ASP.NET or the C#
  41. compiler's -pkg: support will not work.