engine icon indicating copy to clipboard operation
engine copied to clipboard

[Windows] Running tests

Open sfhacker opened this issue 1 year ago • 9 comments

Hi.

We are new to this project and have just built master branch from source on Windows 10 x64. While running tests one of them is failing. No idea how to debug/troubleshoot this issue. Any pointers would be greatly appreciated. Cheers.

image

All other tests are ok. For example:

image

image

sfhacker avatar Apr 07 '23 12:04 sfhacker

Do I correctly understand that you use Linux subsystem on Windows? Which OpenSSL version do you use? Could you please provide a stack trace of the segfault?

beldmit avatar Apr 07 '23 12:04 beldmit

Thanks for your prompt response (and in English language!). No Linux subsystem, thank you very much!

image

We have already provided a stack trace.

Thanks again.

sfhacker avatar Apr 07 '23 13:04 sfhacker

evp_cipher_init_internal (where the SEGFAULT happens) is internal OpenSSL function. So the problem look to be present in OpenSSL (or in the engine tests). I kindly ask you to build OpenSSL (and gost engine/provider) with debug info to get more information from the stack trace.

The upstream behaviour was recently fixed by https://github.com/openssl/openssl/pull/20662, could you please check that you have this fix in your build tree? If it is present and the issue is still reproducible, I'd recommend raise it against OpenSSL.

beldmit avatar Apr 07 '23 14:04 beldmit

Pardon my ignorance, but what is the difference between an engine and a provider? Why do we need both at the same time? That bizarre thing seems to cause more problems than benefits (see, for instance, #18487).

We will continue debugging/troubleshooting further and report here.

Cheers.

sfhacker avatar Apr 07 '23 20:04 sfhacker

Well. There was an engine I have been maintaining for ages and now there is also a provider which unfortunately isn't as capable as engine was because I don't have enough capacity now

beldmit avatar Apr 07 '23 21:04 beldmit

If, for whatever reason, BOTH the engine and the provider are enabled (or active), a segmentation fault is thrown! (See here). Is it possible to refactor the code and 'merge' (or conflate) both into one? The 'gost_prov.c' file is using/calling code from 'eng_prov.c' file. Even though it is/tries to be a wrapper, it smells!. If ONLY the provider is enabled, then almost all tests fail. The test files in this repo (e.g. test_digest, etc), are they engine tests only?

You failed to answer/explain the question/difference between them. Anyway, that's ok.

Regarding the failing test posted here, I have built OpenSSL master branch from source 'in debug mode' and this the backtrace:

image

We know nothing about this project as to understand what is going on here! It looks like Russian language! Any ideas/hints how I can further troubleshoot this issue?

Thanks in advance.

sfhacker avatar Apr 08 '23 05:04 sfhacker

Currently you don't have any reasons to use GOST engine and provider together. The engine is enough.

In future there are chances that someone (probably me) will rewrite it to provider model completely. Patches are strongly welcome.

beldmit avatar Apr 08 '23 07:04 beldmit

More testing (and gratis!) ...

  • test_sign

image

Any ideas?

By the way, which version number is master branch at? 1.0? 3.0.4-dev?

sfhacker avatar Apr 09 '23 09:04 sfhacker

No ideas. What do you use, engine or provider? Looks like it tries to go the provider way

beldmit avatar Apr 09 '23 12:04 beldmit