GNOME Bugzilla – Bug 680495
flacparse: seeking within some flac files hangs totem
Last modified: 2012-07-24 17:18:07 UTC
When I try to seek within some particular flac files, totem freezes and uses 100% of a CPU. totem 3.4.0 Link to an example flac file, for testing purposes: https://docs.google.com/open?id=0B5FXtHrNOWfPa21paHhyLUkxNnM
Here is a bit of strace, while it was frozen: fstat(35, {st_mode=S_IFREG|0644, st_size=112431924, ...}) = 0 mmap(NULL, 35721216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc50ddee000 lseek(35, 2473596, SEEK_SET) = 2473596 read(35, "\377\370Y\250\304\221\273\26\377\330\0[\0\313\r)+\301%\33a[\372U\375\375X\34@\321\314A"..., 35717120) = 35717120 munmap(0x7fc50ddee000, 35721216) = 0 fstat(35, {st_mode=S_IFREG|0644, st_size=112431924, ...}) = 0 mmap(NULL, 35786752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc50ddde000 lseek(35, 2473596, SEEK_SET) = 2473596 read(35, "\377\370Y\250\304\221\273\26\377\330\0[\0\313\r)+\301%\33a[\372U\375\375X\34@\321\314A"..., 35782656) = 35782656 munmap(0x7fc50ddde000, 35786752) = 0 fstat(35, {st_mode=S_IFREG|0644, st_size=112431924, ...}) = 0 mmap(NULL, 35852288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc50ddce000 lseek(35, 2473596, SEEK_SET) = 2473596 read(35, "\377\370Y\250\304\221\273\26\377\330\0[\0\313\r)+\301%\33a[\372U\375\375X\34@\321\314A"..., 35848192) = 35848192 munmap(0x7fc50ddce000, 35852288) = 0 fstat(35, {st_mode=S_IFREG|0644, st_size=112431924, ...}) = 0 mmap(NULL, 35917824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc50ddbe000 lseek(35, 2473596, SEEK_SET) = 2473596 read(35, "\377\370Y\250\304\221\273\26\377\330\0[\0\313\r)+\301%\33a[\372U\375\375X\34@\321\314A"..., 35913728) = 35913728 munmap(0x7fc50ddbe000, 35917824) = 0 fstat(35, {st_mode=S_IFREG|0644, st_size=112431924, ...}) = 0 mmap(NULL, 35983360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc50ddae000 lseek(35, 2473596, SEEK_SET) = 2473596 read(35, "\377\370Y\250\304\221\273\26\377\330\0[\0\313\r)+\301%\33a[\372U\375\375X\34@\321\314A"..., 35979264) = 35979264 munmap(0x7fc50ddae000, 35983360) = 0 fstat(35, {st_mode=S_IFREG|0644, st_size=112431924, ...}) = 0 mmap(NULL, 36048896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc50dd9e000 lseek(35, 2473596, SEEK_SET) = 2473596 read(35, "\377\370Y\250\304\221\273\26\377\330\0[\0\313\r)+\301%\33a[\372U\375\375X\34@\321\314A"..., 36044800) = 36044800 --- SIGTERM (Terminated) @ 0 (0) --- +++ killed by SIGTERM +++
Looks like flacparse is stuck in a loop going back to the same offset:
+ Trace 230572
Thread 1 (Thread 0x7f46efea3980 (LWP 28852))
After enabling some debugging and contuing: baseparse gstbaseparse.c:2831:gst_base_parse_scan_frame:<flacparse0> getting some more data baseparse gstbaseparse.c:2773:gst_base_parse_scan_frame:<flacparse0> reading buffer size 3211264 baseparse gstbaseparse.c:1757:gst_base_parse_handle_buffer:<flacparse0> handling buffer of size 3211264 with ts 99:99:99.999999999, duration 99:99:99.999999999 baseparse gstbaseparse.c:1710:gst_base_parse_prepare_frame:<flacparse0> preparing frame at offset 7474748 (0x720e3c) of size 3211264 baseparse gstbaseparse.c:674:gst_base_parse_frame_new: created frame 0x7f46d84bd1e0 flacparse gstflacparse.c:800:gst_flac_parse_handle_frame:<flacparse0> Found sync code flacparse gstflacparse.c:616:gst_flac_parse_frame_header_is_valid:<flacparse0> Parsed frame at offset 7474748: Block size: 4096 Sample/Frame number: 753 flacparse gstflacparse.c:675:gst_flac_parse_frame_is_valid:<flacparse0> possible frame end at offset 10450 baseparse gstbaseparse.c:3160:gst_base_parse_set_min_frame_size:<flacparse0> set frame_min_size: 14 baseparse gstbaseparse.c:2143:gst_base_parse_finish_frame:<flacparse0> finished frame at offset 7474748, flushing size 10450 baseparse gstbaseparse.c:1775:gst_base_parse_handle_buffer:<flacparse0> handle_frame skipped 0, flushed 0 baseparse gstbaseparse.c:614:gst_base_parse_frame_free: freeing frame 0x7f46d84bd1e0 baseparse gstbaseparse.c:2831:gst_base_parse_scan_frame:<flacparse0> getting some more data baseparse gstbaseparse.c:2773:gst_base_parse_scan_frame:<flacparse0> reading buffer size 3276800 baseparse gstbaseparse.c:1757:gst_base_parse_handle_buffer:<flacparse0> handling buffer of size 3276800 with ts 99:99:99.999999999, duration 99:99:99.999999999 baseparse gstbaseparse.c:1710:gst_base_parse_prepare_frame:<flacparse0> preparing frame at offset 7474748 (0x720e3c) of size 3276800 baseparse gstbaseparse.c:674:gst_base_parse_frame_new: created frame 0x7f46d8232680 flacparse gstflacparse.c:800:gst_flac_parse_handle_frame:<flacparse0> Found sync code flacparse gstflacparse.c:616:gst_flac_parse_frame_header_is_valid:<flacparse0> Parsed frame at offset 7474748: Block size: 4096 Sample/Frame number: 753 flacparse gstflacparse.c:675:gst_flac_parse_frame_is_valid:<flacparse0> possible frame end at offset 10450 baseparse gstbaseparse.c:3160:gst_base_parse_set_min_frame_size:<flacparse0> set frame_min_size: 14 baseparse gstbaseparse.c:2143:gst_base_parse_finish_frame:<flacparse0> finished frame at offset 7474748, flushing size 10450 baseparse gstbaseparse.c:1775:gst_base_parse_handle_buffer:<flacparse0> handle_frame skipped 0, flushed 0 baseparse gstbaseparse.c:614:gst_base_parse_frame_free: freeing frame 0x7f46d8232680 baseparse gstbaseparse.c:2831:gst_base_parse_scan_frame:<flacparse0> getting some more data baseparse gstbaseparse.c:2773:gst_base_parse_scan_frame:<flacparse0> reading buffer size 3342336 baseparse gstbaseparse.c:1757:gst_base_parse_handle_buffer:<flacparse0> handling buffer of size 3342336 with ts 99:99:99.999999999, duration 99:99:99.999999999 baseparse gstbaseparse.c:1710:gst_base_parse_prepare_frame:<flacparse0> preparing frame at offset 7474748 (0x720e3c) of size 3342336 baseparse gstbaseparse.c:674:gst_base_parse_frame_new: created frame 0x29f5720 flacparse gstflacparse.c:800:gst_flac_parse_handle_frame:<flacparse0> Found sync code flacparse gstflacparse.c:616:gst_flac_parse_frame_header_is_valid:<flacparse0> Parsed frame at offset 7474748: Block size: 4096 Sample/Frame number: 753 flacparse gstflacparse.c:675:gst_flac_parse_frame_is_valid:<flacparse0> possible frame end at offset 10450 baseparse gstbaseparse.c:3160:gst_base_parse_set_min_frame_size:<flacparse0> set frame_min_size: 14 baseparse gstbaseparse.c:2143:gst_base_parse_finish_frame:<flacparse0> finished frame at offset 7474748, flushing size 10450 baseparse gstbaseparse.c:1775:gst_base_parse_handle_buffer:<flacparse0> handle_frame skipped 0, flushed 0 baseparse gstbaseparse.c:614:gst_base_parse_frame_free: freeing frame 0x29f5720 baseparse gstbaseparse.c:2831:gst_base_parse_scan_frame:<flacparse0> getting some more data baseparse gstbaseparse.c:2773:gst_base_parse_scan_frame:<flacparse0> reading buffer size 3407872 baseparse gstbaseparse.c:1757:gst_base_parse_handle_buffer:<flacparse0> handling buffer of size 3407872 with ts 99:99:99.999999999, duration 99:99:99.999999999 baseparse gstbaseparse.c:1710:gst_base_parse_prepare_frame:<flacparse0> preparing frame at offset 7474748 (0x720e3c) of size 3407872 baseparse gstbaseparse.c:674:gst_base_parse_frame_new: created frame 0x2a46c50 flacparse gstflacparse.c:800:gst_flac_parse_handle_frame:<flacparse0> Found sync code flacparse gstflacparse.c:616:gst_flac_parse_frame_header_is_valid:<flacparse0> Parsed frame at offset 7474748: Block size: 4096 Sample/Frame number: 753
commit 363293731e401fb7a37451048c517de9db0b21ff Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Tue Jul 24 13:49:36 2012 +0200 baseparse: also account for frame size when merely scanning for frame Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680495
Thank you. I verified, with totem, that the issue I had of seeking within flac files is fixed.