Skip to content

Conversation

@sj-i
Copy link
Member

@sj-i sj-i commented Feb 13, 2024

This resolves #402

For example, we can now analyze threads from debug builds of frankenphp with commands like this.

sudo ./reli i:tr --libpthread=libc.so --php-regex=libphp.so --zts-globals-regex=/frankenphp -p <pid_of_target_frankenphp_thread>

Note: The current support is limited to unstripped ZTS binaries only. During this work, I also got an idea to support analyzing stripped ZTS binaries. See #450 and #451.

@sj-i sj-i added the enhancement New feature or request label Feb 13, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7893962469

Details

  • -36 of 234 (84.62%) changed or added relevant lines in 21 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.2%) to 86.439%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Lib/Elf/Process/Elf64LazyParseSymbolResolver.php 5 6 83.33%
src/Lib/Elf/Process/LinkMapLoader.php 37 38 97.37%
src/Lib/Elf/Structure/Elf64/Elf64DynamicStructure.php 0 1 0.0%
src/Lib/Elf/Structure/Elf64/Elf64ProgramHeaderTable.php 2 3 66.67%
src/Lib/Elf/Structure/Elf64/Elf64SectionHeaderTable.php 3 4 75.0%
src/Lib/Elf/SymbolResolver/Elf64LinearScanSymbolResolver.php 1 2 50.0%
src/Lib/PhpProcessReader/PhpMemoryReader/MemoryLocationsCollector.php 3 4 75.0%
src/Lib/PhpProcessReader/PhpSymbolReaderCreator.php 14 15 93.33%
src/Lib/PhpProcessReader/PhpVersionDetector.php 0 1 0.0%
src/Lib/Elf/Process/ProcessModuleSymbolReader.php 27 29 93.1%
Files with Coverage Reduction New Missed Lines %
src/Lib/Elf/Process/Elf64LazyParseSymbolResolver.php 1 89.47%
src/Lib/PhpInternals/Types/Zend/ZendMmHeap.php 1 82.61%
src/Lib/Elf/SymbolResolver/Elf64SymbolResolverCreator.php 2 53.25%
Totals Coverage Status
Change from base Build 7815704404: 0.2%
Covered Lines: 5539
Relevant Lines: 6408

💛 - Coveralls

@sj-i sj-i added this to the 0.12.0 milestone Feb 14, 2024
@sj-i sj-i merged commit f982f1a into 0.12.x Feb 14, 2024
@sj-i sj-i deleted the support-franken branch February 14, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ZTS binary in a shared object like mod_php or libphp.so

3 participants