public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12234] New: iconvlist API
@ 2010-11-18 21:05 tromey at redhat dot com
  2010-11-18 21:06 ` [Bug libc/12234] " jan.kratochvil at redhat dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tromey at redhat dot com @ 2010-11-18 21:05 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

           Summary: iconvlist API
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: tromey@redhat.com


Currently gdb has to invoke "iconv -l" and parse its output
in order to determine the list of available charsets.
It would be nice if glibc provided an iconvlist API, like libiconv,
to avoid this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
@ 2010-11-18 21:06 ` jan.kratochvil at redhat dot com
  2010-11-18 22:21 ` drepper.fsp at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jan.kratochvil at redhat dot com @ 2010-11-18 21:06 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
  2010-11-18 21:06 ` [Bug libc/12234] " jan.kratochvil at redhat dot com
@ 2010-11-18 22:21 ` drepper.fsp at gmail dot com
  2010-11-19 19:19 ` tromey at redhat dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: drepper.fsp at gmail dot com @ 2010-11-18 22:21 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #1 from Ulrich Drepper <drepper.fsp at gmail dot com> 2010-11-18 22:21:34 UTC ---
You don't say why you think you need that.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
  2010-11-18 21:06 ` [Bug libc/12234] " jan.kratochvil at redhat dot com
  2010-11-18 22:21 ` drepper.fsp at gmail dot com
@ 2010-11-19 19:19 ` tromey at redhat dot com
  2010-11-19 21:50 ` drepper.fsp at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at redhat dot com @ 2010-11-19 19:19 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

--- Comment #2 from Tom Tromey <tromey at redhat dot com> 2010-11-19 19:18:55 UTC ---
gdb lets the user indicate the target charset.
In order to allow command-line completion we need a list of charsets.

Having an API is nicer than trying to parse iconv -l output.
Right now we have to have workarounds for old/strange versions of iconv.
Also this means that every gdb startup involves a second fork/exec.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (2 preceding siblings ...)
  2010-11-19 19:19 ` tromey at redhat dot com
@ 2010-11-19 21:50 ` drepper.fsp at gmail dot com
  2010-12-07 14:26 ` jan.kratochvil at redhat dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: drepper.fsp at gmail dot com @ 2010-11-19 21:50 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

--- Comment #3 from Ulrich Drepper <drepper.fsp at gmail dot com> 2010-11-19 21:50:06 UTC ---
You shouldn't offer this.  Having a name on the list doesn't guarantee that a
conversion between any two of the listed encodings is possible.  The only way
to find out whether it is possible is by calling iconv_open.

Even if you overlook this flaw in your use, such an interface doesn't belong
into libc.  Except for your use there is no known user.

The only possibility I'd except is to make the iconv program a PIE.  Then you
could dlopen() the file and call a special function.  That function could
return in some way or form the list of encodings.  This wouldn't require any
code duplication.  But is it really worth the time?  The forking really
shouldn't be that expensive.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (3 preceding siblings ...)
  2010-11-19 21:50 ` drepper.fsp at gmail dot com
@ 2010-12-07 14:26 ` jan.kratochvil at redhat dot com
  2010-12-07 15:48 ` drepper.fsp at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jan.kratochvil at redhat dot com @ 2010-12-07 14:26 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

