public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: fr33z3@sources.redhat.com, gmx.net@sources.redhat.com (at)
To: gcc-gnats@gcc.gnu.org
Subject: c++/10269: ncurses function in class causes malloc() syscall to loop infinitly
Date: Sun, 30 Mar 2003 12:16:00 -0000	[thread overview]
Message-ID: <20030330115035.20625.qmail@sources.redhat.com> (raw)


>Number:         10269
>Category:       c++
>Synopsis:       ncurses function in class causes malloc() syscall to loop infinitly
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 30 11:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Tam
>Release:        gcc version 2.95.4 20011002 (Debian prerelease) and also 3.2.3 20030309 (Debian prerelease)
>Organization:
>Environment:
Debian sarge on i686 AMD Athlon(tm) XP 2000+
Libs:
libform.so.5 => /usr/lib/libform.so.5 (0x4001c000)
libncurses.so.5 => /lib/libncurses.so.5 (0x40028000)
libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x40067000)
libm.so.6 => /lib/libm.so.6 (0x400b0000)
libc.so.6 => /lib/libc.so.6 (0x400d1000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>Description:
The Syscall malloc() loops infinitly when it should allocate lets say.. more than 512b of memory (on my system) but allocating only a few bytes works well. It also ran on a similar system to mine using the libncurses.so.4 - so it's either an error in gcc or in libcurses - I don't know for sure...

For further Infos and strange things have a look at the comments in the short c++ source code.
>How-To-Repeat:
g++ -lform -lcurses -o ncursesInClass ncursesInClass.cpp
and run the binary

you can use g++ 2.95 or 3.2 as well to compile.
>Fix:
no idea...
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="ncursesInClass.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ncursesInClass.cpp"

I2luY2x1ZGUgPGZvcm0uaD4KI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ZXRfZm9ybV93aW4obV9mb3JtLCBtX3dpbik7CglzZXRf
Zm9ybV9zdWIobV9mb3JtLCBkZXJ3aW4obV93aW4sIDEsIDMyLCAxLCAxMSkpOwoJZnJlZV9mb3Jt
KG1fZm9ybSk7IC8vIE5vIHByb2JsZW0gd2l0aCB0aGF0IGluIGEgc2ltcGxlIGZ1bmN0aW9uCglm
cmVlX2ZpZWxkKG1fZmllbGRzWzBdKTsKCWRlbHdpbihtX3dpbik7CgllbmR3aW4oKTsKfQoKLyoq
KiogbWFpbiAqKioqLwoKaW50IG1haW4oKQp7CgkvLyBubyBpZigpIC0gbm8gbG9vcGluZywgZXZl
biBpZiBmcmVlX2Zvcm0oKSBpbiBjbGFzcyBpcyB1c2VkCglpZiAoMSkgewkKCQkKCS8vIG1hc2tm
dW5jdGlvbigpOyAvLyB3b3JrcyBmaW5lIHdpdGhvdXQgYW4gb2JqZWN0CgltYXNrIG9tYXNrOwoJ
b21hc2sufm1hc2soKTsKCX0KCQoJY2hhciAqYXJyPSBuZXcgY2hhclsxMDI0XTsJLy8gVGhpcyBp
cyB0aGUgcG9pbnQgd2hlcmUgdGhlIGxvb3BpbmcgYmVnaW5zCgkJCQkJCQkJLy8gdGhlIG1hbGxv
YygpIHN5c2NhbGwgY2F1c2VzIGl0IC0gZHVubm8gd2h5CQkJCQkJCQkJCgkKCWRlbGV0ZSBhcnI7
CglyZXR1cm4gMDsKfQo=


             reply	other threads:[~2003-03-30 11:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-30 12:16 fr33z3, at [this message]
2003-03-31 15:52 bangerth

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=20030330115035.20625.qmail@sources.redhat.com \
    --to=fr33z3@sources.redhat.com \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gmx.net@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).