public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "petre.rodan at subdimension dot ro" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/31212] New: seekdir() unexected directory stream positioning on 32bit arm
Date: Thu, 04 Jan 2024 21:53:08 +0000	[thread overview]
Message-ID: <bug-31212-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 31212
           Summary: seekdir() unexected directory stream positioning on
                    32bit arm
           Product: glibc
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: petre.rodan at subdimension dot ro
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 15284
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15284&action=edit
seekdir test for armv7

hi there!

my stable branch Gentoo Linux comes with a 32-bit specific patch to glibc 2.37,
found here [1] - I guess the offending patch is the one that modifies
sysdeps/unix/sysv/linux/seekdir.c to add the _DIRENT_OFFSET_TRANSLATION ifdef
block.

I have attached a sample test which I run on my armv7. the output reads:

 ./main
 pre:           . .. clockevents platform w1 serio iio gpio event_source
mdio_bus soc cpu mmc scsi mmc_rpmb spi clocksource hid dp-aux usb serial
serial-base
cec sdio genpd nvmem gadget workqueue virtio container i2c mipi-dsi
 s0 location:  4294967295
 s0 entries:
 rew location: 1
 rew entries:   . .. clockevents platform w1 serio iio gpio event_source
mdio_bus soc cpu mmc scsi mmc_rpmb spi clocksource hid dp-aux usb serial
serial-base
cec sdio genpd nvmem gadget workqueue virtio container i2c mipi-dsi

as you can see, seekdir(dp, 0) leaves the location at an invalid -1 value
while rewinddir(dp) works correctly.
I guess that patch is already part of the glibc repo, so can you reproduce the
problem on an armv7?

running the test program on an amd64 Gentoo that contains the same patches
returns a perfect output.

thanks,
peter

[1]
https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/tree/9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch

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

             reply	other threads:[~2024-01-04 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 21:53 petre.rodan at subdimension dot ro [this message]
2024-01-05  8:33 ` [Bug libc/31212] " sam at gentoo dot org
2024-01-05  8:33 ` sam at gentoo dot org
2024-01-05  8:49 ` petre.rodan at subdimension dot ro
2024-01-05 10:15 ` [Bug libc/31212] seekdir() unexpected " petre.rodan at subdimension dot ro
2024-01-06  9:32 ` dilfridge at gentoo dot org
2024-01-21 19:11 ` dilfridge at gentoo dot org

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

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

  git send-email \
    --in-reply-to=bug-31212-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).