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

SMDA backend not passing tests after update #369

Closed
mr-tz opened this issue Nov 30, 2020 · 2 comments
Closed

SMDA backend not passing tests after update #369

mr-tz opened this issue Nov 30, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@mr-tz
Copy link
Collaborator

mr-tz commented Nov 30, 2020

Description

v1.5.5 works fine, see https://github.com/fireeye/capa/runs/1443609568
current version v1.5.8 fails, see https://github.com/fireeye/capa/runs/1475995708

=================================== FAILURES ===================================
_ test_smda_features[kernel32-64-function=0x1800202B0-api(RtlCaptureContext)-True0] _

sample = '/home/runner/work/capa/capa/tests/data/kernel32-64.dll_'
scope = <function resolve_scope.<locals>.inner at 0x7f71f5f822f0>
feature = api(RtlCaptureContext), expected = True

    @parametrize(
        "sample,scope,feature,expected",
        FEATURE_PRESENCE_TESTS,
        indirect=["sample", "scope"],
    )
    def test_smda_features(sample, scope, feature, expected):
        with xfail(sys.version_info < (3, 0), reason="SMDA only works on py3"):
>           do_test_feature_presence(get_smda_extractor, sample, scope, feature, expected)

tests/test_smda_features.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/fixtures.py:476: in do_test_feature_presence
    features = scope(extractor)
tests/fixtures.py:264: in inner
    f = get_function(extractor, va)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

extractor = <capa.features.extractors.smda.SmdaFeatureExtractor object at 0x7f71d4539ef0>
fva = 6442582704

    def get_function(extractor, fva):
        for f in extractor.get_functions():
            if f.__int__() == fva:
                return f
>       raise ValueError("function not found")
E       ValueError: function not found

tests/fixtures.py:228: ValueError
_ test_smda_features[kernel32-64-function=0x1800202B0-api(RtlCaptureContext)-True1] _

sample = '/home/runner/work/capa/capa/tests/data/kernel32-64.dll_'
scope = <function resolve_scope.<locals>.inner at 0x7f71d77237b8>
feature = api(RtlCaptureContext), expected = True

    @parametrize(
        "sample,scope,feature,expected",
        FEATURE_PRESENCE_TESTS,
        indirect=["sample", "scope"],
    )
    def test_smda_features(sample, scope, feature, expected):
        with xfail(sys.version_info < (3, 0), reason="SMDA only works on py3"):
>           do_test_feature_presence(get_smda_extractor, sample, scope, feature, expected)

tests/test_smda_features.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/fixtures.py:476: in do_test_feature_presence
    features = scope(extractor)
tests/fixtures.py:264: in inner
    f = get_function(extractor, va)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

extractor = <capa.features.extractors.smda.SmdaFeatureExtractor object at 0x7f71d4539ef0>
fva = 6442582704

    def get_function(extractor, fva):
        for f in extractor.get_functions():
            if f.__int__() == fva:
                return f
>       raise ValueError("function not found")
E       ValueError: function not found

tests/fixtures.py:228: ValueError
=========================== short test summary info ============================
FAILED tests/test_smda_features.py::test_smda_features[kernel32-64-function=0x1800202B0-api(RtlCaptureContext)-True0]
FAILED tests/test_smda_features.py::test_smda_features[kernel32-64-function=0x1800202B0-api(RtlCaptureContext)-True1]

Should we add version pinning similar to vivisect?

@mr-tz mr-tz added the bug Something isn't working label Nov 30, 2020
@williballenthin
Copy link
Collaborator

yeah, i think we should pin. we should also report regressions upstream.

we may be able to setup dependabot or similar to remind us to attempt to update our deps.

mr-tz added a commit that referenced this issue Dec 1, 2020
addresses #369
@mr-tz mr-tz mentioned this issue Dec 1, 2020
mr-tz added a commit that referenced this issue Dec 1, 2020
addresses #369
@mr-tz
Copy link
Collaborator Author

mr-tz commented Dec 1, 2020

it's already fixed upstream and #370 addresses the version pinning

@mr-tz mr-tz mentioned this issue Dec 1, 2020
@mr-tz mr-tz closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants