Commit Graph

77 Commits

Author SHA1 Message Date
patryk4815 c80793f41e
add python3.10, add debian12, drop python3.8, drop ubuntu20.04, drop debian11 (#2421)
* drop ubuntu-20.04

* bump debian11->debian12

* bump python3.8->3.10

* bump py3.10 dependencies

* fix mypy/lint errors
2024-09-05 13:55:16 +02:00
Disconnect3d a264783ff0
Disable arm64 runner on CI/CD (#2400)
We don't have an ARM64 runner for creating release binaries since ~6 months.

Commenting this out until GitHub finally allows open source projects to use its own arm64 runners.
2024-08-29 18:23:50 +02:00
OBarronCS 1438fc0616
Qemu user test structure (#2275)
* Initial version of qemu-user tests

* Refactor testing files to reduce file duplication, introduce qemu-user-tests

* lint and edit github actions workflow file. Move old qemu-user tests to seperate directory

* Add iproute2 so ss command is available

* test ubuntu 24

* funkiness with current working directory...

* Further remote old test_qemu.sh and integrate into a Pytest fixture

* lint

* Disable ASLR, add test for aarch64 jumps

* Use Popen.kill() function to make sure it closes.

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>

* qemu.kill() on the other fixture as well

* comment

* comment

* lint

* system test path stuff

* remove old try-catch block

* revert

* revert path change

* Use os._exit to pass return code, and move qemu-user tests above system tests because they run significantly faster

* lint

* Flush stdout before os._exit

* Comment out flaky check for the address of main in old qemu tests

* rename qemu-user to cross-arch

* rename qemu-user to cross-arch and hotfix to not run pytest when
cross-arch is used

* remove todo comment

* another comment

* Test pwndbg.gdblib.symbol.address is not None and revert setarch -R

* Revert os.exit change

* Revert os.exit change

* Revert os.exit change

* readd os.exit in new exit places

* lint

* rebase

* delete file introduced in rebase

* break up tests into 3 files to invoke separately. Update GitHub workflow, remove code duplication in existing test

* code coverage

* fix code coverage

* lint

* test difference between Ubuntu 22 and 24 in Kernel tests

* lint

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2024-08-17 01:49:45 +02:00
Jason An 14aff9a564
use docker compose instead of docker-compose (#2335) 2024-08-01 10:44:59 +02:00
Disconnect3d a7962fdf4d
Fix #2314: properly cache docker image build on CI/CD (#2322)
Hopefully this fixes #2314?
2024-07-30 17:17:55 +02:00
Disconnect3d 440eeb428e
Add Ubuntu 24.04 to CI tests run (#2215) 2024-06-07 09:24:06 -07:00
Aaron Adams c85d16b246
fix trailing whitespace everywhere (#2188) 2024-05-29 19:40:19 -07:00
Gulshan Singh d6abb33e02
Fix and re-enable unit tests (#2182)
* Add gdb_version to mock gdblib

* Re-enable unit tests

* Only collect unit test coverage if --cov is passed

* Source venv before running tests in github action

* Add venv path PATH in to Dockerfile

* Only check for "/ls" in `which` test
2024-05-29 00:33:37 -07:00
Gulshan Singh f2c4e2bfea
Add pending-author-response workflow (#2140) 2024-05-13 15:42:29 +02:00
Gulshan Singh 7ae13403de
Source venv before deploying docs (#2160) 2024-05-09 13:54:51 -07:00
Gulshan Singh 33e91c2bab
Minor docs/website cleanup (#2159)
* Move docs dependencies into pyproject, install with poetry in GH action

* Remove old sphinx files

* Remove custom theme dir

* Hide navigation and toc on the blog page

* Remove fetch-depth from docs GH workflow

* Source venv before running mkdocs build

* Remove caching from docs GH workflow

* Remove python version in docs GH workflow
2024-05-09 13:48:42 -07:00
Gulshan Singh e760b3c948
Update GH checkout action to v4 (#2121) 2024-04-19 14:05:16 -07:00
Divyansh Singh a75b150242
show `mypy` errors inline on PRs (#2075)
show mypy errors inline on PRs

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
Co-authored-by: Gulshan Singh <gsingh2011@gmail.com>
2024-03-21 10:32:18 -07:00
Niko e77f309f97
Fix for workflow paths ignore (#1995)
* Fix for workflow paths ignore

* Fix linter issue
2024-01-08 17:47:11 +01:00
Niko 77516a2a0f
Remove docs and md files from workflows. (#1990) 2024-01-05 01:51:47 +01:00
Disconnect3d 1132a64269
Create FUNDING.yml (#1988) 2024-01-04 16:56:17 +01:00
Niko 40ed3a3bd1
[Docs] Add Docs to GH workflows (#1980)
* Add Docs to GH workflows

* Exclude docs/ from Docker build
2024-01-02 17:28:13 +01:00
patryk4815 40b7928d9e
fix missing cryptography 41.0.6 dependency in "nix" + add "release" workflow on pull_requests (#1955)
* add checking if "releases" build successfully on pull requests

* flake.lock: fix missing cryptography 41.0.6 dependency
2023-12-15 14:58:33 +01:00
psondej 05f0dbf9f9 releases.yml: add support for aarch64 packaging 2023-11-26 11:28:17 +01:00
psondej 57cbe2a3d0 introduce github-ci lockfile checking for: flake.lock, poetry.lock
Signed-off-by: psondej <patryk.sondej@grupawp.pl>
2023-11-02 03:26:35 +01:00
psondej ab96e1a9b9 - remove gdb-pt-dump from all files
- remove submodules from all files
- bump flake.lock
- add gdb-pt-dump as dependency
- fix building Dockerfile
- fix gdb-pt-dump was broken on portable packages
2023-11-02 03:10:36 +01:00
Patryk Sondej f3914e2696 init add portable pwndbg using nix, package for rpm,deb,arch,alpine
Signed-off-by: Patryk Sondej <patryk.sondej@gmail.com>
2023-08-06 16:16:53 +02:00
Disconnect3d b2bd87939f
Remove support for Ubuntu 18.04 (#1812) (#1814) 2023-07-19 18:40:37 +02:00
Disconnect3d 793065ada4
Fix tests status in README by triggering CI on push to dev branch (#1811) 2023-07-19 18:35:55 +02:00
Disconnect3d faae5197d6
Run CI lint only on Ubuntu 22.04 (#1813)
Until now we ran the lint job on CI on both Ubuntu 20.04 and Ubuntu 22.04. I am not sure why exactly we run it on both, but I think we can try running it only on Ubuntu 22.04 unless there are good reasons to keep both.
2023-07-19 18:26:41 +02:00
Disconnect3d 2552f95e1f
Remove support for Debian 10 (#1812) 2023-07-19 18:26:28 +02:00
intrigus-lgtm f7cb2f9cb9
Bringt back Archlinux CI. Fixes #1772, closes #1783 (#1800)
* Only run arch for testing

* Remove outdated arch repo

* Actually build the docker image

* Do not include site packages in sys.path

* Ignore `.relr.dyn` section; skip lines w/o spaces

Newer binaries can contain a `.relr.dyn` section to compress `R_X86_64_RELATIVE` relocation entries.
These binaries can be found for example on archlinux but also on Debian 12 for example.
`readelf` prints the content of the section similarly to this:
```
Relocation section '.relr.dyn' at offset 0x25220 contains 35 entries:
  1198 offsets
00000000001ce8d0
00000000001ce8e0
```
Compared to `00000000001d2000  0000000000000025 R_X86_64_IRELATIVE                        9f330` for
`.rela.plt`.

Pwndbg now chokes on the new format because it expects a space seperator where there is none.
It might be, that this is actually an upstream problem with binutils, because llvm-readelf prints this:
```
Relocation section '.relr.dyn' at offset 0x25220 contains 1198 entries:
    Offset             Info             Type               Symbol's Value  Symbol's Name
00000000001ce8d0  0000000000000008 R_X86_64_RELATIVE
00000000001ce8e0  0000000000000008 R_X86_64_RELATIVE
```

Nevertheless, we aren't actually interested in `R_X86_64_RELATIVE` relocations so I guess it's fine to
just skip all lines that contain no spaces at all.

`.relr.dyn` can only containt `R_X86_64_RELATIVE` relocations as far as I understand
https://maskray.me/blog/2021-10-30-relative-relocations-and-relr

* Accept Full RELRO in test

Archlinux has libc and ld with Full RELRO.
We now just accept Partial and Full RELRO.

* Do not copy binaries from host to docker

The `Dockerfile` copies the whole pwndbg folder to the image.
If we have built binaries on the host before, these binaries will contain references to
the host system and *copied*  to the image.
If we now run `context code` (inside docker) to have a look at the source code this will
fail, because we will try to refer to a path on the host system.

* Do not use loop index after loop

Do not use loop index after the loop. The tests assumed that the loop in line 186
would run at least once, thereby *resetting* `i` to zero. If we never enter the
loop, `i` will *continue* to have the value it had at the end of line 172.
This will cause the test to fail in mysterious ways because `i` is now not reset
to zero but still has the value `31` for example.

The solution is to never use `i` outside of a loop.

* Re-enable archlinux and temporarily disabled ones
2023-07-16 21:51:41 +02:00
intrigus-lgtm 2a6a05f2b8
Use fork of action-docker-layer-caching to prevent warnings (#1794)
https://github.com/satackey/action-docker-layer-caching hasn't been updated in quite some time.
E.g. GitHub has started to complain about the deprecated `save-state` command.

Solve this by switching to a newer fork.
2023-07-13 11:28:48 +02:00
intrigus-lgtm 7d9d2dc1de
Fix codecov (#1792)
* Fix coverage combine toml issue

This commit should fix this issue:
```
Run coverage combine
  coverage combine
  coverage xml
  shell: /usr/bin/bash -e {0}
Can't read 'pyproject.toml' without TOML support. Install with [toml] extra
Error: Process completed with exit code 1.
```

* setup.sh: cleanup the --user flag since we use venv now

Cleans up the --user flag from setup.sh since it is unused after we changed setup.sh to install Python dependencies in a virtual environment

* Remove --user flag from CI workflows

* Fix codecov problem

We need to run the python `coverage` library to collect coverage.
However, gdb was failing to find it.

Recently, pwndbg moved to using venvs. When pwndbg is initialized
it setups the venv "manually", that is, no "source .venv/bin/activate"
is needed. When we run gdb tests, we pass the `gdbinit.py` of pwndbg as a
command to gdb to be executed like this:
`gdb --silent --nx --nh -ex 'py import coverage;coverage.process_startup()' --command PATH_TO_gdbinit.py`
The problem is that *order* matters. This means that *first* coverage
is imported (by `-ex py ...`)  and only *then* the init script is executed.
When `coverage` is first imported, it's library search path only looks
in system libraries of python, and not the venv that gdbinit.py would load.
So we would try to import an old version of coverage and fail.

One solution would be to move around the commands, but this would be an
ugly hack IMHO. **Instead**, we should just tell gdb that this is an **init**
command that has to be executed before other commands.

Previously, the order did not matter. All of pwndbg's dependencies were
installed directly as system libraries to python. So the library search path
was the same before and after loading `gdbinit.py`.

---------

Co-authored-by: disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: intrigus <abc123zeus@live.de>
2023-07-11 20:27:25 +02:00
Disconnect3d 2f3438ddb2
CI: disable builds on push (#1788) 2023-07-06 10:45:03 +02:00
Disconnect3d cc13296abe
Fix #1785: remove unused PWNDBG_GITHUB_ACTIONS_TEST_RUN (#1786) 2023-07-06 02:33:36 +02:00
peace-maker a6cc19aa5c
Improve RISCV support (#1770)
* Improve RISCV support

This is a resurrection of #829

Co-authored-by: Tobias Faller <faller@endiio.com>

* Silence bogus vermin warning

* Fix relative backwards jump calculations

The target address wouldn't be truncated to the pointer size.

* Add basic qemu-user test

* Run qemu-user tests in CI

* Make shfmt happy

* Fix pwntools < 4.11.0 support

* Support RISCV32 for pwntools < 4.11.0 as well

---------

Co-authored-by: Tobias Faller <faller@endiio.com>
2023-07-04 14:05:35 +02:00
Disconnect3d 0db1eeadca
Remove ArchLinux from CI (#1776)
Since it breaks every now and then. This should be reverted when we start to install deps in a virtualenv
2023-07-04 00:11:28 +02:00
Disconnect3d 6e0d159273
Add +10min (30min) to qemu-tests CI build (#1737)
This is an attempt to mitigate: "Unit tests / qemu-tests (pull_request) Cancelled after 20m" that occurs in https://github.com/pwndbg/pwndbg/pull/1732
2023-05-24 12:48:32 +02:00
Gulshan Singh 2ee664a0ea
Add codecov.yml (#1720) 2023-05-20 17:13:15 +02:00
theguy147 6ff05bbcc8
Test more kernels (#1684) 2023-05-01 12:39:16 -07:00
theguy147 91c72a001e
feat: use pytest for qemu-system tests (#1679)
* feat: use pytest for qemu-system tests

* CI: update qemu workflow

* feat: make tests aware of ARCH and KERNEL_TYPE
2023-04-22 11:31:45 +02:00
Disconnect3d e5b188f1cf
Update CONTRIBUTING.md (#1681) 2023-04-22 11:19:32 +02:00
Disconnect3d 96482a60ce
CI: remove Ubuntu 18.04 from lint and tests builds (#1670) 2023-04-11 19:21:29 +02:00
Gulshan Singh b9c9f12efc Add qemu tests to CI 2023-01-25 03:32:17 -08:00
Gulshan Singh 3d57be41e2
Don't fail CI if codecov upload fails (#1532) 2023-01-18 19:42:56 -08:00
Gulshan Singh bc59a8eddd
Fix memoize type issues and enable mypy in lint script (#1518)
* memoize type fixes

* Add mypy to lint script

* Add mypy to dev-requirements.txt
2023-01-11 13:39:30 +01:00
Gulshan Singh d9f6934858
Run lint CI job and Ubuntu 22.04 and 18.04 (#1505)
* Run lint CI job and Ubuntu 22.04 and 18.04

* Fix lint errors
2023-01-04 21:33:44 -08:00
Mohit Saxena 894f6e2103 Update tests.yml 2022-12-19 23:09:17 +01:00
Mohit Saxena 0b0b09c7f5 Update tests.yml 2022-12-19 23:09:17 +01:00
Xeonacid 1224cf75ef
Support Arch Linux docker test (#1378)
* Specify dockerfile for ubuntu/debian

To add Dockerfile.arch later

* Support Arch Linux docker test

* Fix setup-dev supported distro

* Create set_zigpath function

* Download zig from upstream for archlinux

* Add hash as part of key for docker cache

as https://github.com/satackey/action-docker-layer-caching#inputs notes.
2022-11-22 19:21:40 +01:00
Disconnect3d dd6454065d
Merged #1351 PR: Run tests in docker images (#1370)
* Added images to DockerFile

* Docker test

* Docker.yml changes, longer timeout and naming changes

* typo in run command

* added matrix for docker workflow 'testing'

* typo in matrix

* git fixes

* docker testing

* Changed stage build'testing'

* testing docker change

* Run images in seperate containers

* docker files added

* reverted Dockerfile

* Removed files from the index (now ignored)

* Docker test, changed build to pull

* Update comments in Ubuntu and Debian dockerfiles

* added main service back

* Reducing common code

* Condensing docker-compose.yml

* Revert docker-compose.yml changes

* Removing matrix from docker-compose.yml

* removing target images from docker-compose

* Added dockerfile-unitTests

* Condensing docker-compose.yml

* Reverting compose changes

* Merged Dockerfiles and fixed image names

* removed .DS_Store

* Revert pycharm_debugging.md

* Testing remove

* Testing remove

* Remove ds files

* Add files via upload

* Add files via upload

* Docker changes

* Docker workflow changes

* Update Dockerfile

* Update docker-compose.yml

* shorten docker-compose.yml by using yaml anchors

* fix docker-compose.yml

Co-authored-by: Kevin Nguyen <u7315258@anu.edu.au>
Co-authored-by: Filip Mazur <110886132+mazfil@users.noreply.github.com>
Co-authored-by: KevinN318 <110944398+KevinN318@users.noreply.github.com>
Co-authored-by: Filip Mazur <u6934917@anu.edu.au>
2022-11-11 07:23:02 +01:00
Gulshan Singh f9dac535c3
Delete old issue template (#1343) 2022-10-24 08:35:39 -07:00
Gulshan Singh 8debb56105
Create pull_request_template.md (#1342) 2022-10-24 08:31:10 -07:00
Gulshan Singh 7efaa33b0c
Install shfmt on Ubuntu 22.04, otherwise skip running linter (#1323) 2022-10-23 01:33:00 +02:00