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

25391ac broke llvm-mingw x86_64 #24184

Open
Andarwinux opened this issue Apr 18, 2024 · 13 comments · May be fixed by #24192
Open

25391ac broke llvm-mingw x86_64 #24184

Andarwinux opened this issue Apr 18, 2024 · 13 comments · May be fixed by #24192
Assignees
Labels
branch: master Merge to master branch severity: regression The issue/pr is a regression from previous released version triaged: bug The issue/pr is/fixes a bug
Milestone

Comments

@Andarwinux
Copy link

Crash when using mpv to access https via ffmpeg(--enable-openssl)

Backtrace:
mpv.txt

Fixed this with git revert --no-edit 25391ac

@Andarwinux Andarwinux added the issue: bug report The issue was opened to report a bug label Apr 18, 2024
@tom-cosgrove-arm
Copy link
Contributor

The commit is from #23997 (to have the back-link here)

@t8m t8m added branch: master Merge to master branch triaged: bug The issue/pr is/fixes a bug severity: regression The issue/pr is a regression from previous released version and removed issue: bug report The issue was opened to report a bug labels Apr 18, 2024
@t8m t8m added this to the 3.4.0 milestone Apr 18, 2024
@t8m
Copy link
Member

t8m commented Apr 18, 2024

@Sashan I think there is missing .previous in ecp_nistz256-x86_64.pl before line 4739

Sashan added a commit to Sashan/openssl that referenced this issue Apr 18, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .previous. The lack of .previous makes mingw compiler to put code
into read only section. The exception is raised as soon as CPU attempts to execute
the code from read only section.

Fixes openssl#24184
@Sashan Sashan linked a pull request Apr 18, 2024 that will close this issue
@Sashan
Copy link
Contributor

Sashan commented Apr 18, 2024

I'm sorry about that. I think @t8m is right. I'm going to take a look into it and hopefully get back with fix soon. If you need to get unstuck either blackout the change (as you did) or build with no-asm option.

@Sashan
Copy link
Contributor

Sashan commented Apr 18, 2024

@Andarwinux would you be able to share ecp_nistz256-x86_64.asm (eventually ecp_nistz256-x86_64.[sS]) file from your openssl build? The file is generated at build time. You should find it in crypto\ec directory. Also output of command perl.exe configdata.pm --dump which dumps your openssl build configuration. thanks a lot for your help.

@Andarwinux
Copy link
Author

Andarwinux commented Apr 18, 2024

perl-dump-master.txt
perl-dump-pr24192.txt
ecp_nistz256-x86_64.s-master.txt
ecp_nistz256-x86_64.s-pr24192.txt
This was cross-built on Linux host, and although the compiler name is gcc, it's actually a wrapper script for clang. My script has some hacks to speed up building, such as append -O0 around the build system during configure.

Sashan added a commit to Sashan/openssl that referenced this issue Apr 18, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
@Sashan
Copy link
Contributor

Sashan commented Apr 19, 2024

@Andarwinux can you give a try to one-liner change in pull request here:
https://github.com/openssl/openssl/pull/24192/files

thank you very much.

@Andarwinux
Copy link
Author

@Andarwinux can you give a try to one-liner change in pull request here: https://github.com/openssl/openssl/pull/24192/files

thank you very much.

Sorry for the late reply, unfortunately #24192 does not fixes the problem. Just a .text at ecp_nistz256-x86_64.s line 2376, and the backtrace makes no difference.

@Sashan
Copy link
Contributor

Sashan commented Apr 19, 2024

@Andarwinux can you give a try to one-liner change in pull request here: https://github.com/openssl/openssl/pull/24192/files
thank you very much.

Sorry for the late reply, unfortunately #24192 does not fixes the problem. Just a .text at ecp_nistz256-x86_64.s line 2376, and the backtrace makes no difference.

can you attach ecp_nistz256-x86_64.s which Is created with fixed file? the issue might be hiding in crypto/perlasm/x86_64-xlate.pl This is the script which modifies output of ecp_nistz256-x86_64.pl depending on your build configuration. Therefore I prefer to obtain also .s file so I can compare the results and see where to look for bug. Thanks a lot.

@Andarwinux
Copy link
Author

@Andarwinux can you give a try to one-liner change in pull request here: https://github.com/openssl/openssl/pull/24192/files
thank you very much.

Sorry for the late reply, unfortunately #24192 does not fixes the problem. Just a .text at ecp_nistz256-x86_64.s line 2376, and the backtrace makes no difference.

can you attach ecp_nistz256-x86_64.s which Is created with fixed file? the issue might be hiding in crypto/perlasm/x86_64-xlate.pl This is the script which modifies output of ecp_nistz256-x86_64.pl depending on your build configuration. Therefore I prefer to obtain also .s file so I can compare the results and see where to look for bug. Thanks a lot.

ecp_nistz256-x86_64.s-pr24192.txt
perl-dump-pr24192.txt
x86_64-xlate.pl-pr24192.txt
openssl-build.tar.xz.zip

Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 19, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
@Andarwinux
Copy link
Author

I recommend using https://github.com/msys2/setup-msys2, its clang64 environment is exactly the same as mine.

Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 20, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 21, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 21, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 21, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
@Sashan
Copy link
Contributor

Sashan commented Apr 21, 2024

@Andarwinux thanks for link I'll take a look. I'm struggling with github workflows. I was trying to get openssl unit tests working in CYGWIN on windows. I've managed to sort out unix vs. dos line terminators. but there seems to be lot of friction in runtime part. more time will be required. I'll look at your msys2 if I'll be able to get it working with openssl build.

there is another commit in my pull request. it is a fix to x86_64-xlate.pl script. it should hopefully fix the assembly file for ecp_nistz256-x86_64.s. Will appreciate if you will be able to try it. thanks for help.

@Andarwinux
Copy link
Author

Andarwinux commented Apr 21, 2024

there is another commit in my pull request. it is a fix to x86_64-xlate.pl script. it should hopefully fix the assembly file for ecp_nistz256-x86_64.s. Will appreciate if you will be able to try it. thanks for help.

I can confirm that this commit fixed the crash problem. Thank you!

@Sashan
Copy link
Contributor

Sashan commented Apr 21, 2024

thank you very much for quick testing. I still have to figure out how to run tests for mingw/cygwin bits, so that type of glitch can be discovered earlier.

Sashan added a commit to Sashan/openssl that referenced this issue Apr 22, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 22, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sashan added a commit to Sashan/openssl that referenced this issue Apr 23, 2024
The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes openssl#24184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch severity: regression The issue/pr is a regression from previous released version triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants