Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1829702 - gdb fails to build with Python 3.9: Segmentation fault in selftest
Summary: gdb fails to build with Python 3.9: Segmentation fault in selftest
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Keith Seitz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F33FTBFS PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-04-30 07:04 UTC by Miro Hrončok
Modified: 2020-06-06 05:42 UTC (History)
9 users (show)

Fixed In Version: gdb-9.1-8.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-05 23:13:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-04-30 07:04:05 UTC
gdb fails to build with Python 3.9.0a6.

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.fPPqBt
+ umask 022
+ cd /builddir/build/BUILD
+ cd gdb-9.1
+ cd build-x86_64-redhat-linux-gnu
+ cd gdb
+ make run 'GDBFLAGS=-batch -ex "maintenance selftest"'
./gdb --data-directory=`pwd`/data-directory -batch -ex "maintenance selftest"
make: *** [Makefile:2063: run] Segmentation fault (core dumped)

I was able to build it --without python --without testsuite.

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01357213-gdb/

For all our attempts to build gdb with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/gdb/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Kevin Buettner 2020-05-02 06:46:09 UTC
I'll look into it.

Comment 2 Miro Hrončok 2020-05-11 10:31:36 UTC
Side note: We can temporarily build gdb --without python to workaround this problem.

Comment 3 Kevin Buettner 2020-05-11 13:42:03 UTC
Sorry for the delay - I plan to look into this problem this week.

Comment 4 Kevin Buettner 2020-05-16 00:08:12 UTC
I'm trying to reproduce this locally via the following command:

mock -r fedora-rawhide-python39 --enablerepo=local gdb-9.1-6.fc33.src.rpm

But I'm not getting very far.  I'm seeing the following problem:

