Review Request 120433: Fix alloc-dealloc-mismatchin StreamReader

Uwe L. Korn uwelk at xhochy.com
Tue Sep 30 11:21:18 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120433/
-----------------------------------------------------------

Review request for Phonon and Harald Sitter.


Repository: phonon-vlc


Description
-------

StreamReader::readCallback always allocates buffer using new[] but the
deletion was done in StreamReader::readDoneCallback with a mismatching
delete.

related AddressSanitizer output:

```
=================================================================
==28275==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x62d001450400
    #0 0x46310b in operator delete(void*) (/home/xhochy/Development/tomahawk-player/build/tomahawk-asan-qt5/tomahawk+0x46310b)
    #1 0x7f3a925dd56b in Phonon::VLC::StreamReader::readDoneCallback(void*, char const*, unsigned long, void*) /var/tmp/notmpfs/portage/media-libs/phonon-vlc-9999/work/phonon-vlc-9999/src/streamreader.cpp:112
    #2 0x7f3a84e5d06f in Block /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/modules/access/imem.c:389
    #3 0x7f3a924f4210 in AReadBlock /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/input/stream.c:1749
    #4 0x7f3a924f45d3 in AStreamPrebufferBlock /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/input/stream.c:706
    #5 0x7f3a924f5edf in stream_AccessNew /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/input/stream.c:389
    #6 0x7f3a924ed189 in InputSourceInit /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/input/input.c:2347
    #7 0x7f3a924ee0d3 in Init /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/input/input.c:1204
    #8 0x7f3a924f1055 in Run /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/input/input.c:518
    #9 0x7f3aa6e07202 in start_thread /var/tmp/portage/sys-libs/glibc-2.19-r1/work/glibc-2.19/nptl/pthread_create.c:309
    #10 0x7f3aa5a319ac in clone /var/tmp/portage/sys-libs/glibc-2.19-r1/work/glibc-2.19/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:111

0x62d001450400 is located 0 bytes inside of 32768-byte region [0x62d001450400,0x62d001458400)
allocated by thread T42 here:
    #0 0x462d1b in operator new[](unsigned long) (/home/xhochy/Development/tomahawk-player/build/tomahawk-asan-qt5/tomahawk+0x462d1b)
    #1 0x7f3a925dd893 in Phonon::VLC::StreamReader::readCallback(void*, char const*, long*, long*, unsigned int*, unsigned long*, void**) /var/tmp/notmpfs/portage/media-libs/phonon-vlc-9999/work/phonon-vlc-9999/src/streamreader.cpp:96

Thread T42 created by T0 here:
    #0 0x4b209f in __interceptor_pthread_create (/home/xhochy/Development/tomahawk-player/build/tomahawk-asan-qt5/tomahawk+0x4b209f)
    #1 0x7f3a9252ecf0 in vlc_clone_attr /var/tmp/portage/media-video/vlc-9999/work/vlc-9999/src/posix/thread.c:653

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch ??:0 operator delete(void*)
==28275==HINT: if you don't care about these warnings you may set ASAN_OPTIONS=alloc_dealloc_mismat
```


Diffs
-----

  src/streamreader.cpp dac45456ee0228267aec3732cf617def0ef9db3d 

Diff: https://git.reviewboard.kde.org/r/120433/diff/


Testing
-------

Plays successfully in Tomahawk-git.


Thanks,

Uwe L. Korn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20140930/8617d33c/attachment.htm>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list