Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-4579] String.append method causes malloc error, but appending by "+=" does not #47156

Closed
swift-ci opened this issue Apr 13, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation run-time crash Bug → crash: Swift code crashed during execution

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-4579
Radar rdar://problem/31610341
Original Reporter florian96 (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

macOS Sierra 10.12.4
MacBook Pro (Retina, 13-inch, Early 2015)
2,9 GHz Intel Core i5
8 GB 1867 Mhz DDR3
Intel Iris Graphics 6100 1536 MB

Xcode 8.3.1

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, OptimizedOnly, RunTimeCrash
Assignee None
Priority Medium

md5: fe2d0d52861310b8aba1d67eb1e583e2

duplicates:

  • SR-4393 Miscompilation: object modified after being freed (Swift 3.1 regression)

Issue Description:

Hi!

I wrote a simple Swift program for college and ran into a problem. After compiling it for Release it started crashing on line 58 with the following error:

MNP3(4498,0x1008b53c0) malloc: *** error for object 0x10200e600: incorrect checksum for freed object - object was probably modified after being freed.

The strange thing is, when I replace the line 58 with:

predictedPoints += [(distanceWeDontKnowHeightFor, searchedHeight)]

so basically use "+=" instead of ".append" to append an element, the problem vanishes.

I attached two files in this ticket, the first one is obviously the source code. The second contains data needed for my program to run. If you want to try it by yourself you should specify the path to the second file in the line 12 of the source code.

@belkadan
Copy link
Contributor

@swift-ci create

@bob-wilson
Copy link

This looks like a duplicate of SR-4393. It is fixed now (in Xcode 8.3.2).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation run-time crash Bug → crash: Swift code crashed during execution
Projects
None yet
Development

No branches or pull requests

4 participants