| Summary: | SDL programs crash when using supermount | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Guillaume B. <littletux> |
| Component: | cdrom | Assignee: | 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 | ||
Created attachment 159 [details]
don't free() when using alloca
It seems integrated in CVS since september, 5th 2006. Thanks ! |
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