Start gdb python.  Set a breakpoint in the shared module.  continue.

On Sun, Nov 19, 2023 at 1:02 PM Ranjan Maitra via users <users@lists.fedoraproject.org> wrote:
On Sun Nov19'23 05:35:19PM, Barry wrote:
> From: Barry <barry@barrys-emacs.org>
> Date: Sun, 19 Nov 2023 17:35:19 +0000
> To: Community support for Fedora users <users@lists.fedoraproject.org>
 >
> >
> >
> > It is possible that there is a bug in the code itself, but nothing above
> > points to my created code.
> >
> > Any suggestions? Or is this a bug?
>
> Are you using C extensions in your code? If so I would suspect them for corrupting python. I think you can get into gdb inside the core file with coredumpctl debug.

The python code calls a shared object library that is written in C. But
why does this core dump only happen in F39 (python 3.12) and not with
F38 (python 3.11)?

> What does “info shared” tell you about what code has been loaded into memory?

This would be under gdb, I presume.


> It is also worth trying to find the type of the object that is being deleted, _PyObject_Free will have pointer to the object.
> Also not sure where siplib.c is from is it python or an extension?

Thanks, I don't know either, but there is no siplib.c anywhere on either
of my two systems.

> I am assuming here that you are familiar with debugging with gdb.

Thanks, I am familiar with using gdb for a C program, never used it with
python code calling a C shared object.

I tried:

$ gdb python "./test.py ultadanga.tiff ultadanga-64-rgb.png 1 7"
GNU gdb (Fedora Linux) 13.2-10.fc39
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.fedoraproject.org/>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Reading symbols from /home/localuser/.cache/debuginfod_client/07023eb4f297ae1d4591e--Type <RET> for more, q to quit, c to continue without paging--
c808ab20b2788c542be/debuginfo...
./test.py ultadanga.tiff ultadanga-64-rgb.png 1 7: No such file or directory.
(gdb)


Not quite sure how to proceed here.

Many thanks again, and best wishes,
Ranjan

--
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue


--
Those who don't understand recursion are doomed to repeat it