python3.9: has_function not working for Visual Studio 2017 build

Open
#165 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, python
Domain
build-system

Research direction

Start with setup.py around line 224 and reproduce the failure using python.exe setup.py build on the stated Python 3.9, Windows 10, and Visual Studio 2017 setup. Investigate the memmem and strlcpy detection that generates memmem%RANDOM%.c; done means the build no longer fails with WinError 1 while preserving the intended detection behavior.

Written by the indexing model from the issue text.

Description

Mainly informational

Tested with yara-python 4.0.4 and Python 3.9 on Windows 10 with Visual Studio 2017

Running: python.exe setup.py build fails with error: [WinError 1] Incorrect function

Unfortunately this appears to be a very generic error. Seeing the previous line reference memmem%RANDOM%.c this is likely related to the use of memmem. The same applies to strlcpy.

Removing memmem and strlcpy detection from setup.py https://github.com/VirusTotal/yara-python/blob/924c8161d419725a36a5f0f021d9a47521b104e2/setup.py#L224 resolves the issue.

Dominant language
C
Stars
754
Forks
190
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VirusTotal/yara-python

All issues in VirusTotal/yara-python

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.