public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* libffi on PowerPC/AIX: aix_closure.S failure
@ 2012-02-27 10:40 chennam
  2012-03-07 14:43 ` chennam
  0 siblings, 1 reply; 3+ messages in thread
From: chennam @ 2012-02-27 10:40 UTC (permalink / raw)
  To: libffi-discuss


Hi all,

I am running libffi 3.0.11 on PowerPC/AIX 6.1. 
The host is 64 bits, but the targeted libffi.a to generate is 32 bits (as
for our need).
The downloaded package has been compiled with GCC v4.6.2 with the following
options:

<--------------------------------------------------------------------------------------------------------------
export CFLAGS="-DAIX -DPOWERPC_AIX -maix32 -maix-struct-return -mxl-compat"
export LDFLAGS="-lc128 -lc -lm -lpthread -g"
export AR="ar -X32_64"

./configure --enable-debug --disable-shared --with-pic --enable-threads
make
make check
……
      === libffi Summary ===

      # of expected passes          813
      # of unexpected failures      423
      # of unsupported tests        55
-------------------------------------------------------------------------------------------------------------->

After some investigation of the failed tests, it appears that all failures
are related to closure calls of a function. I have isolated the test case
“testclosure.c” by adding in some trace messages to trace the related
function calls. Here is the result:

<--------------------------------------------------------------------------------------------------------------
PASS: libffi.call/testclosure.c -O0 -W -Wall (test for excess errors)
Setting LD_LIBRARY_PATH to .::
/freeware/libffi/powerpc-ibm-aix6.1.0.0/testsuite/../.libs
:.:: /freeware/libffi/powerpc-ibm-aix6.1.0.0/testsuite/../.libs
spawn [open ...]

main: calling ffi_closure_alloc()
main: FFI_TRAMPOLINE_SIZE=12, ffi_aix_trampoline_struct size=12
main: calling ffi_prep_cif()
main: calling ffi_prep_closure_loc()
ffi_prep_closure_loc(): FFI_AIX:
main: calling code()
ffi_closure_helper_DARWIN(): avn=1, arg_types[0]=13
ffi_closure_helper_DARWIN(): calling closure->fun
   cls_strcut_combined_gn: calling cls_struct_combined_fn()
   4 5 1 8
   cls_strcut_combined_gn: exit
ffi_closure_helper_DARWIN(): return from closure->fun. rtype=0

FAIL: libffi.call/testclosure.c -O0 -W -Wall execution test
-------------------------------------------------------------------------------------------------------------->

i.e. In testclosure.c
….
fprintf(stdout, "main: calling code() \n");   fflush(stdout);
((void(*)(cls_struct_combined)) (code))(g_dbl);
fprintf(stdout, "main: exit \n");   fflush(stdout);
exit(0);


(code) has the assembly code to call ffi_closure_helper_DARWIN(), which
calls cls_struct_combined_gn()
cls_struct_combined_gn() runs correctly and returns to
ffi_closure_helper_DARWIN(), which then returns to the calling assembly
code.
Then the failure occurs.  So I presume the failure occurs within the
aix_closure.S

I know nothing about PowerPC assembly code, so this is the lowest level of
tracing I can have.
Has anybody ever run successfully all test cases on PowerPC/AIX ?

Thanks for your attention.

P.S

BTW, it appear that aix.S works perfectly, since all ffi_call_AIX run
without any problem.
The behaviour is the same when I use libffi 3.0.10

-- 
View this message in context: http://old.nabble.com/libffi-on-PowerPC-AIX%3A-aix_closure.S-failure-tp33398886p33398886.html
Sent from the Sourceware - libffi-discuss mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libffi on PowerPC/AIX: aix_closure.S failure
  2012-02-27 10:40 libffi on PowerPC/AIX: aix_closure.S failure chennam
@ 2012-03-07 14:43 ` chennam
  2012-03-08 11:03   ` chennam
  0 siblings, 1 reply; 3+ messages in thread
From: chennam @ 2012-03-07 14:43 UTC (permalink / raw)
  To: libffi-discuss


Hi Anthony,

In my previous mail, I stated that aix_clsure.S produces core dump during
the tests.
After some investigation, I fixed an error in it: it is a braching error
after control is returned from
ffi_closure_helper_DARWIN(). Now the summery of test result is 

		=== libffi Summary ===

# of expected passes		1198
# of unexpected failures	398
# of unsupported tests	55

The majority  of the failed tests always have something like FAIL: ...
*output pattern test* ... 
PASS: libffi.call/testclosure.c -O2 -maix32 -fomit-frame-pointer (test for
excess errors)
PASS: libffi.call/testclosure.c -O2 -maix32 -fomit-frame-pointer execution
test
FAIL: libffi.call/testclosure.c -O2 -maix32 -fomit-frame-pointer output
pattern test, is 1.08484e-19 4.40403e-10 1.08478e-19 0
, should match 4 5 1 8

Not sure what it is about. I presume there still remain some bugs to fix. Do
you have an idea where the tests is carried out and where I should look for
? 

http://old.nabble.com/file/p33458466/libffi.log libffi.log 
-- 
View this message in context: http://old.nabble.com/libffi-on-PowerPC-AIX%3A-aix_closure.S-failure-tp33398886p33458466.html
Sent from the Sourceware - libffi-discuss mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libffi on PowerPC/AIX: aix_closure.S failure
  2012-03-07 14:43 ` chennam
@ 2012-03-08 11:03   ` chennam
  0 siblings, 0 replies; 3+ messages in thread
From: chennam @ 2012-03-08 11:03 UTC (permalink / raw)
  To: libffi-discuss


With the last fix posted by "David Edelsohn-3", all is back to normal again.

		=== libffi Summary ===

# of expected passes		1643
# of unexpected failures	8
# of unsupported tests	55

on both ppc32/aix6.1 and  ppc64/aix6.1
for both v3.0.10 & 3.0.11

Thanks Dave



-- 
View this message in context: http://old.nabble.com/libffi-on-PowerPC-AIX%3A-aix_closure.S-failure-tp33398886p33464226.html
Sent from the Sourceware - libffi-discuss mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-08 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 10:40 libffi on PowerPC/AIX: aix_closure.S failure chennam
2012-03-07 14:43 ` chennam
2012-03-08 11:03   ` chennam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).