public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aurelien at aurel32 dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/2418] New: getcwd() print an assertion for a path greater than MAX_PATH
Date: Sun, 05 Mar 2006 17:02:00 -0000	[thread overview]
Message-ID: <20060305170201.2418.aurelien@aurel32.net> (raw)

Here is the code which causes problem, in sysdeps/unix/sysv/linux/getcwd.c :

      /* It should never happen that the `getcwd' syscall failed because
         the buffer is too small if we allocated the buffer ourselves
         large enough.  */
      assert (errno != ERANGE || buf != NULL || size != 0);

The buffer allocated by the code before is of size MAX_PATH. So if the actual
size of the path on the filesystem is greater than MAX_PATH, an assertion is
printed.

That proves that it could happen! I suggest simply removing the assertion, as
the function then just exits with the error code.

Note that the problem only occurs on ia64, on other platforms the error number
returned is ENAMETOOLONG (see bug 2417)

-- 
           Summary: getcwd() print an assertion for a path greater than
                    MAX_PATH
           Product: glibc
           Version: 2.3.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: aurelien at aurel32 dot net
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: ia64-unknown-linux-gnu
  GCC host triplet: ia64-unknown-linux-gnu
GCC target triplet: ia64-unknown-linux-gnu


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


             reply	other threads:[~2006-03-05 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-05 17:02 aurelien at aurel32 dot net [this message]
2006-04-01 20:59 ` [Bug libc/2418] " drepper at redhat dot com
2006-04-01 21:38 ` aurelien at aurel32 dot net
2006-04-01 21:40 ` aurelien at aurel32 dot net
2006-04-01 21:51 ` schwab at suse dot de
2006-04-02 17:59 ` drepper at redhat dot com

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=20060305170201.2418.aurelien@aurel32.net \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /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).