Bug 25503

Summary: valgrind reports invalid writes in dmocka at the entrance of functions (line with the {) on armv7hl
Product: Mageia Reporter: Pascal Terjan <pterjan>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Normal    
Version: Cauldron   
Target Milestone: ---   
Hardware: armv7hl   
OS: Linux   
Whiteboard:
Source RPM: gcc-9.2.1-0.20190928.1.mga8.src.rpm CVE:
Status comment:

Description Pascal Terjan 2019-09-30 10:35:23 CEST
Small extract:

3: ==27584== Invalid write of size 4
3: ==27584==    at 0x4BAB350: _assert_int_equal (cmocka.c:1798)
3: ==27584==    by 0x14E77: read_rpmonly (drpm_api_tests.c:455)
3: ==27584==    by 0x4BABD03: cmocka_run_one_test_or_fixture (cmocka.c:2801)
3: ==27584==    by 0x4BAC6EF: cmocka_run_one_tests (cmocka.c:2909)
3: ==27584==    by 0x4BAC6EF: _cmocka_run_group_tests (cmocka.c:3040)
3: ==27584==    by 0x13767: main (drpm_api_tests.c:901)
3: ==27584==  Address 0xbda03344 is on thread 1's stack
3: ==27584==  32 bytes below stack pointer
3: ==27584==
3: ==27584== Invalid write of size 4
3: ==27584==    at 0x4BA9098: _assert_true (cmocka.c:1727)
3: ==27584==    by 0x14EBF: read_rpmonly (drpm_api_tests.c:465)
3: ==27584==    by 0x4BABD03: cmocka_run_one_test_or_fixture (cmocka.c:2801)
3: ==27584==    by 0x4BAC6EF: cmocka_run_one_tests (cmocka.c:2909)
3: ==27584==    by 0x4BAC6EF: _cmocka_run_group_tests (cmocka.c:3040)
3: ==27584==    by 0x13767: main (drpm_api_tests.c:901)
3: ==27584==  Address 0xbda03358 is on thread 1's stack
3: ==27584==  16 bytes below stack pointer

_assert_int_equal (cmocka.c:1798):

1796: void _assert_int_equal(
1797:         const LargestIntegralType a, const LargestIntegralType b,
1798:         const char * const file, const int line) {
1799:     if (!values_equal_display_error(a, b)) {
1800:         _fail(file, line);
1801:     }
1802: }

I am guessing those writes are added by something so assigning to gcc for now
Pascal Terjan 2019-09-30 10:36:55 CEST

Hardware: All => armv7hl

Comment 1 Pascal Terjan 2019-09-30 10:38:00 CEST
Found a RH bug https://bugzilla.redhat.com/show_bug.cgi?id=1699304
Comment 2 Pascal Terjan 2019-09-30 11:04:30 CEST
I found the problem: -fstack-clash-protection (and https://bugzilla.redhat.com/show_bug.cgi?id=1522678)

I'll patch the cmocka package to not use it on armv7hl and close this gcc bug as there is not much we can do.
Comment 3 Pascal Terjan 2019-09-30 11:04:57 CEST
Closing.

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX