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 310 - SDL programs crash when using supermount
Summary: SDL programs crash when using supermount
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: cdrom (show other bugs)
Version: 1.2.11
Hardware: All Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-26 17:23 UTC by Guillaume B.
Modified: 2006-09-07 01:37 UTC (History)
0 users

See Also:


Attachments
don't free() when using alloca (793 bytes, patch)
2006-08-26 17:26 UTC, Guillaume B.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume B. 2006-08-26 17:23:52 UTC
Some SDL programs crash(ed) when using :
* SDL_Init(SDL_INIT_CDROM or SDL_INIT_EVERYTHING)
* supermount (in /etc/mtab or /etc/fstab)
* alloca

Two examples were reported on mandriva bugzilla : holotz-castle and avidemux.

For instance :
$ holotz-castle
*** glibc detected *** holotz-castle: double free or corruption (out):
---8<------

A workaround was first found :
$ SDL_CDROM=/dev/cdrom holotz-castle

Then i proposed this fix, which seem to be OK for other cooker users :
--- src/cdrom/linux/SDL_syscdrom.c~	2006-05-01 10:02:43.000000000 +0200
+++ src/cdrom/linux/SDL_syscdrom.c	2006-08-20 22:44:54.000000000 +0200
@@ -218,7 +218,7 @@
 			if ( SDL_strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) {
 				tmp = SDL_strstr(mntent->mnt_opts, "fs=");
 				if ( tmp ) {
-					SDL_free(mnt_type);
+                                       SDL_stack_free(mnt_type);
 					mnt_type = SDL_strdup(tmp + SDL_strlen("fs="));
 					if ( mnt_type ) {
 						tmp = SDL_strchr(mnt_type, ',');
@@ -229,7 +229,7 @@
 				}
 				tmp = SDL_strstr(mntent->mnt_opts, "dev=");
 				if ( tmp ) {
-					SDL_free(mnt_dev);
+                                       SDL_stack_free(mnt_dev);
 					mnt_dev = SDL_strdup(tmp + SDL_strlen("dev="));
 					if ( mnt_dev ) {
 						tmp = SDL_strchr(mnt_dev, ',');


More details if needed.
http://qa.mandriva.com/show_bug.cgi?id=24005
http://qa.mandriva.com/show_bug.cgi?id=24126
Comment 1 Guillaume B. 2006-08-26 17:26:06 UTC
Created attachment 159 [details]
don't free() when using alloca
Comment 2 Guillaume B. 2006-09-07 01:37:58 UTC
It seems integrated in CVS since september, 5th 2006.
Thanks !