| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | Yes, hits=5.1 required=5.0 tests=AWL,BAYES_50,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_NEUTRAL,URI_HEX |
| X-Spam-Check-By: | sourceware.org |
| Date: | Sun, 13 Jan 2013 19:55:56 -0800 (PST) |
| From: | YZFury <yzfury AT gmail DOT com> |
| To: | cygwin AT cygwin DOT com |
| Message-ID: | <1358135756673-95377.post@n5.nabble.com> |
| Subject: | Using the free(*ptr) routine and getting an exception, "Exception: STATUS_ACCESS_VIOLATION" |
| MIME-Version: | 1.0 |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
I am using eclipse cdt on Windows 8 and the latest Cygwin gcc release. I
have been barely using any C for awhile, so really it is like I am just
starting. I am trying to do something simple:
int *ptr = malloc(sizeof(*ptr));
int x = 87;
ptr = &x;
printf("%d", *ptr);
free(ptr);//it goes wrong here
where as this works:
int *ptr = malloc(sizeof(*ptr));
printf("%d", *ptr);
free(ptr);//so if I don't store anything it works
I searched and couldn't find anything. I have tried disabling windows
defender and also running eclipse as an administrator. Also, I tried it in
the Cygwin bash console, and I got the same type of exception.
I do not think that this is a problem with eclipse, but maybe Cygwin or
Windows 8(the two together).
--
View this message in context: http://cygwin.1069669.n5.nabble.com/Using-the-free-ptr-routine-and-getting-an-exception-Exception-STATUS-ACCESS-VIOLATION-tp95377.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |