From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.111.4.25; helo=out1-smtp.messagingengine.com; envelope-from=marco.guerri.dev@fastmail.com; receiver=edk2-devel@lists.01.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 22B0D2238B5A3 for ; Thu, 18 Jan 2018 09:22:38 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D3AFD207A2; Thu, 18 Jan 2018 12:27:59 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute4.internal (MEProxy); Thu, 18 Jan 2018 12:27:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=/m5kpfIrPZ2v4byBA9aRNzJTEfSEM UBYs1FyI3h2fE8=; b=M1qJeiSG9nT/YePIf/i4iLCJ6XrwesE0VZLfJyAIfi6Nc GMB90sY/nFpYlXNm1iT8DI39LH0eJmMaRhOWK/QZK/K+kJxfXkANKMqEzGcaYkhm bc9+KX0UXSrpVVGmrDeNqCUVSHrw4sFUaPX9olFGQPKh/z7EHpfxu3P+Aw4XunNa GMSXORhN8Pg9wbqVUpH3I5zcPU+h2qwmP1q0yyUMtAZPYH03txK5OhitWbLL18U0 GmUddxl9m6Uvv8aAvk4QZnXzVIRBCrFw9exiQJYYlCMCT6i0h/ZvFLWsn4iTj0fD 3CfHV23O7ypakp/RouZRO2nUm9a1oo/4qCxEmCvIQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/m5kpf IrPZ2v4byBA9aRNzJTEfSEMUBYs1FyI3h2fE8=; b=iODYgICvgXaGBuXK99EY+R ArQ02inv4+AYPkOaWr65pP1GPXoQZJExouRt+1v5Iu3md6s9tM8repYE5T3Iihtn 3D67zpAZktEsouW29kCMcWCYBl9sSmh6O2koehZzkYGdLQ71gSBC/DeOhwMA7c+c FrlzlsVsC/T4t6ys/g04xX7XCM9/heGU4S6u1q1ymNM7sDlGMsoLTQ1EE9GOFoDl iXW8NvayxecNLRaPB7HNWBHhuNTuiZYGlp15g+NYb/NIhuIk0egP/6obK5tylyus 61js/LbmwmpJM6sg7uLgEHGrB3Y28v6TZAIsFo7skVHH2nAs3Mn/E08FlSNWvqWA == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id A3C844154; Thu, 18 Jan 2018 12:27:59 -0500 (EST) Message-Id: <1516296479.3148418.1240030384.210CDE2C@webmail.messagingengine.com> From: Marco Guerri To: "Daryl McDaniel (EDK2 Lists)" , edk2-devel@lists.01.org MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface - ajax-75de3051 In-Reply-To: <026e01d3907f$82953820$87bfa860$@mc2research.org> Date: Thu, 18 Jan 2018 11:27:59 -0600 References: <026e01d3907f$82953820$87bfa860$@mc2research.org> X-Mailman-Approved-At: Thu, 18 Jan 2018 11:16:49 -0800 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: [tianocore/edk2] Stdlib: Add calling convention to completion callbacks (#123) X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 17:22:39 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Daryl, First, sorry for not having RTFM and submitting the patch via github. I was planning to read your workflow during the weekend and re-submit via the mailing list. Second, I am using gcc. I tried gcc 4.8 and 5.2 and with both, my applications using Stdlib badly hang. I dug a bit and discovered that the signatures of the completion callbacks are missing EFIAPI, so necessarily under Unix systems they are using the wrong ABI. When the functions arguments are pointers, the machine ends up in a triple fault I guess (I can clearly see that the first two integer parameters are fetched from %rdi and %rsi, which is the SysV ABI). I was a bit surprised to see this bug, as the buildscripts are pretty comprehensive in terms of compilers support. Does this make sense to you? Cheers, Marco -- Marco Guerri marco.guerri.dev@fastmail.com On Thu, Jan 18, 2018, at 11:12 AM, Daryl McDaniel (EDK2 Lists) wrote: > Marco, >=20=20 > Thank you for your submission. >=20=20 > Can you please tell me which compiler you are using? >=20=20 > Thank you, > Daryl McDaniel >=20=20 >=20=20 > **From:** Marco Guerri [mailto:notifications@github.com] **Sent:** > Wednesday, January 17, 2018 7:22 AM **To:** tianocore/edk2 > **Cc:** Subscribed > **Subject:** [tianocore/edk2] Stdlib: > Add calling convention to completion callbacks (#123)>=20=20 > When compiling in Unix environments, the ABI defaults to SysV. > Callbacks are invoked directly by the system firmware so they must > necessarily use MS ABI.> Contributed-under: TianoCore Contribution Agreem= ent 1.0 Signed-off-by: > Marco Guerri marco.guerri.dev@fastmail.com>=20 > *You can view, comment on, or merge this pull request online at:* > https://github.com/tianocore/edk2/pull/123 > *Commit Summary* > * Stdlib: Add calling convention to completion callbacks> *File Changes* > * **M** StdLib/EfiSocketLib/Ip4.c[1] (10) > * **M** StdLib/EfiSocketLib/Socket.h[2] (24) > * **M** StdLib/EfiSocketLib/Tcp4.c[3] (11) > * **M** StdLib/EfiSocketLib/Tcp6.c[4] (3) > * **M** StdLib/EfiSocketLib/Udp4.c[5] (30) > * **M** StdLib/EfiSocketLib/Udp6.c[6] (20)> *Patch Links:* > * https://github.com/tianocore/edk2/pull/123.patch > * https://github.com/tianocore/edk2/pull/123.diff> =E2=80=94 You are rec= eiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub[7], or mute the > thread[8]. Links: 1. https://github.com/tianocore/edk2/pull/123/files#diff-0 2. https://github.com/tianocore/edk2/pull/123/files#diff-1 3. https://github.com/tianocore/edk2/pull/123/files#diff-2 4. https://github.com/tianocore/edk2/pull/123/files#diff-3 5. https://github.com/tianocore/edk2/pull/123/files#diff-4 6. https://github.com/tianocore/edk2/pull/123/files#diff-5 7. https://github.com/tianocore/edk2/pull/123 8. https://github.com/notifications/unsubscribe-auth/AM0XkaIxBOrC6Kacm-Vq= q6z4tgQFar04ks5tLhAHgaJpZM4RhgXz