public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Oliver Smith-Denny via groups.io" <osde=linux.microsoft.com@groups.io>
To: devel@edk2.groups.io, leif.lindholm@oss.qualcomm.com,
	discuss@edk2.groups.io, adwags@gmail.com
Subject: Re: [edk2-devel] [edk2-discuss] Attempted runtime pool allocation returns non-runtime pool
Date: Wed, 4 Dec 2024 07:39:51 -0800	[thread overview]
Message-ID: <1c4d0af6-106c-4db0-80e2-b2dc66d82500@linux.microsoft.com> (raw)
In-Reply-To: <CAD=n3R2G_Rwrd_zu-isnfOgmGWnX9eS=eMnqB2D+Ckb6F-3C_g@mail.gmail.com>

Hi Adam,

> On Wed, 4 Dec 2024 at 04:21, Adam Wagner via groups.io
> <adwags=gmail.com@groups.io> wrote:
>>
>> Hello,
>>
>> I have a DXE runtime driver that is attempting to allocate runtime pool
>> (via AllocateRuntimeZeroPool). I'm getting back a non-NULL pointer, but it
>> isn't in the runtime memory map so ConvertPointer fails later. It looks
>> like the returned address is in a memory region of "conventional" type
>> which if I understand correctly is where free memory lives?
>>
>> I think I may be hitting the "Attempt to find free pages in the default
>> allocation bin" case here...
>> https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/Mem/Page.c#L1281
>>

This piece is fine if it doesn't hit the normal memory bin, it will
still get the type converted in the call to CoreConvertPages. I agree
with Leif that AllocateRuntimeZeroPool should not be returning the
memory if anything failed; what I would recommend is adding some prints
or using a debugger to tell if the memory is getting the correct type
on that allocate call and then checking if it is getting freed later
by some entity.

Oliver



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120871): https://edk2.groups.io/g/devel/message/120871
Mute This Topic: https://groups.io/mt/109918571/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-12-04 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAB8Y2ryo86XH2s=avss4s4nC8sp68rWv1NsnJHqv+qvxGWEkuA@mail.gmail.com>
2024-12-04 12:31 ` [edk2-devel] [edk2-discuss] Attempted runtime pool allocation returns non-runtime pool Leif Lindholm via groups.io
2024-12-04 15:39   ` Oliver Smith-Denny via groups.io [this message]
2024-12-05  1:31     ` 回复: " gaoliming via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c4d0af6-106c-4db0-80e2-b2dc66d82500@linux.microsoft.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox