iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

memleak:support third party alloctions by definitive symbols prefix #4812

Closed judeng closed 10 months ago

judeng commented 10 months ago

The third-party allocations, such as jellmalloc that is usually statically linked into redis using the "je_" prefix, so we can specify the prefix string of these symbols to detect memory leaks in softwares using third-party allocs.

yonghong-song commented 10 months ago

There is a merge conflict. Could you rebase and resubmit?

judeng commented 10 months ago

@yonghong-song thanks, last week I dealt with the conflict by manually merging the master branch, now I do not see any conflict, do I need to rebase? And the CI have been stocking a long time, what should I do?https://github.com/iovisor/bcc/actions/runs/7001293144/job/19269436679?pr=4812

judeng commented 10 months ago

I rebase and force push this branch, not sure if this behavior is appropriate @yonghong-song

judeng commented 10 months ago

CI still failed, but the error looks like irrelative with this pr:

29/41 Test #29: py_test_tools_smoke ..............***Failed  294.37 sec
Traceback (most recent call last):
  File "/bcc/tools/argdist.py", line 757, in run
    self._main_loop()
  File "/bcc/tools/argdist.py", line 747, in _main_loop
    exit()
  File "/usr/lib/python3.8/_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: None
..........................cannot attach kprobe, probe entry may not exist
cannot attach kprobe, probe entry may not exist
.......Killed
.WARNING: 2 stack traces lost and could not be displayed.
.........Traceback (most recent call last):
  File "/bcc/tools/offwaketime.py", line 400, in <module>
    print("    %s" % b.ksym(addr).decode('utf-8', 'replace'))
OSError: [Errno 9] Bad file descriptor
F...........Traceback (most recent call last):
  File "/bcc/tools/sslsniff.py", line 336, in <module>
    attach_nss("nspr4")
  File "/bcc/tools/sslsniff.py", line 306, in attach_nss
    b.attach_uprobe(name=lib, sym="PR_Write",
  File "/bcc/build/src/python/bcc-python3/bcc/__init__.py", line 1380, in attach_uprobe
    (path, addr) = BPF._check_path_symbol(name, sym, addr, pid, sym_off)
  File "/bcc/build/src/python/bcc-python3/bcc/__init__.py", line 978, in _check_path_symbol
    raise Exception("could not determine address of symbol %s in %s"
Exception: could not determine address of symbol PR_Write in nspr4
.............................
======================================================================
FAIL: test_offwaketime (__main__.SmokeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/bcc/tests/python/test_tools_smoke.py", line 271, in test_offwaketime
    self.run_with_duration("offwaketime.py 1")
  File "/bcc/tests/python/test_tools_smoke.py", line 40, in run_with_duration
    self.assertEqual(0,     # clean exit
AssertionError: 0 != 1
yonghong-song commented 10 months ago

Right, CI failure is not related to your patch.