<div dir="ltr"><div>Thanks for the initiative Paul. Let me answer the major question from the thread.</div><div><br></div><div>> > Remove the trailer? Or fix it?</div><div><br></div>Ideal one is to fix it, as we do use mem-pool info to identify leaks etc through statedumps of the process. Remove can be an option on SPARC to start with if fixing is time consuming. I recommend removing the trailer within a #ifdef codeblock, so it may continue work in places where its already working.<div><br></div><div>-Amar<br><div><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 27, 2021 at 7:45 PM Paul Jakma <<a href="mailto:paul@jakma.org" target="_blank">paul@jakma.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The magic trailer added at the end of memory allocations in mem-pool.c <br>
doesn't have its alignment ensured. This can lead to SIGBUS and <br>
abnormal exits on some platforms (e.g., SPARC64).<br>
<br>
I have a patch to round-up the header and allocation size to get the <br>
right alignment for the trailer (I think).<br>
<br>
It does complicate the memory allocation a little further.<br>
<br>
Question is whether it would just be simpler to remove the trailer, and <br>
simplify the code?<br>
<br>
There are a number of external tools that exist to debug memory allocs, <br>
from runtime loadable debug malloc libraries, to compiler features <br>
(ASAN, etc.), to valgrind.<br>
<br>
Glusterfs could just rely on those, and so simplify and (perhaps) <br>
speed-up its own, general-case memory code.<br>
<br>
Remove the trailer? Or fix it?<br>
<br>
regards,<br>
-- <br>
Paul Jakma | <a href="mailto:paul@jakma.org" target="_blank">paul@jakma.org</a> | @pjakma | Key ID: 0xD86BF79464A2FF6A<br>
Fortune:<br>
Many people are secretly interested in life.<br>
-------<br>
<br>
Community Meeting Calendar:<br>
Schedule -<br>
Every 2nd and 4th Tuesday at 14:30 IST / 09:00 UTC<br>
Bridge: <a href="https://meet.google.com/cpu-eiue-hvk" rel="noreferrer" target="_blank">https://meet.google.com/cpu-eiue-hvk</a><br>
<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="https://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">https://lists.gluster.org/mailman/listinfo/gluster-devel</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">--<div><a href="https://kadalu.io" target="_blank">https://kadalu.io</a></div><div>Container Storage made easy!</div><div><br></div></div></div></div></div></div>