Summary: | media-libs/libfpx-1.3.1_p6 : h/page.hxx:511:55: error: exception cleanup for this placement new selects non-placement operator delete [-fpermissive] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Gentoo Graphics Project <graphics+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | b.buschinski, dschridde+gentoobugs, plevine457, zeekec |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 619056 | ||
Bug Blocks: | 582084 | ||
Attachments: |
emerge-history.txt
environment media-libs:libfpx-1.3.1_p6:20160917-113600.log libfpx-1.3.1-c++11-define-placement-delete.patch |
Description
Toralf Förster
2016-09-17 12:26:10 UTC
Created attachment 446162 [details]
emerge-history.txt
Created attachment 446164 [details]
environment
Created attachment 446166 [details]
media-libs:libfpx-1.3.1_p6:20160917-113600.log
Created attachment 446222 [details, diff]
libfpx-1.3.1-c++11-define-placement-delete.patch
I have no experience with placement new and delete so maybe someone can double check my assumptions.
CMSFPage uses a custom placement new operator declared in class scope. This does little else than perform an assert and call malloc. Because placement new was used, as long as an exception is not called in new, delete will not be automatically called. This appears to be the expected behavior as the class maintains a reference count and calls delete on itself when it releases the last reference. This calls the destructor and frees up the memory (probably undefined behavior to use delete to free malloced memory but I'm not the maintainer). Not sure what the pre-c++11 behavior was but if there is an exception thrown during new, there needs to be a delete to call. Marking the placement new operator "noexcept" doesn't seem to suffice. To satisfy this requirement, the patch defines a delete member operator that does nothing but call "free" on its pointer and zero it. AFAIK, it should never have to be called.
Funtoo patches are here: https://github.com/funtoo/funtoo-overlay/tree/master/media-libs/libfpx/files https://github.com/funtoo/funtoo-overlay/blob/master/media-libs/libfpx/files/libfpx-1.2.0.13-gcc6-compat.patch that patch worked for me commit f28a947813dbc0a1fd1a8d4a712d58a64c48ca01 Author: Peter Levine <plevine457@gmail.com> Date: Sat May 13 20:35:39 2017 -0400 media-libs/libfpx: Fix building with GCC-6 Bug: https://bugs.gentoo.org/show_bug.cgi?id=594094 |