GNOME Bugzilla – Bug 348455
[filesrc] should not use mmap() by default, since it might cause SIGBUS when reading from corrupt medium or if device disappears unexpectedly
Last modified: 2007-10-19 22:40:31 UTC
What were you doing when the app crashed?: Attempting to play VideoCD Mpeg-1 .dat Distribution: Ubuntu 6.10 (edgy) Gnome Release: 2.15.4 2006-07-11 (Ubuntu) BugBuddy Version: 2.15.0 Memmory status: size: 61018112 vsize: 0 resident: 61018112 share: 0 rss: 22917120 rss_rlim: 0 CPU usage: start_time: 1153699481 rtime: 0 utime: 139 stime: 0 cutime:131 cstime: 0 timeout: 8 it_real_value: 0 frequency: 5 Backtrace was generated from '/usr/bin/totem' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1225484624 (LWP 6829)] [New Thread -1246028896 (LWP 6837)] [New Thread -1237562464 (LWP 6832)] (no debugging symbols found) 0xffffe410 in __kernel_vsyscall ()
+ Trace 69547
Thread 1 (Thread -1225484624 (LWP 6829))
The stack trace looks pretty messed up and not very useful I'm afraid. Do you also get the crash with $ gst-typefind-0.10 /path/to/yourfile.dat or $ gst-launch-0.10 -v playbin uri=file:///path/to/yourfile.dat ? Could you install the following packages libgstreamer0.10-0-dbg gstreamer0.10-plugins-base-dbg gstreamer0.10-plugins-good-dbg gstreamer0.10-plugins-ugly-dbg and then try getting a stack trace again?
After some more experimenting it turns out I am getting read errors off the disc according to nautilus. mplayer and vlc don't seem to mind, for what its worth, so I suppose the "blame" can be on gstreamer here. Unless you can think of an easy way to fail gracefully here without crashing I'm content with this bug being closed. wade@tinkerbell:~$ gst-typefind-0.10 /media/cdrom/mpegav/avseq01.dat Bus error wade@tinkerbell:~$ gst-launch-0.10 -v playbin uri=file:///media/cdrom/mpegav/avseq01.dat Setting pipeline to PAUSED ... Bus error Report with -dbg packages: Distribution: Ubuntu 6.10 (edgy) Gnome Release: 2.15.4 2006-07-11 (Ubuntu) BugBuddy Version: 2.15.0 Memmory status: size: 58810368 vsize: 0 resident: 58810368 share: 0 rss: 20594688 rss_rlim: 0 CPU usage: start_time: 1153787733 rtime: 0 utime: 111 stime: 0 cutime:103 cstime: 0 timeout: 8 it_real_value: 0 frequency: 6 Backtrace was generated from '/usr/bin/totem' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1225947472 (LWP 6460)] [New Thread -1246401632 (LWP 6470)] [New Thread -1237935200 (LWP 6465)] 0xffffe410 in __kernel_vsyscall ()
+ Trace 69588
Thread 1 (Thread -1225947472 (LWP 6460))
> After some more experimenting it turns out I am getting read errors off the > disc according to nautilus. What does it say exactly? Does the output of 'dmesg' indicate read errors from the CD device as well? > mplayer and vlc don't seem to mind, for what its > worth, so I suppose the "blame" can be on gstreamer here. > > Unless you can think of an easy way to fail gracefully here without crashing > I'm content with this bug being closed. I am not really sure what exactly is happening here yet. I think it might need a bit more investigating. The crash seems to be in the line where it touches the pages: 718 : /* if we need to touch the buffer (to bring it into memory), do so */ 719 : if (src->touch) { 720 : volatile guchar *p = GST_BUFFER_DATA (buf), c; 721 : 722 : /* read first byte of each page */ 723 : for (i = 0; i < GST_BUFFER_SIZE (buf); i += src->pagesize) 724 : c = p[i]; 725 : } We should never really crash. We might not check for errors properly somewhere.
*** Bug 348475 has been marked as a duplicate of this bug. ***
It would appear we'll run into similar problems with mmap() if - a device (ipod, external harddrive, usb stick) is removed/unplugged while still in use - an mmap()'ed file is truncated There don't seem to be many possibilities of handling these things gracefully. Installing a global signal handler isn't really an acceptable thing to do for a library (but even then it would be fairly complicated to deal with it). Maybe we should just default to normal read() again? The performance win of mmap() is probably negligible compared to the cpu time used for audio/video decoding/encoding. Shame about the additional memory usage though...
(In reply to comment #3) > > After some more experimenting it turns out I am getting read errors off the > > disc according to nautilus. > > What does it say exactly? Does the output of 'dmesg' indicate read errors from > the CD device as well? > nautilus says "Error "I/O error" while copying "/media/cdr...vseq01.dat"." dmesg exceprt: [17185012.460000] Buffer I/O error on device sr0, logical block 1259 [17185012.676000] end_request: I/O error, dev sr0, sector 5036
2006-07-27 Tim-Philipp Müller <tim at centricular dot net> * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): Do not use mmap() by default since there are a number of error conditions that we would like to handle in a non-fatal way that will result in a SIGBUS if we use mmap(). Examples: external devices (USB harddrive, portable music player) being unplugged while in use; file on mounted CD/DVD that can't be read because the medium is partly damaged. Fixes #348455 and #348475.
*** Bug 350317 has been marked as a duplicate of this bug. ***
*** Bug 350661 has been marked as a duplicate of this bug. ***
*** Bug 353267 has been marked as a duplicate of this bug. ***
*** Bug 353315 has been marked as a duplicate of this bug. ***
*** Bug 353890 has been marked as a duplicate of this bug. ***
*** Bug 354132 has been marked as a duplicate of this bug. ***
*** Bug 354026 has been marked as a duplicate of this bug. ***
*** Bug 355312 has been marked as a duplicate of this bug. ***
*** Bug 355337 has been marked as a duplicate of this bug. ***
*** Bug 355677 has been marked as a duplicate of this bug. ***
*** Bug 356401 has been marked as a duplicate of this bug. ***
*** Bug 356524 has been marked as a duplicate of this bug. ***
*** Bug 357449 has been marked as a duplicate of this bug. ***
*** Bug 358565 has been marked as a duplicate of this bug. ***
*** Bug 363492 has been marked as a duplicate of this bug. ***
*** Bug 363935 has been marked as a duplicate of this bug. ***
*** Bug 364172 has been marked as a duplicate of this bug. ***
*** Bug 364587 has been marked as a duplicate of this bug. ***
*** Bug 365140 has been marked as a duplicate of this bug. ***
*** Bug 365307 has been marked as a duplicate of this bug. ***
*** Bug 367859 has been marked as a duplicate of this bug. ***
*** Bug 367979 has been marked as a duplicate of this bug. ***
*** Bug 369545 has been marked as a duplicate of this bug. ***
*** Bug 370388 has been marked as a duplicate of this bug. ***
*** Bug 370901 has been marked as a duplicate of this bug. ***
*** Bug 371299 has been marked as a duplicate of this bug. ***
*** Bug 371558 has been marked as a duplicate of this bug. ***
*** Bug 372047 has been marked as a duplicate of this bug. ***
*** Bug 372162 has been marked as a duplicate of this bug. ***
I have found that in my case (bug #371558) totem crashes every time I use CSS-encoded disk. I have no such problem playing DVDs without CSS.
*** Bug 372830 has been marked as a duplicate of this bug. ***
*** Bug 373199 has been marked as a duplicate of this bug. ***
*** Bug 374467 has been marked as a duplicate of this bug. ***
*** Bug 374542 has been marked as a duplicate of this bug. ***
*** Bug 374996 has been marked as a duplicate of this bug. ***
*** Bug 375709 has been marked as a duplicate of this bug. ***
*** Bug 376440 has been marked as a duplicate of this bug. ***
*** Bug 376671 has been marked as a duplicate of this bug. ***
*** Bug 374554 has been marked as a duplicate of this bug. ***
*** Bug 374176 has been marked as a duplicate of this bug. ***
*** Bug 374817 has been marked as a duplicate of this bug. ***
*** Bug 377279 has been marked as a duplicate of this bug. ***
*** Bug 377285 has been marked as a duplicate of this bug. ***
*** Bug 377395 has been marked as a duplicate of this bug. ***
*** Bug 377569 has been marked as a duplicate of this bug. ***
*** Bug 378200 has been marked as a duplicate of this bug. ***
*** Bug 378077 has been marked as a duplicate of this bug. ***
*** Bug 379500 has been marked as a duplicate of this bug. ***
*** Bug 379507 has been marked as a duplicate of this bug. ***
*** Bug 382545 has been marked as a duplicate of this bug. ***
*** Bug 383416 has been marked as a duplicate of this bug. ***
*** Bug 386225 has been marked as a duplicate of this bug. ***
*** Bug 388641 has been marked as a duplicate of this bug. ***
*** Bug 388297 has been marked as a duplicate of this bug. ***
*** Bug 393421 has been marked as a duplicate of this bug. ***
*** Bug 393422 has been marked as a duplicate of this bug. ***
*** Bug 395336 has been marked as a duplicate of this bug. ***
*** Bug 388806 has been marked as a duplicate of this bug. ***
*** Bug 394042 has been marked as a duplicate of this bug. ***
*** Bug 393091 has been marked as a duplicate of this bug. ***
*** Bug 391336 has been marked as a duplicate of this bug. ***
*** Bug 389665 has been marked as a duplicate of this bug. ***
*** Bug 398381 has been marked as a duplicate of this bug. ***
*** Bug 398382 has been marked as a duplicate of this bug. ***
*** Bug 398378 has been marked as a duplicate of this bug. ***
*** Bug 398456 has been marked as a duplicate of this bug. ***
*** Bug 401563 has been marked as a duplicate of this bug. ***
*** Bug 406346 has been marked as a duplicate of this bug. ***
*** Bug 406518 has been marked as a duplicate of this bug. ***
*** Bug 406757 has been marked as a duplicate of this bug. ***
*** Bug 406787 has been marked as a duplicate of this bug. ***
*** Bug 406802 has been marked as a duplicate of this bug. ***
*** Bug 407207 has been marked as a duplicate of this bug. ***
*** Bug 408672 has been marked as a duplicate of this bug. ***
*** Bug 409409 has been marked as a duplicate of this bug. ***
*** Bug 413042 has been marked as a duplicate of this bug. ***
*** Bug 413043 has been marked as a duplicate of this bug. ***
*** Bug 413196 has been marked as a duplicate of this bug. ***
*** Bug 413550 has been marked as a duplicate of this bug. ***
*** Bug 412967 has been marked as a duplicate of this bug. ***
*** Bug 415880 has been marked as a duplicate of this bug. ***
*** Bug 416951 has been marked as a duplicate of this bug. ***
*** Bug 414263 has been marked as a duplicate of this bug. ***
*** Bug 416925 has been marked as a duplicate of this bug. ***
*** Bug 418114 has been marked as a duplicate of this bug. ***
*** Bug 419056 has been marked as a duplicate of this bug. ***
*** Bug 421386 has been marked as a duplicate of this bug. ***
*** Bug 421854 has been marked as a duplicate of this bug. ***
*** Bug 422038 has been marked as a duplicate of this bug. ***
*** Bug 422322 has been marked as a duplicate of this bug. ***
*** Bug 420293 has been marked as a duplicate of this bug. ***
*** Bug 423164 has been marked as a duplicate of this bug. ***
*** Bug 423393 has been marked as a duplicate of this bug. ***
*** Bug 419111 has been marked as a duplicate of this bug. ***
*** Bug 424008 has been marked as a duplicate of this bug. ***
*** Bug 427056 has been marked as a duplicate of this bug. ***
*** Bug 426691 has been marked as a duplicate of this bug. ***
*** Bug 428026 has been marked as a duplicate of this bug. ***
*** Bug 432983 has been marked as a duplicate of this bug. ***
*** Bug 431548 has been marked as a duplicate of this bug. ***
*** Bug 431996 has been marked as a duplicate of this bug. ***
*** Bug 432080 has been marked as a duplicate of this bug. ***
*** Bug 434474 has been marked as a duplicate of this bug. ***
*** Bug 435736 has been marked as a duplicate of this bug. ***
*** Bug 436016 has been marked as a duplicate of this bug. ***
*** Bug 440129 has been marked as a duplicate of this bug. ***
*** Bug 440814 has been marked as a duplicate of this bug. ***
*** Bug 441229 has been marked as a duplicate of this bug. ***
*** Bug 441998 has been marked as a duplicate of this bug. ***
*** Bug 443624 has been marked as a duplicate of this bug. ***
*** Bug 443653 has been marked as a duplicate of this bug. ***
*** Bug 444731 has been marked as a duplicate of this bug. ***
*** Bug 446032 has been marked as a duplicate of this bug. ***
*** Bug 447154 has been marked as a duplicate of this bug. ***
*** Bug 447156 has been marked as a duplicate of this bug. ***
*** Bug 447157 has been marked as a duplicate of this bug. ***
*** Bug 447828 has been marked as a duplicate of this bug. ***
*** Bug 448145 has been marked as a duplicate of this bug. ***
*** Bug 448567 has been marked as a duplicate of this bug. ***
*** Bug 448950 has been marked as a duplicate of this bug. ***
*** Bug 449957 has been marked as a duplicate of this bug. ***
*** Bug 450003 has been marked as a duplicate of this bug. ***
*** Bug 450173 has been marked as a duplicate of this bug. ***
*** Bug 455557 has been marked as a duplicate of this bug. ***
*** Bug 456359 has been marked as a duplicate of this bug. ***
*** Bug 459209 has been marked as a duplicate of this bug. ***
*** Bug 459361 has been marked as a duplicate of this bug. ***
*** Bug 459642 has been marked as a duplicate of this bug. ***
*** Bug 460456 has been marked as a duplicate of this bug. ***
*** Bug 457563 has been marked as a duplicate of this bug. ***
*** Bug 461362 has been marked as a duplicate of this bug. ***
*** Bug 464031 has been marked as a duplicate of this bug. ***
*** Bug 464033 has been marked as a duplicate of this bug. ***
*** Bug 470016 has been marked as a duplicate of this bug. ***
*** Bug 473437 has been marked as a duplicate of this bug. ***
*** Bug 483440 has been marked as a duplicate of this bug. ***
*** Bug 484141 has been marked as a duplicate of this bug. ***
*** Bug 484370 has been marked as a duplicate of this bug. ***
*** Bug 469670 has been marked as a duplicate of this bug. ***
*** Bug 482312 has been marked as a duplicate of this bug. ***