unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: alexandre.ferrieux@orange.com
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org, carlos@redhat.com
Subject: Re: [PATCH] Fix #27777 - now use a doubly-linked list for _IO_list_all
Date: Fri, 26 Apr 2024 20:20:26 +0200	[thread overview]
Message-ID: <6977a24b-db32-4fbb-bd4e-df4e1d476634@orange.com> (raw)
In-Reply-To: <87frv8108j.fsf@oldenburg.str.redhat.com>



On 26/04/2024 19:51, Florian Weimer wrote:
> 
> * alexandre ferrieux:
> 
>> diff --git a/libio/bits/types/struct_FILE.h b/libio/bits/types/struct_FILE.h
>> index 7cdaae86f8..daebd6ce0a 100644
>> --- a/libio/bits/types/struct_FILE.h
>> +++ b/libio/bits/types/struct_FILE.h
>> @@ -67,7 +67,7 @@ struct _IO_FILE
>>  
>>    struct _IO_marker *_markers;
>>  
>> -  struct _IO_FILE *_chain;
>> +  struct _IO_FILE *_chain,**_prevchain;
>>  
>>    int _fileno;
>>    int _flags2;
> 
> Unfortunately, this struct is part of the ABI for several reasons.  For
> example, _IO_2_1_stdin_ is a global variable exported by libc.so.6, and
> it has a struct _IO_FILE member.  It cannot change size due to copy
> relocations, even if nothing accesses members after _chain.
> 
> I disagree with H.J.'s suggestion that the answer is symbol
> versions. 8-)

Interesting !

So we are in the presence of software that can no longer change, _ever_ ?
What about bumping to _IO_2_2 ?

> Two options come to my mind: Use the FILE * value itself as a hash table
> key (and use _chain for resolving bucket conflicts), or use a dynarray
> and replace _chain with a union of a pointer and an unsigned int,
> containing the dynarray index for that particular file.  The latter has
> the advantage that we can use it to implement arbitrary extensions in
> the future.  Either approach should preserve compatibility with GCC 2.95
> libstdc++ if we are a bit careful.

Argggh. Jumping through complex, inefficient and hard-to-maintain hoops,
because a fundamentally opaque type has been inadvertently exposed ?

Imagine the state of _IO_FILE 50 years from now, after a dozen of similar hacks 
have piled up...

Are there absolutely no plans to someday deprecate the problematic, but 
extremely rare, accesses to those types that should have remained opaque ?



____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

  reply	other threads:[~2024-04-26 18:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 14:18 [PATCH] Fix #27777 - now use a doubly-linked list for _IO_list_all alexandre.ferrieux
2024-04-26 14:45 ` H.J. Lu
     [not found]   ` <ffa6e29b-3a7b-4be6-a0d2-327510a7094d@orange.com>
2024-04-26 15:05     ` H.J. Lu
2024-04-26 15:12       ` H.J. Lu
     [not found]       ` <84cbc4a9-2ddf-45f3-94be-132441db5c8a@orange.com>
2024-04-26 15:16         ` H.J. Lu
     [not found]           ` <7fa02e06-42b1-463b-a7c4-66600d524186@orange.com>
2024-04-26 16:08             ` H.J. Lu
     [not found]               ` <5fad7b2e-43a4-4e57-bd10-a9ce1ce38006@orange.com>
2024-04-26 16:24                 ` H.J. Lu
2024-04-26 17:51 ` Florian Weimer
2024-04-26 18:20   ` alexandre.ferrieux [this message]
2024-04-26 18:44     ` alexandre.ferrieux
2024-04-26 19:08       ` Florian Weimer
2024-04-26 19:08     ` Florian Weimer
2024-04-26 18:50   ` H.J. Lu
2024-04-26 19:04     ` alexandre.ferrieux
2024-04-26 19:16       ` Florian Weimer
2024-04-26 20:15         ` alexandre.ferrieux
2024-04-29 13:20           ` Florian Weimer
2024-04-29 19:05             ` alexandre.ferrieux
2024-04-30  2:47               ` H.J. Lu
2024-04-30 17:22                 ` H.J. Lu
2024-04-26 19:09     ` Florian Weimer
  -- strict thread matches above, loose matches on Subject: below --
2024-04-30 17:20 H.J. Lu
2024-04-30 18:00 ` alexandre.ferrieux
2024-04-30 18:11   ` H.J. Lu
2024-04-30 19:37     ` H.J. Lu
2024-04-30 19:52     ` alexandre.ferrieux
2024-04-30 20:02       ` H.J. Lu

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-all from there: mbox

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=6977a24b-db32-4fbb-bd4e-df4e1d476634@orange.com \
    --to=alexandre.ferrieux@orange.com \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).