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

freeBSD 12.2-RELEASE not working #431

Closed
yocalebo opened this issue Aug 3, 2021 · 11 comments
Closed

freeBSD 12.2-RELEASE not working #431

yocalebo opened this issue Aug 3, 2021 · 11 comments

Comments

@yocalebo
Copy link

yocalebo commented Aug 3, 2021

Even though it seems there is logic to push a freeBSD binary to the releases page, there doesn't seem to be one there. (Unless I'm just missing it).

However, running a stock 12.2 release system FreeBSD fbsd12.2-build 12.2-RELEASE FreeBSD 12.2-RELEASE r366954 GENERIC amd64, I downloaded the latest py-spy source (3.8 at time of writing) and compiled without any problems. However, if I run the program I get this:

[2021-08-04T01:36:52.756370714Z INFO  py_spy::python_spy] Got virtual memory maps from pid 12904:
[2021-08-04T01:36:52.756381030Z WARN  py_spy::python_spy] Failed to find '/usr/local/bin/python3.7m' in virtual memory maps, falling back to first map region
[2021-08-04T01:36:52.756432265Z INFO  py_spy::python_spy] Getting version from python binary BSS
[2021-08-04T01:36:52.756443081Z INFO  py_spy::python_spy] Failed to get version from BSS section: failed to find version string
[2021-08-04T01:36:52.756446871Z INFO  py_spy::python_spy] Trying to get version from path: /usr/local/bin/python3.7m

I'm just starting a standard interpreter session, nothing fancy.

