We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 699 - i386 inline asm version of SDL_revcpy is broken
Summary: i386 inline asm version of SDL_revcpy is broken
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.13
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-1.2.14
: 536 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-13 02:27 UTC by Hans de Goede
Modified: 2009-09-17 04:54 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans de Goede 2009-02-13 02:27:54 UTC
The inline asm version of SDL_revcpy sets the reverse direction flag using the std instruction, but does not clear it afterwards (it does not issue the cld instruction at the end of the inline asm). Or so I've been told, my asm isn't all that good.

This causes crashes when programs use memset after having done SDL calls which use SDL_revcpy internally. See for example of a crash caused by this:
https://bugzilla.redhat.com/show_bug.cgi?id=484121

For a detailed analysis of this crash including the conclusion that the missing "cld" is the cause see:
https://bugzilla.redhat.com/show_bug.cgi?id=484362

I've done a compile of SDL-1.2.13 with the inline version of SDL_revcpy disabled and that fixes the (reproducable) crash. I've not written a patch for this though, as I'm no good with asm.
Comment 1 Ryan C. Gordon 2009-09-13 16:33:13 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 2 Patrice Mandin 2009-09-14 10:43:05 UTC
*** Bug 536 has been marked as a duplicate of this bug. ***
Comment 3 Rene Dudfield 2009-09-17 04:54:09 UTC
From the mailing list... this has been fixed.

'Fixed in svn revision #3535 for the 1.2 branch, and #3536 for the 1.3
branch!'