Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649858 - app-accessibility/epos-2.5.37-r2: null pointer dereference with -O2 optimization
Summary: app-accessibility/epos-2.5.37-r2: null pointer dereference with -O2 optimization
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Accessibility Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-07 17:24 UTC by Jan Breuer
Modified: 2018-05-24 23:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Breuer 2018-03-07 17:24:40 UTC
eposd failed to work because newer GCC optimize better null pointer checks on "this"

void clazz::method() {
   if(!this) {
       do_something();
   }
}

This bad technique is used in epos.


After compilation of package with -fno-delete-null-pointer-checks, everything works again.

Affected compiler is at least gcc-6.4.0-r1
It worked with gcc-4.9 and it probably worked with gcc-5.4. clang-5.0.1 is also not affected and does not remove this condition.
Comment 1 Jan Breuer 2018-03-08 14:07:59 UTC
It is GCC 6 feature

"Value range propagation now assumes that the this pointer in C++ member functions is non-null. This eliminates common null pointer checks but also breaks some non-conforming code-bases (such as Qt-5, Chromium, KDevelop). As a temporary work-around -fno-delete-null-pointer-checks can be used. Wrong code can be identified by using -fsanitize=undefined."[1]



[1] https://gcc.gnu.org/gcc-6/changes.html
Comment 2 Larry the Git Cow gentoo-dev 2018-05-24 21:58:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6f97f0a34f9cce8727ec01375dede2840676544

commit e6f97f0a34f9cce8727ec01375dede2840676544
Author:     Jan Breuer <jan.breuer@mobatime.cz>
AuthorDate: 2018-04-09 09:48:40 +0000
Commit:     Aaron Bauman <bman@gentoo.org>
CommitDate: 2018-05-24 21:57:46 +0000

    app-accessibility/epos: fix running on GCC-6
    
    Bug: https://bugs.gentoo.org/649858
    Closes: https://bugs.gentoo.org/649858
    Package-Manager: Portage-2.3.24, Repoman-2.3.6
    Closes: https://github.com/gentoo/gentoo/pull/7909

 app-accessibility/epos/epos-2.5.37-r2.ebuild | 1 +
 1 file changed, 1 insertion(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6f97f0a34f9cce8727ec01375dede2840676544

commit e6f97f0a34f9cce8727ec01375dede2840676544
Author:     Jan Breuer <jan.breuer@mobatime.cz>
AuthorDate: 2018-04-09 09:48:40 +0000
Commit:     Aaron Bauman <bman@gentoo.org>
CommitDate: 2018-05-24 21:57:46 +0000

    app-accessibility/epos: fix running on GCC-6
    
    Bug: https://bugs.gentoo.org/649858
    Closes: https://bugs.gentoo.org/649858
    Package-Manager: Portage-2.3.24, Repoman-2.3.6
    Closes: https://github.com/gentoo/gentoo/pull/7909

 app-accessibility/epos/epos-2.5.37-r2.ebuild | 1 +
 1 file changed, 1 insertion(+)
Comment 3 Aaron Bauman (RETIRED) gentoo-dev 2018-05-24 23:33:00 UTC
The CXXFLAGS should be appended vice overriding all of them.