mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Typo in atexit.c (?)
@ 2021-01-20 13:54 Yuriy Chernyshov
  2021-01-20 15:45 ` [musl] " Yuriy Chernyshov
  0 siblings, 1 reply; 3+ messages in thread
From: Yuriy Chernyshov @ 2021-01-20 13:54 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

 Hello everyone,
34952fe5de44a833370cbe87b63fb8eec61466d7 introduced safeguard for using of
undefined memory (de)allocation functions:
https://git.musl-libc.org/cgit/musl/commit/?id=34952fe5de44a833370cbe87b63fb8eec61466d7

However, in src/exit/atexit.c either this commit or the code is buggy, as
it has:

#define free undef

... free(something)

This results in linkage error of every program being linked to musl.
Could you, please, advice me on how to fix this?

Regards,
Yuriy.

[-- Attachment #2: Type: text/html, Size: 778 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [musl] Re: Typo in atexit.c (?)
  2021-01-20 13:54 [musl] Typo in atexit.c (?) Yuriy Chernyshov
@ 2021-01-20 15:45 ` Yuriy Chernyshov
  2021-01-20 17:51   ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Yuriy Chernyshov @ 2021-01-20 15:45 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

As I see, this turned out to be a combination of a local patch applied to
atexit.c.

The patch introduces cleanup of additionally allocated fl chunks allocated
by calloc calls in __cxa_atexit.
I think I can upstream the patch upon a brief adaptation to match the
styleguide.

What do you think?

NB: I am not a subscriber of this list and would like to be cc'd with any
replies.
Thanks in advance.

Yuriy.

On Wed, 20 Jan 2021 at 16:54, Yuriy Chernyshov <georgthegreat@gmail.com>
wrote:

> Hello everyone,
> 34952fe5de44a833370cbe87b63fb8eec61466d7 introduced safeguard for using of
> undefined memory (de)allocation functions:
> https://git.musl-libc.org/cgit/musl/commit/?id=34952fe5de44a833370cbe87b63fb8eec61466d7
>
> However, in src/exit/atexit.c either this commit or the code is buggy, as
> it has:
>
> #define free undef
>
> ... free(something)
>
> This results in linkage error of every program being linked to musl.
> Could you, please, advice me on how to fix this?
>
> Regards,
> Yuriy.
>

[-- Attachment #2: Type: text/html, Size: 1716 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] Re: Typo in atexit.c (?)
  2021-01-20 15:45 ` [musl] " Yuriy Chernyshov
@ 2021-01-20 17:51   ` Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2021-01-20 17:51 UTC (permalink / raw)
  To: Yuriy Chernyshov; +Cc: musl

On Wed, Jan 20, 2021 at 06:45:23PM +0300, Yuriy Chernyshov wrote:
> As I see, this turned out to be a combination of a local patch applied to
> atexit.c.
> 
> The patch introduces cleanup of additionally allocated fl chunks allocated
> by calloc calls in __cxa_atexit.
> I think I can upstream the patch upon a brief adaptation to match the
> styleguide.
> 
> What do you think?

I'm not sure what this patch is for, but no it cannot be upstreamed.
It would make all programs using atexit link free. The use of malloc
without free is very intentional.

Rich

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-20 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 13:54 [musl] Typo in atexit.c (?) Yuriy Chernyshov
2021-01-20 15:45 ` [musl] " Yuriy Chernyshov
2021-01-20 17:51   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).