Tony Reix <tony.r...@atos.net> added the comment:

On AIX 7.2, with libffi compiled with -O0 -g, I have:

1) Call to memchr thru memchr_args_hack
#0  0x09000000001b0d60 in memchr () from /usr/lib/libc.a(shr_64.o)
#1  0x09000000058487a0 in ffi_call_DARWIN () from 
/opt/freeware/lib/libffi.a(libffi.so.6)
#2  0x0900000005847eec in ffi_call (cif=0xfffffff, fn=0xffffca90, 
rvalue=0xfffffff, avalue=0xffffca80) at ../src/powerpc/ffi_darwin.c:31
#3  0x09000000058f9900 in ?? ()
#4  0x09000000058ebb6c in ?? ()
#5  0x090000000109fc18 in _PyObject_MakeTpCall () from 
/opt/freeware/lib64/libpython3.8.so

r3             0xa000000003659e0        720575940382841312
r4             0x64     100
r5             0x7      7
(gdb) x/s $r3
0xa000000003659e0:      "abcdef"

2) Call to memchr thru memchr_args_hack2
#0  0x09000000001b0d60 in memchr () from /usr/lib/libc.a(shr_64.o)
#1  0x09000000058487a0 in ffi_call_DARWIN () from 
/opt/freeware/lib/libffi.a(libffi.so.6)
#2  0x0900000005847eec in ffi_call (cif=0xfffffff, fn=0xffffca90, 
rvalue=0xfffffff, avalue=0xffffca80) at ../src/powerpc/ffi_darwin.c:31
#3  0x09000000058f9900 in ?? ()
#4  0x09000000058ebb6c in ?? ()
#5  0x090000000109fc18 in _PyObject_MakeTpCall () from 
/opt/freeware/lib64/libpython3.8.so

r3             0xa000000003659e0        720575940382841312
r4             0x64     100
r5             0x0      0

So, it looks like, when libffi is not compiled with -O but with -O0 -g, that in 
64bit ffi_call_DARWIN() is call in both cases (memchr_args_hack and 
memchr_args_hack2).
However, as seen previously, it was not the case with libffi built with -O .

Moreover, we have in source code:
  switch (cif->abi)
    {
    case FFI_AIX:
      ffi_call_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn,
                   FFI_FN(ffi_prep_args));
      break;
    case FFI_DARWIN:
      ffi_call_DARWIN(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn,
                      FFI_FN(ffi_prep_args), cif->rtype);

Why calling ffi_call_DARWIN instead of ffi_call_AIX ?

Hummm Will rebuild libffi and python both with gcc -O0 -g -gdwarf and look at 
details.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38628>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to