public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support
@ 2022-09-18 16:53 deller at gmx dot de
  2022-09-18 17:07 ` [Bug build/29583] " danglin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: deller at gmx dot de @ 2022-09-18 16:53 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 29583
           Summary: iconv failures on 32bit platform due to missing large
                    file support
           Product: glibc
           Version: 2.38
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: deller at gmx dot de
                CC: carlos at redhat dot com
  Target Milestone: ---

While compiling glibc in a 32-bit environment (hppa architecture, 32-bit
userspace, but 64-bit kernel, glibc target is 32-bit as well) I see lots of
failures with iconv like this one:

/build/glibc/glibc-2.34/build-tree/hppa-libc/iconv/iconv_prog: failed to start
conversion processing

I traced it with strace:
3438821
openat(AT_FDCWD,"/build/glibc/glibc-2.34/build-tree/hppa-libc/iconvdata/gconv-modules",O_RDONLY|O_CLOEXEC)
= 3
3438821 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT,STATX_BASIC_STATS,0xf50013c8)
= 0
3438821 read(3,0xfa034678,4096) = 3808
3438821 read(3,0xfa034678,4096) = 0
3438821 close(3) = 0
3438821
openat(AT_FDCWD,"/build/glibc/glibc-2.34/build-tree/hppa-libc/iconvdata/gconv-modules.d",O_RDONLY|O_DIRECTORY|O_LARGEFILE|O_NONBLOCK|O_CLOEXEC)
= 3
3438821 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT,STATX_BASIC_STATS,0xf5001148)
= 0
3438821 getdents64(3,-100439584,32768,99,8,0) = 96
3438821 close(3) = 0

This part comes from gconv_parseconfdir() in  conv/gconv_parseconfdir.h:

  /* Read the gconv-modules configuration file first.  */
  found = read_conf_file (buf, dir, dir_len);

  /* Next, see if there is a gconv-modules.d directory containing
     configuration files and if it is non-empty.  */
  cp--;
  cp[0] = '.';
  cp[1] = 'd';
  cp[2] = '\0';

  DIR *confdir = opendir (buf);
  if (confdir != NULL)
    {
      struct dirent *ent;
      while ((ent = readdir (confdir)) != NULL)

as can be seen, readdir() is called and the syscall returns 96 bytes for
getdents64(), but the "ent" variable nevertheless gets NULL and returns without
reading the "gconv-modules-extra.conf" file.

Finally it turns out, that this is a problem of missing large file support
while scanning the contents of the gconv-modules.d/ directory.
In my build environment the
/build/glibc/glibc-2.34/build-tree/hppa-libc/iconvdata/gconv-modules.d/gconv-modules-extra.conf
file is located on-disk on a high inode, 
thus the readdir() function returns NULL.

I manually changed the code above to use the 64-bit variants to become:
      struct dirent64 *ent;
      while ((ent = readdir64 (confdir)) != NULL)
which then worked.

So finally, I'd suggest to enable 64-bit file-support for this specific
function.
Either by manually using the 64-bit variants, or by compiling with 
-D_LARGE_FILE_SOURCE=1  -D_FILE_OFFSET_BITS=64
(whatever is possible and makes sense).

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

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

* [Bug build/29583] iconv failures on 32bit platform due to missing large file support
  2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
@ 2022-09-18 17:07 ` danglin at gcc dot gnu.org
  2022-09-19  6:59 ` fweimer at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: danglin at gcc dot gnu.org @ 2022-09-18 17:07 UTC (permalink / raw)
  To: glibc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danglin at gcc dot gnu.org

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

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

* [Bug build/29583] iconv failures on 32bit platform due to missing large file support
  2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
  2022-09-18 17:07 ` [Bug build/29583] " danglin at gcc dot gnu.org
@ 2022-09-19  6:59 ` fweimer at redhat dot com
  2022-09-19  7:27 ` fweimer at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2022-09-19  6:59 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com
   Last reconfirmed|                            |2022-09-19

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

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

