Bug 2236684 - Vim-9.0.1822 Perl module segfaults in S_parse_gv_stash_name()
Summary: Vim-9.0.1822 Perl module segfaults in S_parse_gv_stash_name()
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-09-01 08:34 UTC by Zdenek Dohnal
Modified: 2023-09-05 13:24 UTC (History)
13 users (show)

Fixed In Version: vim-9.0.1872-1.fc40
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-05 13:08:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Full backtrace (13.04 KB, text/plain)
2023-09-01 08:41 UTC, Zdenek Dohnal
no flags Details
perl -V from Fedora 40, manually built (2.82 KB, text/plain)
2023-09-01 08:42 UTC, Zdenek Dohnal
no flags Details
perl -V - shipped in Ubuntu (10.20 KB, text/plain)
2023-09-01 08:43 UTC, Zdenek Dohnal
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github vim/vim/commit/7a9d1aa878d8724e28893b968016b86a3a70c63f 0 None None None 2023-09-05 13:24:20 UTC

Description Zdenek Dohnal 2023-09-01 08:34:52 UTC
Vim upstream fixed issue with dynamic Perl load in https://github.com/vim/vim/commit/55460da26c2756ec057c03c7d8641eda861bfcd2 - previously Perl was dynamically linked with VIm, which ended up with Vim depending on perl-libs, which was unintentional.

Since the new patchlevel Vim started to segfault when perl module is used. The segfault happens with Perl in all current Fedora releases (F37+).

I've tried to compile Perl 5.38 by myself from upstream tarball and segfault disappeared. The issue is not present in Ubuntu either (compiled upstream Vim with their local Perl).

I'll attach 'perl -V' from my compilation (Fedora 40) and from Ubuntu 23.04, and backtrace from Fedora 40 with packaged Perl.

Reproducible: Always

Steps to Reproduce:
$ sudo dnf -y install https://kojipkgs.fedoraproject.org//packages/vim/9.0.1822/1.fc40/noarch/vim-data-9.0.1822-1.fc40.noarch.rpm https://kojipkgs.fedoraproject.org//packages/vim/9.0.1822/1.fc40/noarch/vim-filesystem-9.0.1822-1.fc40.noarch.rpm https://kojipkgs.fedoraproject.org//packages/vim/9.0.1822/1.fc40/x86_64/vim-common-9.0.1822-1.fc40.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/vim/9.0.1822/1.fc40/x86_64/vim-enhanced-9.0.1822-1.fc40.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/vim/9.0.1822/1.fc40/x86_64/vim-minimal-9.0.1822-1.fc40.x86_64.rpm
$ sudo dnf -y install perl-devel
$ vim -c 'perl print 'hello'' -c 'q!'
Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault (core dumped)
Actual Results:  
Segfault

Expected Results:  
No segfault, return value 0

Comment 1 Zdenek Dohnal 2023-09-01 08:41:38 UTC
Created attachment 1986524 [details]
Full backtrace

Comment 2 Zdenek Dohnal 2023-09-01 08:42:50 UTC
Created attachment 1986525 [details]
perl -V from Fedora 40, manually built

Comment 3 Zdenek Dohnal 2023-09-01 08:43:31 UTC
Created attachment 1986526 [details]
perl -V - shipped in Ubuntu

Comment 4 Zdenek Dohnal 2023-09-01 08:47:54 UTC
In case you would like to try building Vim from upstream, here are steps (in Fedora 40 virtual machine from tmt):

# dnf -y install libtool git-core
# dnf download --source vim
# dnf -y builddep *.src.rpm
# git clone https://github.com/vim/vim
# cd vim
# make distclean && export CFLAGS=""; export CFLAGS="$CFLAGS -fPIC -fPIE"; ./configure --enable-perlinterp=dynamic --with-x=no --enable-gui=no && make && ./src/vim -c 'perl print 'hello'' -c 'q!'

Comment 5 Jitka Plesnikova 2023-09-01 09:00:54 UTC
Thanks for the report. I can reproduce the issue.
I look at it.

Comment 6 Zdenek Dohnal 2023-09-05 13:08:13 UTC
Perl works with the newest Vim patchlevel.

Comment 7 Zdenek Dohnal 2023-09-05 13:09:07 UTC
The current CI run still fails, but no due Perl https://artifacts.dev.testing-farm.io/79be01d0-25f2-4b02-be54-27983d6e8b82/ .


Note You need to log in before you can comment on or make changes to this bug.