DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 54K50JOm2531673 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 54K50JOm2531673 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=uwoQcqd7 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 909DE3858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1747717217; bh=IFfwaXTs6pjKCHFxfBta0MAIj51/+h/5leMv/G5Prqo=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uwoQcqd7OMbCdw6OXk7iLnc5QxrwIjt1q6weSfFN7ReltqJkzo9TDrMp9JG3YDFkx wC4s6MjgMtMpmpptAP87oegwiBNEnWTi7YgRohZFcyMD1fkTfH7RQ2gkX0ScdQ6wAG jsX0xDGBr+DVDwXLECUTeEvVRHIuRQxd9UuJxZdQ= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F36D23858D20 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F36D23858D20 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747717193; cv=none; b=HmtiNlugeXGXfWHd8159xo/uFEjzDvHcPiPjKuWllyVoZC7GzQeHWJRynoe6Lr4gqUTTMx8XppZjbzjQwyXmNR6+RQ3tNvAcc2oLtHEwIRNRRTAXxrAocu/idsbYs8ndxZhp1Pb3SqnU29JObGTIS0vKwA1V13MZjT4qh3m4lio= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747717193; c=relaxed/simple; bh=psB5GQcE6s2cFVHQIWWnGpgnONXpJ0yhJilOOKBddDs=; h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature; b=b3P1HHeLQmGt3VYktabS6AMzam3RXnhFq3klUGd5YNQNzPg/G4WKj1/lzkQlDk8Ve3bVJdbpPfEEmjMIPUmf/5cKEEi2gHqwFE9vzLUKm5s+of8xyp1ENoKtiIOMtuuoLM+xdyTyeVziRR0O3TXEIi2OniOUscO5YnrV1yz03aM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F36D23858D20 Message-ID: <2455f003-cdac-4e5c-8404-79d9709338f7@SystematicSW.ab.ca> Date: Mon, 19 May 2025 22:59:50 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: fork error when trying to call VirtualAlloc with size==0 Content-Language: en-CA To: cygwin AT cygwin DOT com References: <9635a215-9e5a-e725-cbe1-595f508032f6 AT jdrake DOT com> Organization: Systematic Software In-Reply-To: X-Rspamd-Server: rspamout08 X-Rspamd-Queue-Id: 19EF320024 X-Stat-Signature: sggxozci8k5ypa8wxanpbe7eujorsa5i X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX18hBjsKjOgzA7uBK+TKc/wJoZdEqT+IQPk= X-HE-Tag: 1747717191-410715 X-HE-Meta: U2FsdGVkX181r+bQ8NTdh/TuVC4hSK5EFppaD/v4OvoyJfKdaN+vUzCjkrpj3HVMoCuewA8zdzxCbQL0AvvVhysGJsVpz77vCT0KKFJ4Dw5B2DJBS4OpWg/PckFXjCsYOOE0gstkaM1abSc0SC6rcnA4HQ5YM20UY8GGAIuBYAvpup748oIkUvMtHDAitzhqBppRrZI4SWysk4PuIZyHFlDdW5RjqwhZGaevteViWyRM1pRA2gCsiHtFgUQQcbejYLRm5nAVDwamY0+JvWDP3tO/xA3VMX5DdnbhaNtZ/x5vugp8EtaiEFFNwyXDS2lTnHhdyrfk6enBtdKRwHoJ1RDASJx4MpkdCtSE6leIiJf/1ea5OfgK66M5UomBtngapzxzTzxyct8= X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Brian Inglis via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Brian Inglis Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 54K50JOm2531673 On 2025-05-19 21:25, Yuyi Wang via Cygwin wrote: > Thank you for your reply. The DLL is a "proc macro" DLL for rustc, which means > that it's not designed to be changed after created. However, I've also found > that this stage-1 compiler doesn't always trigger this failure: it just trigger > fork failure with compiling relatively large projects. In this case, it fails > to compile rustc, which depends on 17 proc-macro DLLs. Previously it also failed > to compile another tool in rust repo, but sorry I forget which one it was. > > An interesting phenomenon is that the stage-0 rustc is also a cygwin executable, > compiled 10 days before, and it doesn't trigger this failure. I haven't found > out that if this failure is caused by some misc changes in rustc... > > I also tried again with Windows Defender disabled, but it still triggers the > failure with exact the same message. > > Back to the code, I really think the most possible case is b) mb.BaseAddress != > `here`. However, it means that we overestimated `size`, so `end` is less than > `dll_end`, and the dll is smaller than it used to be...? Is it possible that LoadLibraryExW() allocates smaller region than the image size? Could it be this known issue: https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw LoadLibraryExW with LOAD_LIBRARY_REQUIRE_SIGNED_TARGET requires DLL characteristic IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY (0x0080) https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header64 https://stackoverflow.com/questions/62461457/loadlibraryexw-fails-to-load-user32-dll https://learn.microsoft.com/en-us/answers/questions/1189539/loadlibraryexw-returns-error-invalid-image-hash-on -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut -- Antoine de Saint-Exupéry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple