| Summary: | free()-ing a stack variable | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | Jonh Wendell <jonh.wendell> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | sample code that shows the issue | ||
uClibc's behavior is standards conforming. from the spec: http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html [...], if the argument does not match a pointer earlier returned by [...] malloc(), or if the space has been deallocated by a call to free() or realloc(), the behavior is undefined. if you want to propose a debug option to add optional checking, then by all means. but current uClibc behavior is not broken. |
Created attachment 3962 [details] sample code that shows the issue we're supposed to not being able do free() a stack variable, but it seems it's possible with uclibc. in the attached file, the program crashes on line 16, when using GLibc. It runs fine on uclibc.