On Sun, Jun 21, 2009 at 1:06 AM, Erich Hooverehoover@mines.edu wrote:
I'm trying to track down an issue with Launchpad Enhanced were it fails to download its updates (Bug #17443). It appears that the issue stems from recv being called with a buffer from a different process, so as a result the call fails. I put together a hack that gets around the problem (http://bugs.winehq.org/show_bug.cgi?id=17443#c2), but I'm having difficulty figuring out exactly why this is happening in the first place. Does anyone know if this is a known difference between Windows and Linux or if there is something else strange going on?
If recv() fails with EFAULT, why doesn't the memcpy() in your patch raise SIGSEGV instead?
Maybe the memory is writable but not readable, and WSARecvFrom()/recv() is reading it while memcpy() is not?
Maybe the memory is from a DIB section which Wine lazily mprotects and the kernel isn't raising SIGSEGV for the protection to be reapplied? Does simply zero-filling buf before calling WSARecvFrom() help?
Erich Hoover ehoover@mines.edu
Damjan Jovanovic