On Thu, May 15, 2025 at 01:26:16AM -0400, Nikolaos Chatzikonstantinou wrote:
> > $ python
> > Python 3.13.3 (main, Apr 22 2025, 00:00:00) [GCC 15.0.1 20250418 (Red Hat 
> > 15.0.1-0)] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import pygnuregex
> > >>> pygnuregex.compile(b"a")
> > Segmentation fault (core dumped)
> > (.venv)
> 
> Someone else on a forum helped me debug this. He noticed that the
> Python pointer was different from the one received by the underlying C
> function (by printing the Python pointer and inspecting the C pointer
> with gdb). In fact it was truncated to 32 bits. We eventually
> brainstormed that it was because I had neglected to add the argument
> types for the C functions. I'm not sure why there is a difference in
> Python 3.10 (where I verified the crash in a VM) versus Python 3.11.

I was testing with Python 3.13, not 3.10, but I can confirm that your
latest fix finally solves it.

> 
> At any rate, please update to v0.6.4 and you should be able to proceed.

Next issue: calling include on a file that uses divert messes up
interactive mode (here, using => to prefix lines I typed into m4):

$ cat foo.tmp
divert(-1)
define(`a',`b')
$ m4
=> include(foo.tmp)
=> divert

=> a
b
=> m4exit
$ m4p
=> include(foo.tmp)
=> divert
=> a
=> m4exit
=> ^D

b
$

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


Reply via email to