root@fbsd12:~/build # python3
Python 3.7.9 (default, Feb  4 2021, 01:17:36)
[Clang 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611a on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>>

I also tried on another freebsd machine 12.2-RELEASE-p6 trying to profile a complex long-running python program (version python 3.9.5) and get this instead

[2021-08-03T23:14:33.055404370Z INFO  py_spy::python_spy] Got virtual memory maps from pid 4397:
[2021-08-03T23:14:33.055424910Z WARN  py_spy::python_spy] Failed to find '/usr/local/bin/python3.9' in virtual memory maps, falling back to first map region
[2021-08-03T23:14:33.055651030Z INFO  py_spy::python_spy] Getting version from python binary BSS
[2021-08-03T23:14:33.055681460Z INFO  py_spy::python_spy] Failed to get version from BSS section: failed to find version string
[2021-08-03T23:14:33.055690820Z INFO  py_spy::python_spy] Trying to get version from path: /usr/local/bin/python3.9
[2021-08-03T23:14:33.055714970Z INFO  py_spy::python_spy] python version 3.9.0 detected
[2021-08-03T23:14:33.055739050Z INFO  py_spy::python_spy] Failed to get interp_head from symbols, scanning BSS section from main binary
Error: Failed to find a python interpreter in the .data section

Not sure if I'm doing something wrong, but seems like all documentation points to freeBSD being supported so I'm assuming the issue is me 😄

@benfred
Copy link
Owner

benfred commented Aug 5, 2021

We do test every commit with freebsd using cirrusci - including the rust integration tests which test py-spy profiling the system python. https://cirrus-ci.com/task/5989956297424896 .

@akhramov do you have any ideas here?

@akhramov
Copy link
Contributor

akhramov commented Aug 8, 2021

Judging by the log output, there might be something off with virtual maps routines.

I don't have 12.2 at hand (using 13.0 here), will install it a little bit later.

@yocalebo can you share the output of following (3928 is the id of the interpreter)?

procstat vm 3928

@yocalebo
Copy link
Author

yocalebo commented Aug 8, 2021

@akhramov This is from a stock 12.2 release system.

  PID              START                END PRT  RES PRES REF SHD FLAG  TP PATH
22674           0x200000           0x201000 r--    1    2   3   1 CN--- vn /usr/local/bin/python3.7m
22674           0x201000           0x202000 r-x    1    2   3   1 CN--- vn /usr/local/bin/python3.7m
22674           0x202000           0x203000 r--    1    0   1   0 C---- vn /usr/local/bin/python3.7m
22674           0x203000           0x204000 rw-    1    1   1   0 ----- df
22674        0x800203000        0x80020c000 r--    9   38  92  46 CN--- vn /libexec/ld-elf.so.1
22674        0x80020c000        0x800227000 r-x   27   38  92  46 CN--- vn /libexec/ld-elf.so.1
22674        0x800227000        0x800228000 r--    1    0   1   0 C---- vn /libexec/ld-elf.so.1
22674        0x800228000        0x800229000 rw-    1    0   1   0 C---- vn /libexec/ld-elf.so.1
22674        0x800229000        0x80024c000 rw-   34   34   1   0 ----- df
22674        0x80024c000        0x80034a000 r--  254  768   4   2 CN--- vn /usr/local/lib/libpython3.7m.so.1.0
22674        0x80034a000        0x8004d5000 r-x  395  768   4   2 CN--- vn /usr/local/lib/libpython3.7m.so.1.0
22674        0x8004d5000        0x8004d8000 r--    3    0   2   0 C---- vn /usr/local/lib/libpython3.7m.so.1.0
22674        0x8004d8000        0x8004d9000 rw-    1    0   2   0 C---- vn /usr/local/lib/libpython3.7m.so.1.0
22674        0x8004d9000        0x800540000 rw-  103    0   1   0 C---- vn /usr/local/lib/libpython3.7m.so.1.0
22674        0x800540000        0x800560000 rw-   32   32   1   0 ----- df
22674        0x800560000        0x800564000 r--    4   14  29  17 CN--- vn /lib/libcrypt.so.5
22674        0x800564000        0x80056d000 r-x    9   14  29  17 CN--- vn /lib/libcrypt.so.5
22674        0x80056d000        0x80056e000 r--    1    0   2   0 C---- vn /lib/libcrypt.so.5
22674        0x80056e000        0x80056f000 rw-    1    0   2   0 C---- vn /lib/libcrypt.so.5
22674        0x80056f000        0x800570000 rw-    1    0   1   0 C---- vn /lib/libcrypt.so.5
22674        0x800570000        0x800581000 rw-    0    0   0   0 ----- --
22674        0x800581000        0x800585000 r--    4   14   4   2 CN--- vn /usr/local/lib/libintl.so.8.2.0
22674        0x800585000        0x80058c000 r-x    7   14   4   2 CN--- vn /usr/local/lib/libintl.so.8.2.0
22674        0x80058c000        0x80058d000 r--    1    0   1   0 C---- vn /usr/local/lib/libintl.so.8.2.0
22674        0x80058d000        0x80058e000 rw-    1    0   1   0 C---- vn /usr/local/lib/libintl.so.8.2.0
22674        0x80058e000        0x800590000 rw-    0    0   0   0 ----- --
22674        0x800590000        0x800591000 r--    1    2   4   2 CN--- vn /usr/lib/libdl.so.1
22674        0x800591000        0x800592000 r-x    1    2   4   2 CN--- vn /usr/lib/libdl.so.1
22674        0x800592000        0x800593000 r--    1    0   1   0 C---- vn /usr/lib/libdl.so.1
22674        0x800593000        0x800594000 rw-    1    0   1   0 C---- vn /usr/lib/libdl.so.1
22674        0x800594000        0x80059c000 r--    8   20  79  43 CN--- vn /lib/libutil.so.9
22674        0x80059c000        0x8005a7000 r-x   11   20  79  43 CN--- vn /lib/libutil.so.9
22674        0x8005a7000        0x8005a8000 r--    1    0   2   0 C---- vn /lib/libutil.so.9
22674        0x8005a8000        0x8005a9000 rw-    1    0   2   0 C---- vn /lib/libutil.so.9
22674        0x8005a9000        0x8005aa000 rw-    1    0   1   0 C---- vn /lib/libutil.so.9
22674        0x8005aa000        0x8005ac000 rw-    0    0   0   0 ----- --
22674        0x8005ac000        0x8005bd000 r--   17   52  12   6 CN--- vn /lib/libm.so.5
22674        0x8005bd000        0x8005dc000 r-x   31   52  12   6 CN--- vn /lib/libm.so.5
22674        0x8005dc000        0x8005dd000 r--    1    0   1   0 C---- vn /lib/libm.so.5
22674        0x8005dd000        0x8005de000 rw-    1    0   1   0 C---- vn /lib/libm.so.5
22674        0x8005de000        0x8005eb000 r--   13   32  20  10 CN--- vn /lib/libthr.so.3
22674        0x8005eb000        0x8005fd000 r-x   18   32  20  10 CN--- vn /lib/libthr.so.3
22674        0x8005fd000        0x8005fe000 r--    1    0   1   0 C---- vn /lib/libthr.so.3
22674        0x8005fe000        0x800600000 rw-    2    0   1   0 C---- vn /lib/libthr.so.3
22674        0x800600000        0x80060b000 rw-   11   11   1   0 ----- df
22674        0x80060b000        0x80068a000 r--  127  488 104  58 CN--- vn /lib/libc.so.7
22674        0x80068a000        0x8007ca000 r-x  320  488 104  58 CN--- vn /lib/libc.so.7
22674        0x8007ca000        0x8007d3000 r--    9    0   2   0 C---- vn /lib/libc.so.7
22674        0x8007d3000        0x8007d4000 rw-    1    0   2   0 C---- vn /lib/libc.so.7
22674        0x8007d4000        0x8007db000 rw-    7    0   1   0 C---- vn /lib/libc.so.7
22674        0x8007db000        0x800a68000 rw-   68  350   2   0 ----- df
22674        0x800a68000        0x800c00000 rw-  343  343   1   0 ----- df
22674        0x800c00000        0x801391000 rw-  282  350   2   0 ----- df
22674        0x801391000        0x801395000 r--    4    8   4   2 CN--- vn /usr/local/lib/python3.7/lib-dynload/readline.so
22674        0x801395000        0x801398000 r-x    3    8   4   2 CN--- vn /usr/local/lib/python3.7/lib-dynload/readline.so
22674        0x801398000        0x801399000 r--    1    0   1   0 C---- vn /usr/local/lib/python3.7/lib-dynload/readline.so
22674        0x801399000        0x80139b000 rw-    2    0   1   0 C---- vn /usr/local/lib/python3.7/lib-dynload/readline.so
22674        0x80139b000        0x8013bb000 r--   32   84   4   2 CN--- vn /usr/local/lib/libreadline.so.8.0
22674        0x8013bb000        0x8013e8000 r-x   45   84   4   2 CN--- vn /usr/local/lib/libreadline.so.8.0
22674        0x8013e8000        0x8013ea000 r--    2    0   2   0 C---- vn /usr/local/lib/libreadline.so.8.0
22674        0x8013ea000        0x8013eb000 rw-    1    0   2   0 C---- vn /usr/local/lib/libreadline.so.8.0
22674        0x8013eb000        0x8013f2000 rw-    7    0   1   0 C---- vn /usr/local/lib/libreadline.so.8.0
22674        0x8013f2000        0x8013f3000 rw-    1    1   1   0 ----- df
22674        0x8013f3000        0x80141c000 r--   41   95  20  10 CN--- vn /lib/libncursesw.so.8
22674        0x80141c000        0x80144e000 r-x   50   95  20  10 CN--- vn /lib/libncursesw.so.8
22674        0x80144e000        0x801452000 r--    4    0   1   0 C---- vn /lib/libncursesw.so.8
22674        0x801452000        0x801454000 rw-    2    0   1   0 C---- vn /lib/libncursesw.so.8
22674        0x801454000        0x80149a000 rw-   39   39   1   0 ----- df
22674     0x7fffdfffe000     0x7fffdffff000 ---    0    0   0   0 ----- --
22674     0x7fffdffff000     0x7ffffffdf000 ---    0    0   0   0 ----- --
22674     0x7ffffffdf000     0x7ffffffff000 rw-    6    6   1   0 ---D- df
22674     0x7ffffffff000     0x800000000000 r-x    1    1  26   0 ----- ph

@akhramov
Copy link
Contributor

akhramov commented Aug 8, 2021

@yocalebo thanks, much appreciated.

I got a fresh vanilla 12.2-RELEASE box, but I don't observe the same error. In fact, it fails much earlier.

thread '<unnamed>' panicked at 'attempt to subtract with overflow', src/binary_parser.rs:104:26

@benfred do you know why exactly should we do this subtraction? If I set offset to 0 instead, everything seems to work fine. Can't get my head around this :(

let offset = offset - program_header.p_vaddr;

upd
Same applies to 13.0-RELEASE, checking 11.2...

upd
12.2 Failed CI run
https://github.com/benfred/py-spy/pull/433/checks?check_run_id=3274632099

akhramov added a commit to akhramov/py-spy that referenced this issue Aug 8, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.

- removes cirrus config and sets up a FreeBSD GH action job.
@akhramov
Copy link
Contributor

akhramov commented Aug 8, 2021

Well, nvm. It seems like there are two distinct problems. #433 addresses one of them.

Regarding this particular issue, it seems like py-spy fails to fetch proc-maps properly. I'd wait for rbspy/proc-maps#11 and then ask @yocalebo to run the example.

@yocalebo
Copy link
Author

yocalebo commented Aug 9, 2021

@akhramov I saw your example and tried it out on a python interpreter session. The proc_maps library is panic'ing with a weird error message.

thread 'main' panicked at 'index out of bounds: the len is 31 but the index is 31', library/core/src/unicode/unicode_data.rs:75:40
stack backtrace:
   0:          0x103e48d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h99eb2bb559f5c20a
   1:          0x1067dce - core::fmt::write::h36115269f54ab895
   2:          0x1039c13 - std::io::Write::write_fmt::hbeab1bdf1fff82a1
   3:          0x1053143 - std::panicking::default_hook::{{closure}}::hf4f52418174fc705
   4:          0x1052cbf - std::panicking::default_hook::h6ae7b7383363fd20
   5:          0x10537dd - std::panicking::rust_panic_with_hook::h464a89e144497d4f
   6:          0x103e89b - std::panicking::begin_panic_handler::{{closure}}::hbd60ef88fa4db63c
   7:          0x103e5c0 - std::sys_common::backtrace::__rust_end_short_backtrace::hc76c2013cc85f77f
   8:          0x1053385 - rust_begin_unwind
   9:          0x1065090 - core::panicking::panic_fmt::he877c08fee645e1d
  10:          0x1065057 - core::panicking::panic_bounds_check::h8606291b60a7a9a8
  11:          0x106723c - core::unicode::unicode_data::grapheme_extend::lookup::h141e9ef94f608504
  12:          0x1068d73 - <str as core::fmt::Debug>::fmt::h3063b36fe50989f7
  13:          0x1069fd3 - core::fmt::builders::DebugTuple::field::h3e2ea226384f8e09
  14:          0x1036ce5 - <&T as core::fmt::Debug>::fmt::ha52cc8ac42b729a0
  15:          0x1067dce - core::fmt::write::h36115269f54ab895
  16:          0x10556dd - <&std::io::stdio::Stdout as std::io::Write>::write_fmt::hc6bb1a1e1a300883
  17:          0x1055a20 - std::io::stdio::_print::h93054d29daba2775
  18:          0x10365eb - print_maps::main::h7837408d915454de
  19:          0x1036e6a - std::sys_common::backtrace::__rust_begin_short_backtrace::haab2568a928e10a3
  20:          0x1036e0c - std::rt::lang_start::{{closure}}::h494d16e183cb3cd3
  21:          0x1054f15 - std::rt::lang_start_internal::h382cbf53dddb8a63
  22:          0x10367ea - main
  23:          0x1035df2 - _start
                               at /usr/src/lib/csu/amd64/crt1.c:76:7

@yocalebo
Copy link
Author

yocalebo commented Aug 9, 2021

@akhramov I also went ahead and applied your patch here. It seems to have gotten a little further than last time, but ultimately still fails. Attaching rust log debug output.

[2021-08-09T05:46:21.537932172Z INFO  py_spy::python_spy] Got virtual memory maps from pid 24159:
[2021-08-09T05:46:21.537944455Z DEBUG py_spy::python_spy] map: 0000000000200000-0000000000200fff r-- m
[2021-08-09T05:46:21.537952696Z DEBUG py_spy::python_spy] map: 0000000000201000-0000000000201fff r-x m
[2021-08-09T05:46:21.537957882Z DEBUG py_spy::python_spy] map: 0000000000202000-0000000000202fff r-- m
[2021-08-09T05:46:21.537962883Z DEBUG py_spy::python_spy] map: 0000000000203000-0000000000203fff rw-
[2021-08-09T05:46:21.537966579Z DEBUG py_spy::python_spy] map: 0000000800203000-000000080020bfff r--
[2021-08-09T05:46:21.537970287Z DEBUG py_spy::python_spy] map: 000000080020c000-0000000800226fff r-x
[2021-08-09T05:46:21.537974215Z DEBUG py_spy::python_spy] map: 0000000800227000-0000000800227fff r--
[2021-08-09T05:46:21.537984231Z DEBUG py_spy::python_spy] map: 0000000800228000-0000000800228fff rw-
[2021-08-09T05:46:21.537987870Z DEBUG py_spy::python_spy] map: 0000000800229000-000000080024bfff rw-
[2021-08-09T05:46:21.537991020Z DEBUG py_spy::python_spy] map: 000000080024c000-0000000800349fff r-- #3.7m.so.1.0
[2021-08-09T05:46:21.537994808Z DEBUG py_spy::python_spy] map: 000000080034a000-00000008004d4fff r-x #3.7m.so.1.0
[2021-08-09T05:46:21.537998500Z DEBUG py_spy::python_spy] map: 00000008004d5000-00000008004d7fff r-- #3.7m.so.1.0
[2021-08-09T05:46:21.538002292Z DEBUG py_spy::python_spy] map: 00000008004d8000-00000008004d8fff rw- #3.7m.so.1.0
[2021-08-09T05:46:21.538033273Z DEBUG py_spy::python_spy] map: 00000008004d9000-000000080053ffff rw- #3.7m.so.1.0
[2021-08-09T05:46:21.538038305Z DEBUG py_spy::python_spy] map: 0000000800540000-000000080055ffff rw-
[2021-08-09T05:46:21.538041707Z DEBUG py_spy::python_spy] map: 0000000800560000-0000000800563fff r--
[2021-08-09T05:46:21.538045599Z DEBUG py_spy::python_spy] map: 0000000800564000-000000080056cfff r-x
[2021-08-09T05:46:21.538049304Z DEBUG py_spy::python_spy] map: 000000080056d000-000000080056dfff r--
[2021-08-09T05:46:21.538052887Z DEBUG py_spy::python_spy] map: 000000080056e000-000000080056efff rw-
[2021-08-09T05:46:21.538056422Z DEBUG py_spy::python_spy] map: 000000080056f000-000000080056ffff rw-
[2021-08-09T05:46:21.538059945Z DEBUG py_spy::python_spy] map: 0000000800570000-0000000800580fff rw-
[2021-08-09T05:46:21.538063084Z DEBUG py_spy::python_spy] map: 0000000800581000-0000000800584fff r-- o.8.2.0
[2021-08-09T05:46:21.538066794Z DEBUG py_spy::python_spy] map: 0000000800585000-000000080058bfff r-x o.8.2.0
[2021-08-09T05:46:21.538070579Z DEBUG py_spy::python_spy] map: 000000080058c000-000000080058cfff r-- o.8.2.0
[2021-08-09T05:46:21.538228742Z DEBUG py_spy::python_spy] map: 000000080058d000-000000080058dfff rw- o.8.2.0
[2021-08-09T05:46:21.538238178Z DEBUG py_spy::python_spy] map: 000000080058e000-000000080058ffff rw-
[2021-08-09T05:46:21.538245335Z DEBUG py_spy::python_spy] map: 0000000800590000-0000000800590fff r--
[2021-08-09T05:46:21.538267261Z DEBUG py_spy::python_spy] map: 0000000800591000-0000000800591fff r-x
[2021-08-09T05:46:21.538271270Z DEBUG py_spy::python_spy] map: 0000000800592000-0000000800592fff r--
[2021-08-09T05:46:21.538274955Z DEBUG py_spy::python_spy] map: 0000000800593000-0000000800593fff rw-
[2021-08-09T05:46:21.538278550Z DEBUG py_spy::python_spy] map: 0000000800594000-000000080059bfff r--
[2021-08-09T05:46:21.538281986Z DEBUG py_spy::python_spy] map: 000000080059c000-00000008005a6fff r-x
[2021-08-09T05:46:21.538285508Z DEBUG py_spy::python_spy] map: 00000008005a7000-00000008005a7fff r--
[2021-08-09T05:46:21.538289116Z DEBUG py_spy::python_spy] map: 00000008005a8000-00000008005a8fff rw-
[2021-08-09T05:46:21.538292656Z DEBUG py_spy::python_spy] map: 00000008005a9000-00000008005a9fff rw-
[2021-08-09T05:46:21.538296309Z DEBUG py_spy::python_spy] map: 00000008005aa000-00000008005abfff rw-
[2021-08-09T05:46:21.538416868Z DEBUG py_spy::python_spy] map: 00000008005ac000-00000008005bcfff r--
[2021-08-09T05:46:21.538425627Z DEBUG py_spy::python_spy] map: 00000008005bd000-00000008005dbfff r-x
[2021-08-09T05:46:21.538433161Z DEBUG py_spy::python_spy] map: 00000008005dc000-00000008005dcfff r--
[2021-08-09T05:46:21.538454237Z DEBUG py_spy::python_spy] map: 00000008005dd000-00000008005ddfff rw-
[2021-08-09T05:46:21.538457968Z DEBUG py_spy::python_spy] map: 00000008005de000-00000008005eafff r--
[2021-08-09T05:46:21.538461386Z DEBUG py_spy::python_spy] map: 00000008005eb000-00000008005fcfff r-x
[2021-08-09T05:46:21.538464897Z DEBUG py_spy::python_spy] map: 00000008005fd000-00000008005fdfff r--
[2021-08-09T05:46:21.538468344Z DEBUG py_spy::python_spy] map: 00000008005fe000-00000008005fffff rw-
[2021-08-09T05:46:21.538471786Z DEBUG py_spy::python_spy] map: 0000000800600000-000000080060afff rw-
[2021-08-09T05:46:21.538474887Z DEBUG py_spy::python_spy] map: 000000080060b000-0000000800689fff r--
[2021-08-09T05:46:21.538478224Z DEBUG py_spy::python_spy] map: 000000080068a000-00000008007c9fff r-x
[2021-08-09T05:46:21.538481702Z DEBUG py_spy::python_spy] map: 00000008007ca000-00000008007d2fff r--
[2021-08-09T05:46:21.538586614Z DEBUG py_spy::python_spy] map: 00000008007d3000-00000008007d3fff rw-
[2021-08-09T05:46:21.538595238Z DEBUG py_spy::python_spy] map: 00000008007d4000-00000008007dafff rw-
[2021-08-09T05:46:21.538602858Z DEBUG py_spy::python_spy] map: 00000008007db000-0000000800a62fff rw-
[2021-08-09T05:46:21.538623692Z DEBUG py_spy::python_spy] map: 0000000800a63000-0000000800bfffff rw-
[2021-08-09T05:46:21.538627001Z DEBUG py_spy::python_spy] map: 0000000800c00000-0000000801390fff rw-
[2021-08-09T05:46:21.538630199Z DEBUG py_spy::python_spy] map: 0000000801391000-0000000801394fff r-- 0/lib-dynload/readline.so
[2021-08-09T05:46:21.538634199Z DEBUG py_spy::python_spy] map: 0000000801395000-0000000801397fff r-x 0/lib-dynload/readline.so
[2021-08-09T05:46:21.538638053Z DEBUG py_spy::python_spy] map: 0000000801398000-0000000801398fff r-- 0/lib-dynload/readline.so
[2021-08-09T05:46:21.538641962Z DEBUG py_spy::python_spy] map: 0000000801399000-000000080139afff rw- 0/lib-dynload/readline.so
[2021-08-09T05:46:21.538645810Z DEBUG py_spy::python_spy] map: 000000080139b000-00000008013bafff r-- !ne.so.8.0
[2021-08-09T05:46:21.538649665Z DEBUG py_spy::python_spy] map: 00000008013bb000-00000008013e7fff r-x !ne.so.8.0
[2021-08-09T05:46:21.538653431Z DEBUG py_spy::python_spy] map: 00000008013e8000-00000008013e9fff r-- !ne.so.8.0
[2021-08-09T05:46:21.538772870Z DEBUG py_spy::python_spy] map: 00000008013ea000-00000008013eafff rw- !ne.so.8.0
[2021-08-09T05:46:21.538782117Z DEBUG py_spy::python_spy] map: 00000008013eb000-00000008013f1fff rw- !ne.so.8.0
[2021-08-09T05:46:21.538790277Z DEBUG py_spy::python_spy] map: 00000008013f2000-00000008013f2fff rw-
[2021-08-09T05:46:21.538810765Z DEBUG py_spy::python_spy] map: 00000008013f3000-000000080141bfff r--
[2021-08-09T05:46:21.538814789Z DEBUG py_spy::python_spy] map: 000000080141c000-000000080144dfff r-x
[2021-08-09T05:46:21.538818474Z DEBUG py_spy::python_spy] map: 000000080144e000-0000000801451fff r--
[2021-08-09T05:46:21.538822043Z DEBUG py_spy::python_spy] map: 0000000801452000-0000000801453fff rw-
[2021-08-09T05:46:21.538825577Z DEBUG py_spy::python_spy] map: 0000000801454000-0000000801499fff rw-
[2021-08-09T05:46:21.538828729Z DEBUG py_spy::python_spy] map: 00007fffdfffe000-00007fffdfffefff ---
[2021-08-09T05:46:21.538831741Z DEBUG py_spy::python_spy] map: 00007fffdffff000-00007ffffffdefff ---
[2021-08-09T05:46:21.538834827Z DEBUG py_spy::python_spy] map: 00007ffffffdf000-00007fffffffefff rw-
[2021-08-09T05:46:21.538837783Z DEBUG py_spy::python_spy] map: 00007ffffffff000-00007fffffffffff r-x
[2021-08-09T05:46:21.539003135Z WARN  py_spy::python_spy] Failed to find '/usr/local/bin/python3.7m' in virtual memory maps, falling back to first map region
[2021-08-09T05:46:21.539570472Z INFO  py_spy::python_spy] Getting version from python binary BSS
[2021-08-09T05:46:21.540536384Z INFO  py_spy::python_spy] Failed to get version from BSS section: failed to find version string
[2021-08-09T05:46:21.540549633Z INFO  py_spy::python_spy] Trying to get version from path: /usr/local/bin/python3.7m

@akhramov
Copy link
Contributor

akhramov commented Aug 9, 2021

Oh, that's perfect. There's definitely something off with our proc maps routines. As you see, the filenames are corrupted for some reason.

Given the bug is reproducible on several machines, let me make a wild guess. What's your locale?


Or may be there is something wrong with the memory layout of the ptrace struct :(

@yocalebo
Copy link
Author

yocalebo commented Aug 9, 2021

Locale is the following:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

@akhramov
Copy link
Contributor

@yocalebo hey, can you please run the examples from the latest proc-maps master? 🙏

akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.

- removes cirrus config and sets up a FreeBSD GH action job.
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.

- removes cirrus config and sets up a FreeBSD GH action job.
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.

- removes cirrus config and sets up a FreeBSD GH action job.
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 11, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
@yocalebo
Copy link
Author

Okay I built py-spy using latest master repo and made sure that it pulled in proc_maps 0.1.9 which has your bindgen changes. (on a side note, building failed for me because I didn't have any of the llvm related pkgs installed. I had to pkg install llvm12 to get the build to work)

Here is the output from py-spy using latest master and latest proc_map:

[2021-08-11T23:50:30.490342336Z INFO  py_spy::python_spy] Got virtual memory maps from pid 33988:
[2021-08-11T23:50:30.490395681Z DEBUG py_spy::python_spy] map: 0000000000200000-0000000000200fff r-- /usr/local/bin/python3.7m
[2021-08-11T23:50:30.490451720Z DEBUG py_spy::python_spy] map: 0000000000201000-0000000000201fff r-x /usr/local/bin/python3.7m
[2021-08-11T23:50:30.490502987Z DEBUG py_spy::python_spy] map: 0000000000202000-0000000000202fff r-- /usr/local/bin/python3.7m
[2021-08-11T23:50:30.490547788Z DEBUG py_spy::python_spy] map: 0000000000203000-0000000000203fff rw-
[2021-08-11T23:50:30.490601016Z DEBUG py_spy::python_spy] map: 0000000800203000-000000080020bfff r-- /libexec/ld-elf.so.1
[2021-08-11T23:50:30.490640706Z DEBUG py_spy::python_spy] map: 000000080020c000-0000000800226fff r-x /libexec/ld-elf.so.1
[2021-08-11T23:50:30.490679515Z DEBUG py_spy::python_spy] map: 0000000800227000-0000000800227fff r-- /libexec/ld-elf.so.1
[2021-08-11T23:50:30.490719798Z DEBUG py_spy::python_spy] map: 0000000800228000-0000000800228fff rw- /libexec/ld-elf.so.1
[2021-08-11T23:50:30.490760504Z DEBUG py_spy::python_spy] map: 0000000800229000-000000080024bfff rw-
[2021-08-11T23:50:30.490797192Z DEBUG py_spy::python_spy] map: 000000080024c000-0000000800349fff r-- /usr/local/lib/libpython3.7m.so.1.0
[2021-08-11T23:50:30.490837297Z DEBUG py_spy::python_spy] map: 000000080034a000-00000008004d4fff r-x /usr/local/lib/libpython3.7m.so.1.0
[2021-08-11T23:50:30.490878205Z DEBUG py_spy::python_spy] map: 00000008004d5000-00000008004d7fff r-- /usr/local/lib/libpython3.7m.so.1.0
[2021-08-11T23:50:30.490916344Z DEBUG py_spy::python_spy] map: 00000008004d8000-00000008004d8fff rw- /usr/local/lib/libpython3.7m.so.1.0
[2021-08-11T23:50:30.490966599Z DEBUG py_spy::python_spy] map: 00000008004d9000-000000080053ffff rw- /usr/local/lib/libpython3.7m.so.1.0
[2021-08-11T23:50:30.491008221Z DEBUG py_spy::python_spy] map: 0000000800540000-000000080055ffff rw-
[2021-08-11T23:50:30.491044146Z DEBUG py_spy::python_spy] map: 0000000800560000-0000000800563fff r-- /lib/libcrypt.so.5
[2021-08-11T23:50:30.491094550Z DEBUG py_spy::python_spy] map: 0000000800564000-000000080056cfff r-x /lib/libcrypt.so.5
[2021-08-11T23:50:30.491135488Z DEBUG py_spy::python_spy] map: 000000080056d000-000000080056dfff r-- /lib/libcrypt.so.5
[2021-08-11T23:50:30.491172593Z DEBUG py_spy::python_spy] map: 000000080056e000-000000080056efff rw- /lib/libcrypt.so.5
[2021-08-11T23:50:30.491221283Z DEBUG py_spy::python_spy] map: 000000080056f000-000000080056ffff rw- /lib/libcrypt.so.5
[2021-08-11T23:50:30.491261799Z DEBUG py_spy::python_spy] map: 0000000800570000-0000000800580fff rw-
[2021-08-11T23:50:30.491300299Z DEBUG py_spy::python_spy] map: 0000000800581000-0000000800584fff r-- /usr/local/lib/libintl.so.8.2.0
[2021-08-11T23:50:30.491350582Z DEBUG py_spy::python_spy] map: 0000000800585000-000000080058bfff r-x /usr/local/lib/libintl.so.8.2.0
[2021-08-11T23:50:30.491391751Z DEBUG py_spy::python_spy] map: 000000080058c000-000000080058cfff r-- /usr/local/lib/libintl.so.8.2.0
[2021-08-11T23:50:30.491430300Z DEBUG py_spy::python_spy] map: 000000080058d000-000000080058dfff rw- /usr/local/lib/libintl.so.8.2.0
[2021-08-11T23:50:30.491477673Z DEBUG py_spy::python_spy] map: 000000080058e000-000000080058ffff rw-
[2021-08-11T23:50:30.491518176Z DEBUG py_spy::python_spy] map: 0000000800590000-0000000800590fff r-- /usr/lib/libdl.so.1
[2021-08-11T23:50:30.491557268Z DEBUG py_spy::python_spy] map: 0000000800591000-0000000800591fff r-x /usr/lib/libdl.so.1
[2021-08-11T23:50:30.491605053Z DEBUG py_spy::python_spy] map: 0000000800592000-0000000800592fff r-- /usr/lib/libdl.so.1
[2021-08-11T23:50:30.491646068Z DEBUG py_spy::python_spy] map: 0000000800593000-0000000800593fff rw- /usr/lib/libdl.so.1
[2021-08-11T23:50:30.491685542Z DEBUG py_spy::python_spy] map: 0000000800594000-000000080059bfff r-- /lib/libutil.so.9
[2021-08-11T23:50:30.491732669Z DEBUG py_spy::python_spy] map: 000000080059c000-00000008005a6fff r-x /lib/libutil.so.9
[2021-08-11T23:50:30.491773405Z DEBUG py_spy::python_spy] map: 00000008005a7000-00000008005a7fff r-- /lib/libutil.so.9
[2021-08-11T23:50:30.491810467Z DEBUG py_spy::python_spy] map: 00000008005a8000-00000008005a8fff rw- /lib/libutil.so.9
[2021-08-11T23:50:30.491858666Z DEBUG py_spy::python_spy] map: 00000008005a9000-00000008005a9fff rw- /lib/libutil.so.9
[2021-08-11T23:50:30.491899353Z DEBUG py_spy::python_spy] map: 00000008005aa000-00000008005abfff rw-
[2021-08-11T23:50:30.491936719Z DEBUG py_spy::python_spy] map: 00000008005ac000-00000008005bcfff r-- /lib/libm.so.5
[2021-08-11T23:50:30.491985707Z DEBUG py_spy::python_spy] map: 00000008005bd000-00000008005dbfff r-x /lib/libm.so.5
[2021-08-11T23:50:30.492025926Z DEBUG py_spy::python_spy] map: 00000008005dc000-00000008005dcfff r-- /lib/libm.so.5
[2021-08-11T23:50:30.492064906Z DEBUG py_spy::python_spy] map: 00000008005dd000-00000008005ddfff rw- /lib/libm.so.5
[2021-08-11T23:50:30.492114210Z DEBUG py_spy::python_spy] map: 00000008005de000-00000008005eafff r-- /lib/libthr.so.3
[2021-08-11T23:50:30.492155426Z DEBUG py_spy::python_spy] map: 00000008005eb000-00000008005fcfff r-x /lib/libthr.so.3
[2021-08-11T23:50:30.492195825Z DEBUG py_spy::python_spy] map: 00000008005fd000-00000008005fdfff r-- /lib/libthr.so.3
[2021-08-11T23:50:30.492242835Z DEBUG py_spy::python_spy] map: 00000008005fe000-00000008005fffff rw- /lib/libthr.so.3
[2021-08-11T23:50:30.492283187Z DEBUG py_spy::python_spy] map: 0000000800600000-000000080060afff rw-
[2021-08-11T23:50:30.492319541Z DEBUG py_spy::python_spy] map: 000000080060b000-0000000800689fff r-- /lib/libc.so.7
[2021-08-11T23:50:30.492369251Z DEBUG py_spy::python_spy] map: 000000080068a000-00000008007c9fff r-x /lib/libc.so.7
[2021-08-11T23:50:30.492409853Z DEBUG py_spy::python_spy] map: 00000008007ca000-00000008007d2fff r-- /lib/libc.so.7
[2021-08-11T23:50:30.492451928Z DEBUG py_spy::python_spy] map: 00000008007d3000-00000008007d3fff rw- /lib/libc.so.7
[2021-08-11T23:50:30.492499636Z DEBUG py_spy::python_spy] map: 00000008007d4000-00000008007dafff rw- /lib/libc.so.7
[2021-08-11T23:50:30.492539374Z DEBUG py_spy::python_spy] map: 00000008007db000-0000000800a3ffff rw-
[2021-08-11T23:50:30.492577307Z DEBUG py_spy::python_spy] map: 0000000800a40000-0000000800a53fff r-- /usr/share/locale/en_US.UTF-8/LC_COLLATE
[2021-08-11T23:50:30.492624097Z DEBUG py_spy::python_spy] map: 0000000800a54000-0000000800a60fff rw-
[2021-08-11T23:50:30.492662729Z DEBUG py_spy::python_spy] map: 0000000800a61000-0000000800bfffff rw-
[2021-08-11T23:50:30.492700852Z DEBUG py_spy::python_spy] map: 0000000800c00000-00000008013a9fff rw-
[2021-08-11T23:50:30.492750451Z DEBUG py_spy::python_spy] map: 00000008013aa000-00000008013adfff r-- /usr/local/lib/python3.7/lib-dynload/readline.so
[2021-08-11T23:50:30.492792078Z DEBUG py_spy::python_spy] map: 00000008013ae000-00000008013b0fff r-x /usr/local/lib/python3.7/lib-dynload/readline.so
[2021-08-11T23:50:30.492832835Z DEBUG py_spy::python_spy] map: 00000008013b1000-00000008013b1fff r-- /usr/local/lib/python3.7/lib-dynload/readline.so
[2021-08-11T23:50:30.492878870Z DEBUG py_spy::python_spy] map: 00000008013b2000-00000008013b3fff rw- /usr/local/lib/python3.7/lib-dynload/readline.so
[2021-08-11T23:50:30.492920979Z DEBUG py_spy::python_spy] map: 00000008013b4000-00000008013d3fff r-- /usr/local/lib/libreadline.so.8.0
[2021-08-11T23:50:30.492961009Z DEBUG py_spy::python_spy] map: 00000008013d4000-0000000801400fff r-x /usr/local/lib/libreadline.so.8.0
[2021-08-11T23:50:30.493006956Z DEBUG py_spy::python_spy] map: 0000000801401000-0000000801402fff r-- /usr/local/lib/libreadline.so.8.0
[2021-08-11T23:50:30.493048129Z DEBUG py_spy::python_spy] map: 0000000801403000-0000000801403fff rw- /usr/local/lib/libreadline.so.8.0
[2021-08-11T23:50:30.493090445Z DEBUG py_spy::python_spy] map: 0000000801404000-000000080140afff rw- /usr/local/lib/libreadline.so.8.0
[2021-08-11T23:50:30.493136607Z DEBUG py_spy::python_spy] map: 000000080140b000-000000080140bfff rw-
[2021-08-11T23:50:30.493174887Z DEBUG py_spy::python_spy] map: 000000080140c000-0000000801434fff r-- /lib/libncursesw.so.8
[2021-08-11T23:50:30.493217244Z DEBUG py_spy::python_spy] map: 0000000801435000-0000000801466fff r-x /lib/libncursesw.so.8
[2021-08-11T23:50:30.493261138Z DEBUG py_spy::python_spy] map: 0000000801467000-000000080146afff r-- /lib/libncursesw.so.8
[2021-08-11T23:50:30.493301656Z DEBUG py_spy::python_spy] map: 000000080146b000-000000080146cfff rw- /lib/libncursesw.so.8
[2021-08-11T23:50:30.493343849Z DEBUG py_spy::python_spy] map: 000000080146d000-00000008014affff rw-
[2021-08-11T23:50:30.493388773Z DEBUG py_spy::python_spy] map: 00007fffdfffe000-00007fffdfffefff ---
[2021-08-11T23:50:30.493423283Z DEBUG py_spy::python_spy] map: 00007fffdffff000-00007ffffffdefff ---
[2021-08-11T23:50:30.493461573Z DEBUG py_spy::python_spy] map: 00007ffffffdf000-00007fffffffefff rw-
[2021-08-11T23:50:30.493496826Z DEBUG py_spy::python_spy] map: 00007ffffffff000-00007fffffffffff r-x
thread 'main' panicked at 'attempt to subtract with overflow', src/binary_parser.rs:104:26
stack backtrace:
   0:          0x1aa752d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h99eb2bb559f5c20a
   1:          0x1ae13be - core::fmt::write::h36115269f54ab895
   2:          0x1aa3b63 - std::io::Write::write_fmt::hbeab1bdf1fff82a1
   3:          0x1abe683 - std::panicking::default_hook::{{closure}}::hf4f52418174fc705
   4:          0x1abe1ff - std::panicking::default_hook::h6ae7b7383363fd20
   5:          0x1abed1d - std::panicking::rust_panic_with_hook::h464a89e144497d4f
   6:          0x1aa790b - std::panicking::begin_panic_handler::{{closure}}::hbd60ef88fa4db63c
   7:          0x1aa7660 - std::sys_common::backtrace::__rust_end_short_backtrace::hc76c2013cc85f77f
   8:          0x1abe8c5 - rust_begin_unwind
   9:          0x1ad63f0 - core::panicking::panic_fmt::he877c08fee645e1d
  10:          0x1ad6348 - core::panicking::panic::h3d5085503e63bfa5
  11:          0x139848f - py_spy::binary_parser::parse_binary::h030f4469e6ec44b7
                               at /root/py-spy/src/binary_parser.rs:104:26
  12:          0x14d9256 - py_spy::python_spy::PythonProcessInfo::new::h5c48779e35130dbf
                               at /root/py-spy/src/python_spy.rs:767:33
  13:          0x14c493e - py_spy::python_spy::PythonSpy::new::h3b237819d9f20b2f
                               at /root/py-spy/src/python_spy.rs:75:27
  14:          0x14376cd - py_spy::dump::print_traces::h188e8b7409edcaec
                               at /root/py-spy/src/dump.rs:10:23
  15:          0x148b9b6 - py_spy::run_spy_command::h5b427cd19a6892a7
                               at /root/py-spy/src/main.rs:316:13
  16:          0x148bce8 - py_spy::pyspy_main::h4618ea01925f6f07
                               at /root/py-spy/src/main.rs:345:9
  17:          0x148d15a - py_spy::main::he7315948c51b8bf0
                               at /root/py-spy/src/main.rs:414:23
  18:          0x14745ee - core::ops::function::FnOnce::call_once::h77de8fc231b2bf25
                               at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/core/src/ops/function.rs:227:5
  19:          0x14ab1a1 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8eb19c87ed4ec16c
                               at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/sys_common/backtrace.rs:125:18
  20:          0x13e0154 - std::rt::lang_start::{{closure}}::h9c2e9487f4364205
                               at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/rt.rs:49:18
  21:          0x1ac0df5 - std::rt::lang_start_internal::h382cbf53dddb8a63
  22:          0x13e012f - std::rt::lang_start::he22ab17e3c32a554
                               at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/rt.rs:48:5
  23:          0x148d5cf - main
  24:          0x1362bd2 - _start
                               at /usr/src/lib/csu/amd64/crt1.c:76:7

Here is the output from compiling my own little rust program using the example print_map.rs from the proc-map repo.

root@fbsd12:~/print_maps # target/debug/./print_maps 33988
Filename Some("/usr/local/bin/python3.7m") Address 2097152 Size 4095
Filename Some("/usr/local/bin/python3.7m") Address 2101248 Size 4095
Filename Some("/usr/local/bin/python3.7m") Address 2105344 Size 4095
Filename None Address 2109440 Size 4095
Filename Some("/libexec/ld-elf.so.1") Address 34361847808 Size 36863
Filename Some("/libexec/ld-elf.so.1") Address 34361884672 Size 110591
Filename Some("/libexec/ld-elf.so.1") Address 34361995264 Size 4095
Filename Some("/libexec/ld-elf.so.1") Address 34361999360 Size 4095
Filename None Address 34362003456 Size 143359
Filename Some("/usr/local/lib/libpython3.7m.so.1.0") Address 34362146816 Size 1040383
Filename Some("/usr/local/lib/libpython3.7m.so.1.0") Address 34363187200 Size 1617919
Filename Some("/usr/local/lib/libpython3.7m.so.1.0") Address 34364805120 Size 12287
Filename Some("/usr/local/lib/libpython3.7m.so.1.0") Address 34364817408 Size 4095
Filename Some("/usr/local/lib/libpython3.7m.so.1.0") Address 34364821504 Size 421887
Filename None Address 34365243392 Size 131071
Filename Some("/lib/libcrypt.so.5") Address 34365374464 Size 16383
Filename Some("/lib/libcrypt.so.5") Address 34365390848 Size 36863
Filename Some("/lib/libcrypt.so.5") Address 34365427712 Size 4095
Filename Some("/lib/libcrypt.so.5") Address 34365431808 Size 4095
Filename Some("/lib/libcrypt.so.5") Address 34365435904 Size 4095
Filename None Address 34365440000 Size 69631
Filename Some("/usr/local/lib/libintl.so.8.2.0") Address 34365509632 Size 16383
Filename Some("/usr/local/lib/libintl.so.8.2.0") Address 34365526016 Size 28671
Filename Some("/usr/local/lib/libintl.so.8.2.0") Address 34365554688 Size 4095
Filename Some("/usr/local/lib/libintl.so.8.2.0") Address 34365558784 Size 4095
Filename None Address 34365562880 Size 8191
Filename Some("/usr/lib/libdl.so.1") Address 34365571072 Size 4095
Filename Some("/usr/lib/libdl.so.1") Address 34365575168 Size 4095
Filename Some("/usr/lib/libdl.so.1") Address 34365579264 Size 4095
Filename Some("/usr/lib/libdl.so.1") Address 34365583360 Size 4095
Filename Some("/lib/libutil.so.9") Address 34365587456 Size 32767
Filename Some("/lib/libutil.so.9") Address 34365620224 Size 45055
Filename Some("/lib/libutil.so.9") Address 34365665280 Size 4095
Filename Some("/lib/libutil.so.9") Address 34365669376 Size 4095
Filename Some("/lib/libutil.so.9") Address 34365673472 Size 4095
Filename None Address 34365677568 Size 8191
Filename Some("/lib/libm.so.5") Address 34365685760 Size 69631
Filename Some("/lib/libm.so.5") Address 34365755392 Size 126975
Filelame Some("/lib/libm.so.5") Address 34365882368 Size 4095
Filename Some("/lib/libm.so.5") Address 34365886464 Size 4095
Filename Some("/lib/libthr.so.3") Address 34365890560 Size 53247
Filename Some("/lib/libthr.so.3") Address 34365943808 Size 73727
Filename Some("/lib/libthr.so.3") Address 34366017536 Size 4095
Filename Some("/lib/libthr.so.3") Address 34366021632 Size 8191
Filename None Address 34366029824 Size 45055
Filename Some("/lib/libc.so.7") Address 34366074880 Size 520191
Filename Some("/lib/libc.so.7") Address 34366595072 Size 1310719
Filename Some("/lib/libc.so.7") Address 34367905792 Size 36863
Filename Some("/lib/libc.so.7") Address 34367942656 Size 4095
Filename Some("/lib/libc.so.7") Address 34367946752 Size 28671
Filename None Address 34367975424 Size 2510847
Filename Some("/usr/share/locale/en_US.UTF-8/LC_COLLATE") Address 34370486272 Size 81919
Filename None Address 34370568192 Size 53247
Filename None Address 34370621440 Size 1699839
Filename None Address 34372321280 Size 8036351
Filename Some("/usr/local/lib/python3.7/lib-dynload/readline.so") Address 34380357632 Size 16383
Filename Some("/usr/local/lib/python3.7/lib-dynload/readline.so") Address 34380374016 Size 12287
Filename Some("/usr/local/lib/python3.7/lib-dynload/readline.so") Address 34380386304 Size 4095
Filename Some("/usr/local/lib/python3.7/lib-dynload/readline.so") Address 34380390400 Size 8191
Filename Some("/usr/local/lib/libreadline.so.8.0") Address 34380398592 Size 131071
Filename Some("/usr/local/lib/libreadline.so.8.0") Address 34380529664 Size 184319
Filename Some("/usr/local/lib/libreadline.so.8.0") Address 34380713984 Size 8191
Filename Some("/usr/local/lib/libreadline.so.8.0") Address 34380722176 Size 4095
Filename Some("/usr/local/lib/libreadline.so.8.0") Address 34380726272 Size 28671
Filename None Address 34380754944 Size 4095
Filename Some("/lib/libncursesw.so.8") Address 34380759040 Size 167935
Filename Some("/lib/libncursesw.so.8") Address 34380926976 Size 204799
Filename Some("/lib/libncursesw.so.8") Address 34381131776 Size 16383
Filename Some("/lib/libncursesw.so.8") Address 34381148160 Size 8191
Filename None Address 34381156352 Size 274431
Filename None Address 140736951476224 Size 4095
Filename None Address 140736951480320 Size 536739839
Filename None Address 140737488220160 Size 131071
Filename None Address 140737488351232 Size 4095

akhramov added a commit to akhramov/py-spy that referenced this issue Aug 12, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 12, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 12, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 12, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
akhramov added a commit to akhramov/py-spy that referenced this issue Aug 12, 2021
An Elf segment may have a non-zero offset and that may result in
subtraction overflow when we calculating the symbol addresses.

Apart from that, CI workflows are run within GH Actions with FreeBSD
being notable exception. While FreeBSD is not supported on actions,
the conventional workaround is to run builds on macos runner using a
vagrant box.

This change
- Handles the subtraction overflow case by defaulting to zero.
- removes cirrus config and sets up a FreeBSD GH action job.
- Also bumps proc-maps version in attempt to resolve benfred#431
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

No branches or pull requests

3 participants