public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: maierkom@rcs.ei.tum.de
To: gcc-gnats@gcc.gnu.org
Subject: c/5091: variables qualified volatile of type va_list will cause a segmentation fault
Date: Wed, 12 Dec 2001 00:26:00 -0000	[thread overview]
Message-ID: <20011212082127.4304.qmail@sources.redhat.com> (raw)


>Number:         5091
>Category:       c
>Synopsis:       variables qualified volatile of type va_list will cause a segmentation fault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 12 00:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Maier-Komor
>Release:        3.0.0, 3.0.1, 3.0.2
>Organization:
>Environment:
Linux 2.4
>Description:
if one qulifies a variable of type va_list (#include <stdarg.h>) with volatile the program will crash. The variable will own an incorrect address (not on the stack).

This happens with all recent gcc 3.x versions - but not with
the older 2.95.x series
>How-To-Repeat:
The attached file is just a copy of the man page example with volatile inserted. just: compile - run - bang...
>Fix:
Workaround: do not use volatile - but I can't as the code, which I would like to get compiled is automatically generated... So a fix in 3.0.3 would be very helpful. Thanks.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="varargtest.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="varargtest.c"

I2luY2x1ZGUgPHN0ZGFyZy5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCnZvaWQgCmZvbyAoY2hhciAq
Zm10LC4uLikKewogIHZvbGF0aWxlIHZhX2xpc3QgYXA7CiAgaW50IGQ7CiAgY2hhciBjLCAqcCwg
KnM7CiAgdmFfc3RhcnQgKGFwLCBmbXQpOwogIHdoaWxlICgqZm10KQogICAgc3dpdGNoICgqZm10
KyspCiAgICAgIHsKICAgICAgY2FzZSAncyc6CQkvKiBzdHJpbmcgKiAqLwoJcyA9IHZhX2FyZyAo
YXAsIGNoYXIgKik7CglwcmludGYgKCJzdHJpbmcgJXNcbiIsIHMpOwoJYnJlYWs7CiAgICAgIGNh
c2UgJ2QnOgkJLyogaW50ICogKi8KCWQgPSB2YV9hcmcgKGFwLCBpbnQpOwoJcHJpbnRmICgiaW50
ICVkXG4iLCBkKTsKCWJyZWFrOwogICAgICBjYXNlICdjJzoJCS8qIGNoYXIgKiAqLy8qIG5lZWQg
KiBhICogY2FzdCAqIGhlcmUgKiBzaW5jZSAqIHZhX2FyZyAqIG9ubHkgdGFrZXMgZnVsbHkgcHJv
bW90ZWQgdHlwZXMgKi8KCWMgPSAoY2hhcikgdmFfYXJnIChhcCwgaW50KTsKCXByaW50ZiAoImNo
YXIgJWNcbiIsIGMpOwoJYnJlYWs7CiAgICAgIH0KICB2YV9lbmQgKGFwKTsKfQoKaW50IAptYWlu
ICgpCnsKICBmb28oInNkIiwiYWJjIiwzKTsKICByZXR1cm4gMDsKfQo=


             reply	other threads:[~2001-12-12  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-12  0:26 maierkom [this message]
2001-12-12 20:28 rodrigc
2001-12-12 20:36 rodrigc

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=20011212082127.4304.qmail@sources.redhat.com \
    --to=maierkom@rcs.ei.tum.de \
    --cc=gcc-gnats@gcc.gnu.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).