facebook / pyre-check

Performant type-checking for python.
https://pyre-check.org/
MIT License
6.85k stars 437 forks source link

Pysa tutorial not working #808

Closed draftyfrog closed 11 months ago

draftyfrog commented 1 year ago

Pysa Bug

Pre-submission checklist [x] I've checked the list of common issues and mine does not appear

Bug description The pysa tutorial does not work as pysa doesn't find the issue it should find on Ubuntu 20.04 LTS on WSL1.

Reproduction steps

  1. Pull pyre-check repo from Github
  2. Create new virtual environment and use it
  3. Install pyre by running pip install pyre-check fb-sapp
  4. Cd to exercise1 folder
  5. Run pyre analyze
  6. Analysis terminates with error: ƛ Found 1 model verification error! sources_sinks.pysa:1:0 django.http.request.HttpRequest.GET is not part of the environment, no module django in search path.
  7. As suggested in the common issues section, run pyre analyze --no-verify
  8. Analysis terminates with empty array [ ] instead of yielding the Possible RCE issue in views.operate_on_twos

Expected behavior Exactly what is described in the readme of exercise1 as I precisely followed the steps.

Logs Please run your reproduction steps with --noninteractive (eg. pyre --noninteractive analyze) and paste the output here: (I ran pyre --noninteractive analyze --no-verify)

