public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/11522] New: Uninitialised Variable in qsort_r
@ 2010-04-20  3:33 lfsxs0 at gmail dot com
  2010-04-20  7:22 ` [Bug libc/11522] " aj at suse dot de
  0 siblings, 1 reply; 2+ messages in thread
From: lfsxs0 at gmail dot com @ 2010-04-20  3:33 UTC (permalink / raw)
  To: glibc-bugs

In short, the following extract from stdlib/msort.c, lines 182-185, shows the
variable phys_pages is used before initialization in a zero comparison. Is this
legal?

static long int phys_pages;
static int pagesize;

if (phys_pages == 0)

Furthermore, I have a question about qsort opening the /proc/meminfo file to get
the total available memory: I run ACM-ICPC-like contests and use a ptrace-based
sandbox software I wrote exactly for this. It keeps reporting a contestant is
opening a file when he/she is actually just qsort'ing some array. Is there a way
to prevent this behaviour?

Thank you.

-- 
           Summary: Uninitialised Variable in qsort_r
           Product: glibc
           Version: 2.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: lfsxs0 at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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

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


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

* [Bug libc/11522] Uninitialised Variable in qsort_r
  2010-04-20  3:33 [Bug libc/11522] New: Uninitialised Variable in qsort_r lfsxs0 at gmail dot com
@ 2010-04-20  7:22 ` aj at suse dot de
  0 siblings, 0 replies; 2+ messages in thread
From: aj at suse dot de @ 2010-04-20  7:22 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From aj at suse dot de  2010-04-20 07:22 -------
A static variable is initialised as zero according to the C standard.  So,
there's no bug here.

I cannot help you with your other problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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

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


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

end of thread, other threads:[~2010-04-20  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-20  3:33 [Bug libc/11522] New: Uninitialised Variable in qsort_r lfsxs0 at gmail dot com
2010-04-20  7:22 ` [Bug libc/11522] " aj at suse dot de

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