--- Comment #4 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2010-12-07 08:20:15 UTC ---
(In reply to comment #3)
> such an interface doesn't belong into libc.
> Except for your use there is no known user.

This is a chicken-and-egg problem.  How there can be a user of nonexisting API?


> The only possibility I'd except is to make the iconv program a PIE.  Then you
> could dlopen() the file and call a special function.

This idea contradicts "How To Write Shared Libraries", section 1.6.
  Number of Objects: The fact that a smaller number of objects containing
  the same functionality is beneficial has been mentioned in several places
  [...]


> But is it really worth the time?  The forking really shouldn't be that
> expensive.

Isn't the prelink optimizing an even cheaper operation - dynamic relocating?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (4 preceding siblings ...)
  2010-12-07 14:26 ` jan.kratochvil at redhat dot com
@ 2010-12-07 15:48 ` drepper.fsp at gmail dot com
  2010-12-08 14:02 ` jan.kratochvil at redhat dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: drepper.fsp at gmail dot com @ 2010-12-07 15:48 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

--- Comment #5 from Ulrich Drepper <drepper.fsp at gmail dot com> 2010-12-07 14:26:03 UTC ---
(In reply to comment #4)
> This is a chicken-and-egg problem.  How there can be a user of nonexisting API?

People could have tried to do exactly what you do today.  Nobody does.  This is
why I say there are no other users.


> This idea contradicts "How To Write Shared Libraries", section 1.6.
>   Number of Objects: The fact that a smaller number of objects containing
>   the same functionality is beneficial has been mentioned in several places
>   [...]

You seem to miss how the PIE solution would work.  The iconv program would
continue to work as before.  It'd just be loaded slightly differently.  But at
the same time you could use the same file in dlopen() and then get a pointer to
a function which returns the list.


> > But is it really worth the time?  The forking really shouldn't be that
> > expensive.
> 
> Isn't the prelink optimizing an even cheaper operation - dynamic relocating?

I don't quite follow.  Of course will any specialized solution to get the list
be faster than forking.  I was asking why this is a bottleneck for you in the
first place.  This is something which has to be done in response to a user
action.  The command line interaction of the user should be much slower than
any fork and reading the result.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (5 preceding siblings ...)
  2010-12-07 15:48 ` drepper.fsp at gmail dot com
@ 2010-12-08 14:02 ` jan.kratochvil at redhat dot com
  2011-05-11  8:37 ` jan.kratochvil at redhat dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jan.kratochvil at redhat dot com @ 2010-12-08 14:02 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

--- Comment #6 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2010-12-07 16:48:14 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> > This idea contradicts "How To Write Shared Libraries", section 1.6.
> 
> You seem to miss how the PIE solution would work.  The iconv program would
> continue to work as before.  It'd just be loaded slightly differently.  But at
> the same time you could use the same file in dlopen() and then get a pointer to
> a function which returns the list.

GDB will have to load two shared libraries (glibc+iconv) instead of just one
(glibc).  This is against the "How To Write Shared Libraries" recommendation.


> I was asking why this is a bottleneck for you in the
> first place.  This is something which has to be done in response to a user
> action.  The command line interaction of the user should be much slower than
> any fork and reading the result.

GDB is also being called from various scripts.  GDB currently does not allow to
make the iconv list initialization lazy due to its existing commands
infrastructure.  Thanks for the advice how to optimize it on the GDB side.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (6 preceding siblings ...)
  2010-12-08 14:02 ` jan.kratochvil at redhat dot com
@ 2011-05-11  8:37 ` jan.kratochvil at redhat dot com
  2012-12-19 10:42 ` schwab@linux-m68k.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-05-11  8:37 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #7 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-05-11 08:36:37 UTC ---
There had to be --with-iconv-bin introduced now as the applications depending
on iconv need to use both its functions and finds its iconv binary:
http://sourceware.org/ml/gdb-patches/2011-05/msg00169.html

There is no more info to provide about this RFE, clearing WAITING.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (7 preceding siblings ...)
  2011-05-11  8:37 ` jan.kratochvil at redhat dot com
@ 2012-12-19 10:42 ` schwab@linux-m68k.org
  2014-06-30  6:25 ` fweimer at redhat dot com
  2015-08-27 22:05 ` [Bug locale/12234] " jsm28 at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: schwab@linux-m68k.org @ 2012-12-19 10:42 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12234

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper.fsp at gmail dot    |unassigned at sourceware
                   |com                         |dot org

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (8 preceding siblings ...)
  2012-12-19 10:42 ` schwab@linux-m68k.org
@ 2014-06-30  6:25 ` fweimer at redhat dot com
  2015-08-27 22:05 ` [Bug locale/12234] " jsm28 at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: fweimer at redhat dot com @ 2014-06-30  6:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12234

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug locale/12234] iconvlist API
  2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
                   ` (9 preceding siblings ...)
  2014-06-30  6:25 ` fweimer at redhat dot com
@ 2015-08-27 22:05 ` jsm28 at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-08-27 22:05 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12234

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |locale

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2015-08-27 22:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 21:05 [Bug libc/12234] New: iconvlist API tromey at redhat dot com
2010-11-18 21:06 ` [Bug libc/12234] " jan.kratochvil at redhat dot com
2010-11-18 22:21 ` drepper.fsp at gmail dot com
2010-11-19 19:19 ` tromey at redhat dot com
2010-11-19 21:50 ` drepper.fsp at gmail dot com
2010-12-07 14:26 ` jan.kratochvil at redhat dot com
2010-12-07 15:48 ` drepper.fsp at gmail dot com
2010-12-08 14:02 ` jan.kratochvil at redhat dot com
2011-05-11  8:37 ` jan.kratochvil at redhat dot com
2012-12-19 10:42 ` schwab@linux-m68k.org
2014-06-30  6:25 ` fweimer at redhat dot com
2015-08-27 22:05 ` [Bug locale/12234] " jsm28 at gcc dot gnu.org

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).