2023-10-21 12:55:56,109 [PID 373] INFO No binary specified, looking for `pyre.bin` in PATH
2023-10-21 12:55:56,111 [PID 373] INFO Pyre binary is located at `{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/bin/pyre.bin`
2023-10-21 12:55:56,112 [PID 373] INFO Could not determine the number of Pyre workers from configuration. Auto-set the value to 3.
2023-10-21 12:55:56,113 [PID 373] INFO No typeshed specified, looking for it...
2023-10-21 12:55:56,115 [PID 373] INFO Found: `{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed`
2023-10-21 12:55:56,151 [PID 373] INFO Writing arguments into /tmp/pyre_arguments_h4le6nk7.json...
2023-10-21 12:55:56,152 [PID 373] DEBUG Arguments:
{
  "source_paths": {
    "kind": "simple",
    "paths": [
      "{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1"
    ]
  },
  "search_paths": [
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1/../../../stubs",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stdlib",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/D3DShot",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/DateTimeRange",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Deprecated",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/ExifRead",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Flask-Cors",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Flask-Migrate",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Flask-SQLAlchemy",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/JACK-Client",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Markdown",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Pillow",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/PyAutoGUI",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/PyMySQL",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/PyScreeze",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/PyYAML",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Pygments",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/SQLAlchemy",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/Send2Trash",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/aiofiles",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/annoy",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/appdirs",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/aws-xray-sdk",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/babel",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/backports.ssl_match_hostname",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/beautifulsoup4",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/bleach",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/boto",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/braintree",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/cachetools",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/caldav",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/cffi",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/chardet",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/chevron",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/click-spinner",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/colorama",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/commonmark",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/console-menu",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/contextvars",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/croniter",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/dateparser",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/decorator",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/dj-database-url",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/dockerfile-parse",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/docopt",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/docutils",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/editdistance",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/emoji",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/entrypoints",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/first",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-2020",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-bugbear",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-builtins",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-docstrings",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-plugin-utils",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-rst-docstrings",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-simplify",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/flake8-typing-imports",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/fpdf2",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/gdb",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/google-cloud-ndb",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/hdbcli",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/html5lib",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/httplib2",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/humanfriendly",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/ibm-db",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/influxdb-client",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/invoke",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/jmespath",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/jsonschema",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/keyboard",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/ldap3",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/mock",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/mypy-extensions",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/mysqlclient",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/netaddr",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/oauthlib",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/openpyxl",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/opentracing",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/paho-mqtt",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/paramiko",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/parsimonious",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/passlib",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/passpy",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/peewee",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pep8-naming",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pika",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/playsound",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/polib",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/prettytable",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/protobuf",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/psutil",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/psycopg2",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyOpenSSL",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyRFC3339",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyasn1",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyaudio",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pycocotools",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pycurl",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyfarmhash",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyflakes",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyinstaller",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pynput",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyserial",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pysftp",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pytest-lazy-fixture",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-crontab",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-datemath",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-dateutil",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-gflags",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-jose",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-nmap",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-slugify",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/python-xlib",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pytz",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pyvmomi",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/pywin32",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/redis",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/regex",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/requests",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/retry",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/setuptools",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/simplejson",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/singledispatch",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/six",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/slumber",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/stdlib-list",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/stripe",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/tabulate",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/tensorflow",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/termcolor",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/toml",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/toposort",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/tqdm",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/tree-sitter",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/tree-sitter-languages",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/ttkthemes",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/typed-ast",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/tzlocal",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/ujson",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/untangle",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/urllib3",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/vobject",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/waitress",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/whatthepatch",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/xmltodict",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/xxhash",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/zstd",
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/tutorial/lib/pyre_check/typeshed/stubs/zxcvbn"
  ],
  "excludes": [
    ".*/integration_test/.*"
  ],
  "checked_directory_allowlist": [
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1"
  ],
  "checked_directory_blocklist": [],
  "extensions": [],
  "log_path": "{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1/.pyre",
  "global_root": "{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1",
  "debug": false,
  "python_version": {
    "major": 3,
    "minor": 8,
    "micro": 10
  },
  "shared_memory": {},
  "parallel": true,
  "number_of_workers": 3,
  "inline_decorators": false,
  "no_verify": true,
  "verify_dsl": false,
  "verify_taint_config_only": false,
  "strict": false,
  "taint_model_paths": [
    "{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1"
  ],
  "use_cache": false,
  "build_cache_only": false,
  "check_invariants": false,
  "limit_entrypoints": false,
  "compact_ocaml_heap": false,
  "saved_state": {
    "watchman_root": null,
    "project_name": null,
    "cache_critical_files": []
  }
}
2023-10-21 12:55:56,448 [PID 373] INFO  Initializing shared memory (heap_size: 8589934592, dep_table_pow: 27, hash_table_pow: 26)
2023-10-21 12:55:56,609 [PID 373] INFO  Verifying taint configuration.
2023-10-21 12:55:56,631 [PID 373] PERFORMANCE  Verified taint configuration: 0.001s
2023-10-21 12:55:56,643 [PID 373] INFO  Verifying model syntax.
2023-10-21 12:55:56,649 [PID 373] INFO  Finding taint models in `{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1`.
2023-10-21 12:55:56,671 [PID 373] PERFORMANCE  Verified model syntax: 0.001s
2023-10-21 12:55:56,694 [PID 373] INFO  Parsing taint models for decorator modes...
2023-10-21 12:55:56,739 [PID 373] INFO  Finding taint models in `{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1`.
2023-10-21 12:55:56,772 [PID 373] PERFORMANCE  Parsed taint models for decorator modes: 0.001s
2023-10-21 12:55:56,775 [PID 373] INFO  Starting type checking...
2023-10-21 12:55:56,780 [PID 373] INFO  Creating environment...
2023-10-21 12:55:56,781 [PID 373] INFO  Building module tracker...
2023-10-21 12:55:59,360 [PID 373] PERFORMANCE  Module tracker built: 2.752s
2023-10-21 12:55:59,548 [PID 373] PERFORMANCE  Full environment built: 2.963s
2023-10-21 12:55:59,550 [PID 373] INFO  Found 7160 modules
2023-10-21 12:55:59,551 [PID 373] INFO  Collecting all definitions...
2023-10-21 12:56:10,416 [PID 373] PERFORMANCE  Collected definitions (defines: 128365): 10.868s
2023-10-21 12:56:10,418 [PID 373] INFO  Checking 128365 functions...
2023-10-21 12:56:50,057 [PID 373] INFO  Processed 4938 of 128365 functions
2023-10-21 12:56:50,628 [PID 373] INFO  Processed 9876 of 128365 functions
2023-10-21 12:56:51,155 [PID 373] INFO  Processed 14814 of 128365 functions
2023-10-21 12:56:58,055 [PID 373] INFO  Processed 19752 of 128365 functions
2023-10-21 12:56:58,715 [PID 373] INFO  Processed 24690 of 128365 functions
2023-10-21 12:56:59,183 [PID 373] INFO  Processed 29628 of 128365 functions
2023-10-21 12:57:03,190 [PID 373] INFO  Processed 34566 of 128365 functions
2023-10-21 12:57:06,788 [PID 373] INFO  Processed 39504 of 128365 functions
2023-10-21 12:57:08,383 [PID 373] INFO  Processed 44442 of 128365 functions
2023-10-21 12:57:09,550 [PID 373] INFO  Processed 49380 of 128365 functions
2023-10-21 12:57:14,833 [PID 373] INFO  Processed 54318 of 128365 functions
2023-10-21 12:57:16,542 [PID 373] INFO  Processed 59256 of 128365 functions
2023-10-21 12:57:16,996 [PID 373] INFO  Processed 64194 of 128365 functions
2023-10-21 12:57:20,919 [PID 373] INFO  Processed 69132 of 128365 functions
2023-10-21 12:57:23,143 [PID 373] INFO  Processed 74070 of 128365 functions
2023-10-21 12:57:27,076 [PID 373] INFO  Processed 79008 of 128365 functions
2023-10-21 12:57:47,102 [PID 373] INFO  Processed 83946 of 128365 functions
2023-10-21 12:57:55,437 [PID 373] INFO  Processed 88884 of 128365 functions
2023-10-21 12:58:08,675 [PID 373] INFO  Processed 93822 of 128365 functions
2023-10-21 12:58:24,614 [PID 373] INFO  Processed 98760 of 128365 functions
2023-10-21 12:58:33,933 [PID 373] INFO  Processed 103698 of 128365 functions
2023-10-21 12:58:39,711 [PID 373] INFO  Processed 108636 of 128365 functions
2023-10-21 12:58:44,198 [PID 373] INFO  Processed 113574 of 128365 functions
2023-10-21 12:58:53,386 [PID 373] INFO  Processed 118512 of 128365 functions
2023-10-21 12:59:12,165 [PID 373] INFO  Processed 123450 of 128365 functions
2023-10-21 12:59:34,624 [PID 373] INFO  Processed 128365 of 128365 functions
2023-10-21 12:59:34,625 [PID 373] PERFORMANCE  Check_TypeCheck: 204.208s
2023-10-21 12:59:34,625 [PID 373] MEMORY  Shared memory size post-typecheck (size: 256)
2023-10-21 12:59:35,097 [PID 373] INFO  Computing class hierarchy graph...
2023-10-21 12:59:37,938 [PID 373] PERFORMANCE  Computed class hierarchy graph: 2.841s
2023-10-21 12:59:37,939 [PID 373] INFO  Computing class intervals...
2023-10-21 12:59:38,109 [PID 373] PERFORMANCE  Computed class intervals: 0.171s
2023-10-21 12:59:45,203 [PID 373] INFO  Fetching initial callables to analyze...
2023-10-21 12:59:53,126 [PID 373] PERFORMANCE  Fetched initial callables to analyze (definitions: 470, internals: 2, stubs: 99748): 7.903s
2023-10-21 12:59:53,165 [PID 373] INFO  Parsing taint models...
2023-10-21 13:00:03,531 [PID 373] INFO  Finding taint models in `{path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1`.
2023-10-21 13:00:03,684 [PID 373] ERROR  Found 1 model verification errors!
2023-10-21 13:00:03,685 [PID 373] ERROR  {path-to-repo}/pyre-check/documentation/pysa_tutorial/exercise1/sources_sinks.pysa:1: `django.http.request.HttpRequest.GET` is not part of the environment, no module `django` in search path.
2023-10-21 13:00:03,686 [PID 373] PERFORMANCE  Parsed taint models (models: 1, queries: 0): 10.579s
2023-10-21 13:00:03,687 [PID 373] INFO  Computing inferred models...
2023-10-21 13:00:05,318 [PID 373] PERFORMANCE  Computed inferred models (models: 566): 1.633s
2023-10-21 13:00:05,668 [PID 373] INFO  Computing overrides...
2023-10-21 13:00:08,910 [PID 373] WARNING  `braintree.resource.Resource.__init__` has 70 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,911 [PID 373] WARNING  `google.protobuf.message.Message.ClearField` has 114 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,912 [PID 373] WARNING  `google.protobuf.message.Message.HasField` has 64 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,912 [PID 373] WARNING  `google.protobuf.message.Message.__init__` has 116 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,913 [PID 373] WARNING  `influxdb_client.service._base_service._BaseService.__init__` has 82 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,914 [PID 373] WARNING  `object.__eq__` has 935 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,914 [PID 373] WARNING  `object.__hash__` has 165 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,915 [PID 373] WARNING  `object.__init__` has 3271 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,915 [PID 373] WARNING  `object.__ne__` has 715 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,916 [PID 373] WARNING  `object.__new__` has 51 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,917 [PID 373] WARNING  `object.__reduce__` has 83 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,919 [PID 373] WARNING  `object.__setattr__` has 99 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,919 [PID 373] WARNING  `passlib.utils.handlers.GenericHandler.from_string` has 52 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,920 [PID 373] WARNING  `pika.amqp_object.Method.synchronous` has 66 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,920 [PID 373] WARNING  `type.__call__` has 368 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,921 [PID 373] WARNING  `type.__init__` has 2815 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,924 [PID 373] WARNING  `type.__new__` has 469 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,926 [PID 373] WARNING  `typeshed.typeshed.stubs.pika.pika.amqp_object.Method.synchronous` has 66 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,927 [PID 373] WARNING  `typing.Collection.__len__` has 103 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,927 [PID 373] WARNING  `typing.GenericMeta.__getitem__` has 134 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,928 [PID 373] WARNING  `typing.Iterable.__iter__` has 98 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,929 [PID 373] WARNING  `typing.Iterator.__iter__` has 60 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,929 [PID 373] WARNING  `typing.Iterator.__next__` has 66 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,930 [PID 373] WARNING  `typing.MutableMapping.__delitem__` has 60 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,931 [PID 373] WARNING  `typing.MutableMapping.__setitem__` has 60 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:08,931 [PID 373] WARNING  `typing.NamedTuple.__init__` has 365 overrides, this might slow down the analysis considerably.
2023-10-21 13:00:09,024 [PID 373] PERFORMANCE  Overrides computed: 3.356s
2023-10-21 13:00:09,025 [PID 373] INFO  Indexing global constants...
2023-10-21 13:00:11,226 [PID 373] PERFORMANCE  Finished constant propagation analysis: 2.202s
2023-10-21 13:00:11,227 [PID 373] INFO  Building call graph...
2023-10-21 13:00:12,126 [PID 373] PERFORMANCE  Call graph built: 0.900s
2023-10-21 13:00:12,127 [PID 373] INFO  Computing dependencies...
2023-10-21 13:00:12,258 [PID 373] PERFORMANCE  Computed dependencies: 0.132s
2023-10-21 13:00:12,259 [PID 373] INFO  Purging shared memory...
2023-10-21 13:00:12,310 [PID 373] PERFORMANCE  Purged shared memory: 0.052s
2023-10-21 13:00:12,311 [PID 373] INFO  Purging shared memory...
2023-10-21 13:00:12,332 [PID 373] PERFORMANCE  Purged shared memory: 0.022s
2023-10-21 13:00:12,333 [PID 373] INFO  Analysis fixpoint started for 27365 overrides and 3 functions...
2023-10-21 13:00:16,448 [PID 373] PERFORMANCE  Recorded initial models: 4.115s
2023-10-21 13:00:16,449 [PID 373] INFO  Iteration #0. 2 callables [views.$toplevel, views.operate_on_twos]
2023-10-21 13:00:16,450 [PID 373] INFO  Processed 2 of 2 callables
2023-10-21 13:00:16,450 [PID 373] INFO  Iteration #0, 2 callables, heap size 0.283GB took 0.00s
2023-10-21 13:00:16,451 [PID 373] INFO  Iteration #1. 1 callables [views.operate_on_twos]
2023-10-21 13:00:16,452 [PID 373] INFO  Processed 1 of 1 callables
2023-10-21 13:00:16,453 [PID 373] INFO  Iteration #1, 1 callables, heap size 0.283GB took 0.00s
2023-10-21 13:00:16,453 [PID 373] INFO  Post-processing issues for multi-source rules...
2023-10-21 13:00:16,762 [PID 373] PERFORMANCE  Finished issue post-processing for multi-source rules: 0.310s
2023-10-21 13:00:17,053 [PID 373] INFO  Found 0 issues
2023-10-21 13:00:17,054 [PID 373] PERFORMANCE  Analysis fixpoint complete (iterations: 2, heap size: 283469120, issues: 0): 4.720s
2023-10-21 13:00:17,054 [PID 373] PERFORMANCE  Analyze: 260.473s
[]
draftyfrog commented 1 year ago

Update: it's the same for exercise2 - pysa doesn't find the three issues and just returns an empty array (I added the necessary definitions to the sources_sinks.pysa file).

arthaud commented 12 months ago

Thanks for the report and sorry for the delay. I know what the problem is, I will have a fix soon.

If you don't want to wait: you will need to install django-stubs with pip, then add the line "site_package_search_strategy": "pep561", in the .pyre_configuration file.

arthaud commented 11 months ago

This should be fixed, please re-open this if you still have the issue.

draftyfrog commented 11 months ago

Thanks, I can confirm that it works now! For anybody else coming here with the same issue: Installing django-stubs and running pysa with --no-verify is all I needed to do to make the tutorial work.