On 8/4/22 11:27 AM, Richard Purdie wrote:
On Thu, 2022-08-04 at 12:36 +0100, Khem Raj wrote:


On Thu, Aug 4, 2022 at 10:05 AM Richard Purdie
<[email protected]> wrote:
Just to note that where we've been seeing pseudo hangs in rust, it
seems jemalloc calls obtain_malloc_conf() which calls readlink()
which
pseudo intercepts and then calls malloc() which loops back to
jemalloc
which deadlocks. What fun.


(Going way back) the way this was avoided in the distant past was having a static variable of whatever the 'max size' was already allocated in a few key locations and using that variable instead of a malloc. (Of course due to it having a fixed length a size check and such needed to be done.)

I don't really know the context at this point for this item, but it's an alternative way to solve this problem, but will require memory to be allocated at compile time, either in a function or a small global pool for usage.

It does make me wonder if there are other function in the system that use malloc and if so could they use an alternative, if not the 'is_init' might be the only way to handle it.

--Mark


I guess pseudo is doing this extra malloc right ?

Yes

  Maybe disable instrumentation in jemalloc when building non target
packages. This might avoid the issue at least


Sadly it doesn't help as it wants to load it isn't configuration and
the system setup from /proc too.

Cheers,

Richard





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168976): 
https://lists.openembedded.org/g/openembedded-core/message/168976
Mute This Topic: https://lists.openembedded.org/mt/92809824/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to