Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Convert possible gdbus objects to GAutoPtr<> #4

Closed
wants to merge 11 commits into from

Conversation

DamMicSzm
Copy link
Owner

@DamMicSzm DamMicSzm commented Sep 26, 2023

Problem

Linux still has explicit gdbus memory management. This is follow-up PRs (project-chip#28304) which will replace gdbus explicit memory management with GAutoPtr<>.

Changes

  • Changed explicit memory management of bluez objects to GAutoPtr<> were possible for the Linux platform.

Testing

CI will test for potential build breaks.

Valgrind test result for linux-x64-light target:

==561870==    definitely lost: 0 bytes in 0 blocks
==561870==    indirectly lost: 0 bytes in 0 blocks
==561870==      possibly lost: 640 bytes in 2 blocks
==561870==    still reachable: 202,743 bytes in 2,898 blocks
==561870==         suppressed: 0 bytes in 0 blocks```

@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from d66f9f1 to 1c48303 Compare September 26, 2023 08:42
@DamMicSzm DamMicSzm changed the base branch from master to linux-gautoptr-conv September 26, 2023 08:44
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from 1c48303 to 95e7458 Compare September 26, 2023 08:46
@DamMicSzm DamMicSzm changed the title [Linux] Generate gdbus autcleanup and conv gdbus objects to GAutoPtr<> [Linux] Convert possible gdbus objects to GAutoPtr<> Sep 26, 2023
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch 3 times, most recently from 2222f0b to 193d20b Compare September 26, 2023 11:19
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-conv branch 4 times, most recently from ad0eee9 to 5e0fcb8 Compare October 4, 2023 09:10
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-conv branch 2 times, most recently from 2769a98 to a276d23 Compare October 10, 2023 09:13
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from 193d20b to c948bf4 Compare October 10, 2023 09:30
DamMicSzm pushed a commit that referenced this pull request Oct 20, 2023
…ist". (project-chip#29666)

The typical failure there looks like this:

==29620==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x106396e12 in calloc+0xa2 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x51e12)
    #1 0x7ff800dc9789 in map_images_nolock+0x24b (libobjc.A.dylib:x86_64h+0x1789)
    #2 0x7ff800dc94db in map_images+0x42 (libobjc.A.dylib:x86_64h+0x14db)
    #3 0x113d721fa in invocation function for block in dyld4::RuntimeState::setObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*))+0x112 (dyld:x86_64+0xf1fa)
    #4 0x113d6d6c8 in dyld4::RuntimeState::withLoadersReadLock(void () block_pointer)+0x28 (dyld:x86_64+0xa6c8)
    #5 0x113d720e1 in dyld4::RuntimeState::setObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*))+0x51 (dyld:x86_64+0xf0e1)
    #6 0x113d85d44 in dyld4::APIs::_dyld_objc_notify_register(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*))+0x4e (dyld:x86_64+0x22d44)
    #7 0x7ff800dc9343 in _objc_init+0x4fe (libobjc.A.dylib:x86_64h+0x1343)
    #8 0x7ff800d83992 in _os_object_init+0xc (libdispatch.dylib:x86_64+0x2992)
    project-chip#9 0x7ff800d911b7 in libdispatch_init+0x136 (libdispatch.dylib:x86_64+0x101b7)
    project-chip#10 0x7ff80bd34894 in libSystem_initializer+0xed (libSystem.B.dylib:x86_64+0x1894)
    project-chip#11 0x113d77e4e in invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const+0xb5 (dyld:x86_64+0x14e4e)
    project-chip#12 0x113d9eaac in invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const+0xf1 (dyld:x86_64+0x3baac)
    project-chip#13 0x113d95e25 in invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const+0x22c (dyld:x86_64+0x32e25)
    project-chip#14 0x113d64db2 in dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const+0x80 (dyld:x86_64+0x1db2)
    project-chip#15 0x113d95bb6 in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const+0xb2 (dyld:x86_64+0x32bb6)
    project-chip#16 0x113d9e603 in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const+0x1d1 (dyld:x86_64+0x3b603)
    project-chip#17 0x113d77d81 in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const+0x8f (dyld:x86_64+0x14d81)
    project-chip#18 0x113d7e659 in dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const+0x1d (dyld:x86_64+0x1b659)
    project-chip#19 0x113d8b76d in dyld4::APIs::runAllInitializersForMain()+0x25 (dyld:x86_64+0x2876d)
    project-chip#20 0x113d6938c in dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)+0xd72 (dyld:x86_64+0x638c)
    project-chip#21 0x113d684e3 in start+0x183 (dyld:x86_64+0x54e3)
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from 07b5492 to 13c2e57 Compare October 20, 2023 12:41
@DamMicSzm DamMicSzm changed the base branch from linux-gautoptr-conv to master October 20, 2023 12:43
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch 2 times, most recently from 6c47d2d to c355e3a Compare October 24, 2023 12:29
mhazley and others added 4 commits October 24, 2023 13:31
…-chip#29942)

* Adding air purifier example to buiuld scripts for cc32xx and also to cc32xx CI action

* Added additional cc32xx example to test data all targets file
…ct-chip#29933)

This will set things up right if the commissionee implements the Time
Synchronization cluster.

Fixes project-chip#29768
* Remove door lock cluster from all-clusters-app

Both QA and the CI are using the door-lock app for all testing of
the door lock cluster. The all-clusters version is not well tested,
and is missing some command handlers.
Removing this in all-clusters in favour of the door lock app so we
don't have to maintain it in two places and to save some space.

* Fix esp32 build file

* Remove door lock support for esp32

* Remove door lock support from telink

* Remove door lock support for nrfconnect

* Fix esp32 compilation

* Restyle

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
* Add parse support for list types in data model xml

* Restyle

* Fix unused type

* Fix a typo in data types ... may as well fix here since python change

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from 4836f57 to f082580 Compare October 24, 2023 16:45
tcarmelveilleux and others added 6 commits October 24, 2023 17:39
…p#29945)

* Regenerated

* XML updates for Network commissioning cluster TCR

* Fix zap regen

---------

Co-authored-by: tennessee.carmelveilleux@gmail.com <tennessee@google.com>
* Audio output to spec

* zap regen

* Minor change to re-kick CI

* Enalbe AudioOutput::CurrentOutput as a required attribute in the chef basicvideoplayer example

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
* Make binding attribute for binding manager to be writable by manager

* Zap regen

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
* Adding manage access for write for several attributes

* More access controls

* Zap regen

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from 2f05d9e to 4ddb9cd Compare October 25, 2023 08:34
@DamMicSzm DamMicSzm force-pushed the linux-gautoptr-gdbus-codegen branch from 4ddb9cd to 324964e Compare October 25, 2023 09:06
@DamMicSzm DamMicSzm closed this Oct 25, 2023
@arkq arkq deleted the linux-gautoptr-gdbus-codegen branch October 25, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants