Re: [PATCH 2/2] tools/nolibc: x86-64: Fix startup code bug

From: Willy Tarreau
Date: Sat Oct 23 2021 - 09:44:28 EST


On Sat, Oct 23, 2021 at 08:27:15PM +0700, Ammar Faizi wrote:
> Sorry for the delay, I got extra activities this week. Sorry for not
> giving any update lately.

No, really, don't be sorry, I'm myself quite busy, so I understnad, I
was just inquiring to arrange my time, nothing more.

> 1) I can send the %rsp alignment fix patch. I will send it today or
> tomorrow (GMT+07 time).

OK, no rush anyway. Even early next week is okay for me.

> 2) I can't send the syscall change used for exit. Because I only
> have x86 machine. So I can't apply the changes to other arch(s).

I see. I can do it for the various archs then, as the ones that are
supported are essentially the ones I can test.

> For (2), basically sys_exit doesn't close the entire process. Instead
> it only closes specific thread that calls that syscall. The libc uses
> sys_exit_group to close the process and its threads.
>
> ^ It's not really an urgent thing, because the nolibc.h may not be
> used for multithreaded app. Even so, I don't see something dangerous.

Yep that's what I understood as well, so we may easily postpone this.

> For (1), it's urgent, because the alignment violation causes segfault
> if the compiler generates aligned move, often when we compile it
> with -O3, usually that happens with SSE instructions, like `movdqa`,
> `movaps`.

Yes, that's what I saw from the other reports, I didn't notice it myself
but I probably faced it and attributed it to anything else.

> Preparing the patch...

Great, thank you!
Willy