* [Bug build/29583] iconv failures on 32bit platform due to missing large file support
  2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
  2022-09-18 17:07 ` [Bug build/29583] " danglin at gcc dot gnu.org
  2022-09-19  6:59 ` fweimer at redhat dot com
@ 2022-09-19  7:27 ` fweimer at redhat dot com
  2022-09-20 10:13 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2022-09-19  7:27 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Patch posted:

[PATCH] gconv: Use 64-bit interfaces in gconv_parseconfdir (bug 29583)
<https://sourceware.org/pipermail/libc-alpha/2022-September/142060.html>

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

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

* [Bug build/29583] iconv failures on 32bit platform due to missing large file support
  2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
                   ` (2 preceding siblings ...)
  2022-09-19  7:27 ` fweimer at redhat dot com
@ 2022-09-20 10:13 ` fweimer at redhat dot com
  2022-09-20 19:13 ` deller at gmx dot de
  2022-09-21 12:13 ` fweimer at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2022-09-20 10:13 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.37
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for 2.37 via:

commit f97905f24631097af325d6a231093071c3077a5f
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Sep 20 12:12:43 2022 +0200

    gconv: Use 64-bit interfaces in gconv_parseconfdir (bug 29583)

    It's possible that inode numbers are outside the 32-bit range.
    The existing code only handles the in-libc case correctly, and
    still uses the legacy interfaces when building iconv.

    Suggested-by: Helge Deller <deller@gmx.de>

Please let us know if we should backport this anywhere.

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

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

* [Bug build/29583] iconv failures on 32bit platform due to missing large file support
  2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
                   ` (3 preceding siblings ...)
  2022-09-20 10:13 ` fweimer at redhat dot com
@ 2022-09-20 19:13 ` deller at gmx dot de
  2022-09-21 12:13 ` fweimer at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: deller at gmx dot de @ 2022-09-20 19:13 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Helge Deller <deller at gmx dot de> ---
On 9/20/22 12:13, fweimer at redhat dot com wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=29583
>
> Florian Weimer <fweimer at redhat dot com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>           Resolution|---                         |FIXED
>     Target Milestone|---                         |2.37
>               Status|ASSIGNED                    |RESOLVED
>
> --- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
> Fixed for 2.37 via:
>
> commit f97905f24631097af325d6a231093071c3077a5f
> Author: Florian Weimer <fweimer@redhat.com>
> Date:   Tue Sep 20 12:12:43 2022 +0200
>
>      gconv: Use 64-bit interfaces in gconv_parseconfdir (bug 29583)
>
>      It's possible that inode numbers are outside the 32-bit range.
>      The existing code only handles the in-libc case correctly, and
>      still uses the legacy interfaces when building iconv.
>
>      Suggested-by: Helge Deller <deller@gmx.de>
>
> Please let us know if we should backport this anywhere.

Yes, could you please backport it to 2.34+ ?
I'm running on Debian/unstable and it has 2.34.

Thanks,
Helge

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

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

* [Bug build/29583] iconv failures on 32bit platform due to missing large file support
  2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
                   ` (4 preceding siblings ...)
  2022-09-20 19:13 ` deller at gmx dot de
@ 2022-09-21 12:13 ` fweimer at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2022-09-21 12:13 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Helge Deller from comment #3)
> Yes, could you please backport it to 2.34+ ?
> I'm running on Debian/unstable and it has 2.34.

Fair enough, backported to 2.34 and later.

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

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

end of thread, other threads:[~2022-09-21 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18 16:53 [Bug build/29583] New: iconv failures on 32bit platform due to missing large file support deller at gmx dot de
2022-09-18 17:07 ` [Bug build/29583] " danglin at gcc dot gnu.org
2022-09-19  6:59 ` fweimer at redhat dot com
2022-09-19  7:27 ` fweimer at redhat dot com
2022-09-20 10:13 ` fweimer at redhat dot com
2022-09-20 19:13 ` deller at gmx dot de
2022-09-21 12:13 ` fweimer at redhat dot com

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