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

Summary: SDL programs crash when using supermount
Product: SDL Reporter: Guillaume B. <littletux>
Component: cdromAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.11   
Hardware: All   
OS: Linux   
Attachments: don't free() when using alloca

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 !