...
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1586995200
Wrote: /builddir/build/SRPMS/gdb-9.1-6.fc33.src.rpm
No matches found for the following disable plugin patterns: local, spacewalk
Copr repo for python3.9 owned by @python         13 kB/s | 3.0 kB     00:00    
fedora                                           30 kB/s |  11 kB     00:00    
fedora                                          2.1 MB/s | 5.8 MB     00:02    
local                                            23 kB/s | 3.8 kB     00:00    
Package rpm-libs-4.15.90-0.git14971.12.fc33.x86_64 is already installed.
Error: 
 Problem 1: package texlive-collection-latexrecommended-9:svn54074-21.fc33.noarch requires texlive-fancyvrb, but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-20.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-21.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-20.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-21.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-20.fc33.noarch
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-21.fc33.noarch
 Problem 2: package texinfo-tex-6.7-7.fc33.x86_64 requires tex(tex), but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-20.fc33.noarch requires dvipdfmx, but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-20.fc33.noarch requires texlive-dvipdfmx, but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-21.fc33.noarch requires dvipdfmx, but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-21.fc33.noarch requires texlive-dvipdfmx, but none of the providers can be installed
  - package texlive-dvipdfmx-7:20200327-2.fc33.x86_64 requires texlive-xetex, but none of the providers can be installed
  - package texlive-xetex-7:20200327-2.fc33.x86_64 requires texlive-l3kernel, but none of the providers can be installed
  - package texlive-l3kernel-9:svn54672-20.fc33.noarch requires tex(fancyvrb.sty), but none of the providers can be installed
  - package texlive-l3kernel-9:svn54672-21.fc33.noarch requires tex(fancyvrb.sty), but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-20.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-21.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-20.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-21.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-20.fc33.noarch
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-21.fc33.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Finish: build setup for gdb-9.1-6.fc33.src.rpm
Finish: build phase for gdb-9.1-6.fc33.src.rpm
ERROR: Exception(gdb-9.1-6.fc33.src.rpm) Config(fedora-rawhide-python39) 2 minutes 58 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-python39/result
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M ab5337df2f8d4321a313def2cbc9b6d2 -D /var/lib/mock/fedora-rawhide-python39-bootstrap/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.mbyl_1vs:/etc/resolv.conf --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/var/lib/mock/fedora-rawhide-python39/root/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=C.UTF-8 --setenv=LC_MESSAGES=C.UTF-8 /usr/bin/dnf builddep --installroot /var/lib/mock/fedora-rawhide-python39/root/ --releasever 33 --enablerepo local --setopt=deltarpm=False --allowerasing --disableplugin=local --disableplugin=spacewalk --disableplugin=local --disableplugin=spacewalk /var/lib/mock/fedora-rawhide-python39/root//builddir/build/SRPMS/gdb-9.1-6.fc33.src.rpm --setopt=tsflags=nocontexts
No matches found for the following disable plugin patterns: local, spacewalk
Copr repo for python3.9 owned by @python         13 kB/s | 3.0 kB     00:00    
fedora                                           30 kB/s |  11 kB     00:00    
fedora                                          2.1 MB/s | 5.8 MB     00:02    
local                                            23 kB/s | 3.8 kB     00:00    
Package rpm-libs-4.15.90-0.git14971.12.fc33.x86_64 is already installed.
Error: 
 Problem 1: package texlive-collection-latexrecommended-9:svn54074-21.fc33.noarch requires texlive-fancyvrb, but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-20.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-21.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-20.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-21.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-20.fc33.noarch
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-21.fc33.noarch
 Problem 2: package texinfo-tex-6.7-7.fc33.x86_64 requires tex(tex), but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-20.fc33.noarch requires dvipdfmx, but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-20.fc33.noarch requires texlive-dvipdfmx, but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-21.fc33.noarch requires dvipdfmx, but none of the providers can be installed
  - package texlive-collection-basic-9:svn54186-21.fc33.noarch requires texlive-dvipdfmx, but none of the providers can be installed
  - package texlive-dvipdfmx-7:20200327-2.fc33.x86_64 requires texlive-xetex, but none of the providers can be installed
  - package texlive-xetex-7:20200327-2.fc33.x86_64 requires texlive-l3kernel, but none of the providers can be installed
  - package texlive-l3kernel-9:svn54672-20.fc33.noarch requires tex(fancyvrb.sty), but none of the providers can be installed
  - package texlive-l3kernel-9:svn54672-21.fc33.noarch requires tex(fancyvrb.sty), but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-20.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-fancyvrb-9:svn53392-21.fc33.noarch requires tex(pstricks.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-20.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - package texlive-pstricks-9:svn54080-21.fc33.noarch requires tex(biblatex.sty), but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-20.fc33.noarch
  - nothing provides biber >= 2.14 needed by texlive-biblatex-9:svn53063-21.fc33.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Any thoughts on how to proceed?

Comment 5 Miro Hrončok 2020-05-16 07:56:28 UTC
Disable the documentation build for debugging purposes?

The texlive stack is broken in rawhide, nothing we can do about it but wait. See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/EKASW5ECAQTFU43KDZHZPERDLLNGIELB/

Comment 6 Kevin Buettner 2020-05-21 08:14:58 UTC
Just an update...

I've reproduced the problem.

There appears to be a problem with GDB calling PyEval_ReleaseLock() during initialization.

Documentation indicates that this function has been deprecated since 3.2, so that could be part of the problem.

I'm working on a fix.

Comment 7 Miro Hrončok 2020-05-21 08:18:38 UTC
Thanks for the update. As a side note, 3.9.0b1 is out (this problem remains).

Comment 8 Miro Hrončok 2020-05-21 21:23:18 UTC
I am going to temporarily disable the Python support in gdb now and build it in the f33-python target.
If you fix this, please don't build it yet.

Comment 9 Kevin Buettner 2020-05-21 21:53:51 UTC
(In reply to Miro Hrončok from comment #8)
> I am going to temporarily disable the Python support in gdb now and build it
> in the f33-python target.
> If you fix this, please don't build it yet.

Okay, understood.  When I have a fix, I'll check here first before doing anything.

Comment 10 Kevin Buettner 2020-05-21 22:02:07 UTC
Do you know of working programs (i.e. working with Python 3.9) that have embedded python support?  If so, I'd like to know what they are so that I can see how they handle the python GIL.

Comment 11 Miro Hrončok 2020-05-21 22:18:13 UTC
I haven't actually run anything myself, but there are successful builds in copr for libreoffice, nbdkit, swift-lang, uwsgi, krita, postgresql, samba, kig, calamares, fontforge... I hope at least some of them have reasonable covered tests in %check.

Inspiration: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/IAIUO5XU54FQM64TDXWF4YMHHWGQFNXT/


For guidance, you could also also ask Victor Stinner if you have specific questions about handling the GIL.

Comment 12 Miro Hrončok 2020-05-22 11:48:28 UTC
(In reply to Kevin Buettner from comment #9)
> (In reply to Miro Hrončok from comment #8)
> > I am going to temporarily disable the Python support in gdb now and build it
> > in the f33-python target.
> > If you fix this, please don't build it yet.
> 
> Okay, understood.  When I have a fix, I'll check here first before doing
> anything.

When you have the fix, you can re-enable Python and build it with:

    $ fedpkg build --target=f33-python

Comment 14 Miro Hrončok 2020-05-25 13:02:30 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.


The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 15 Kevin Buettner 2020-05-28 19:57:49 UTC
It's fixed now in GDB's upstream master...

https://sourceware.org/pipermail/gdb-patches/2020-May/169110.html

How soon do you need it in Fedora?

I'd like to rebase against upstream master, but that'll take a while; if you need it sooner, I can backport this one patch.

Comment 16 Miro Hrončok 2020-05-28 21:03:26 UTC
I don't think other packages use the gdb Python integration, so this is not blocking anything.

Comment 17 Miro Hrončok 2020-05-29 07:12:13 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 18 Victor Stinner 2020-06-01 15:50:35 UTC
FYI a similar bug different issue was reported to Python upstream: https://bugs.python.org/issue40826 Crash in the REPL. It's also related to PyOS_InterruptOccurred() which must be called with the GIL held.

I checked: PyOS_InterruptOccurred() must be called with the GIL held since Python 3.8. But previously, it was possible to call it without the GIL held if SIGINT signal was no received.

Comment 19 Keith Seitz 2020-06-05 23:13:03 UTC
I am pushing a new build with the patch which should fix this package.
Let me know if this is still a problem.

Comment 20 Miro Hrončok 2020-06-06 05:42:13 UTC
Thank You, Keith.


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