Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests fail on Raspberry Pi Debian/Wheezy #5010

Closed
p6rt opened this issue Jan 6, 2016 · 6 comments
Closed

tests fail on Raspberry Pi Debian/Wheezy #5010

p6rt opened this issue Jan 6, 2016 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jan 6, 2016

Migrated from rt.perl.org#127194 (status was 'resolved')

Searchable as RT127194$

@p6rt
Copy link
Author

p6rt commented Jan 6, 2016

From @jonathanstowe

As below​:

t/04-nativecall/02-simple-args.t (Wstat​: 256 Tests​: 13 Failed​: 1)
  Failed test​: 11
  Non-zero exit status​: 1
t/04-nativecall/03-simple-returns.t (Wstat​: 256 Tests​: 11 Failed​: 1)
  Failed test​: 3
  Non-zero exit status​: 1
t/04-nativecall/11-cpp.t (Wstat​: 512 Tests​: 21 Failed​: 2)
  Failed tests​: 1, 18
  Non-zero exit status​: 2
t/04-nativecall/13-union.t (Wstat​: 768 Tests​: 28 Failed​: 3)
  Failed tests​: 2, 15, 24
  Non-zero exit status​: 3

The union one looks like nativesizeof() is not taking the correct byte alignment into account (it looks like it's not taking the padding of the first long in MyStruct, but that may be a concidence.)​:

ok 1 - sizeof union is sizeof biggest member
not ok 2 - sizeof(MyStruct)

# Failed test 'sizeof(MyStruct)'
# at t/04-nativecall/13-union.t line 42
# expected​: '32'
# got​: '28'
ok 3 - getting long
ok 4 - getting num
ok 5 - getting int8
ok 6 - getting num32
ok 7 - getting long from C-created struct
ok 8 - getting num from C-created struct
ok 9 - getting int8 from C-created struct
ok 10 - getting num32 from C-created struct
ok 11 - long in union
ok 12 - int in union
ok 13 - short in union
ok 14 - char in union
not ok 15 - sizeof(MyStruct2)

# Failed test 'sizeof(MyStruct2)'
# at t/04-nativecall/13-union.t line 94
# expected​: '32'
# got​: '28'
ok 16 - getting long from C-created struct
ok 17 - getting num from C-created struct
ok 18 - getting int8 from C-created struct
ok 19 - getting num32 from C-created struct
ok 20 - long in union*
ok 21 - int in union*
ok 22 - short in union*
ok 23 - char in union*
not ok 24 - sizeof(UnionOfStructs)

# Failed test 'sizeof(UnionOfStructs)'
# at t/04-nativecall/13-union.t line 132
# expected​: '32'
# got​: '28'
ok 25 - member a of union is-a MyStruct
ok 26 - member b of union is-a YourStruct
ok 27 - a.byte was set to 42 by C
ok 28 - b.byte must be the same
# Looks like you failed 3 tests of 28

t/04-nativecall/11-cpp.t :

1..21
not ok 1 - sizeof(Derived1)

# Failed test 'sizeof(Derived1)'
# at t/04-nativecall/11-cpp.t line 50
# expected​: '40'
# got​: '36'
ok 2 - can instantiate C++ class
ok 3 - can read attribute foo
ok 4 - can read attribute bar
ok 5 - can read attribute baz
ok 6 - can read attribute cx
ok 7 - can read attribute cy
ok 8 - can read attribute c
ok 9 - sizeof(Derived2)
ok 10 - can instantiate C++ class with vtable
ok 11 - can read attribute foo
ok 12 - can read attribute bar
ok 13 - can read attribute baz
ok 14 - can read attribute cx
ok 15 - can read attribute cy
ok 16 - can read attribute c
ok 17 - can read typed pointer attribute
not ok 18 - can pass arguments to method

# Failed test 'can pass arguments to method'
# at t/04-nativecall/11-cpp.t line 88
# expected​: '21'
# got​: '29692018'
ok 19 - name mangling of parameter `const int`
ok 20 - name mangling of parameter `int *`
ok 21 - name mangling of parameter `const int *`
# Looks like you failed 2 tests of 21

The first failure is also related to the nativesizeof, the second is probably an aligment issue.

t/04-nativecall/03-simple-returns.t :

1..11
ok 1 - returning int works
ok 2 - returning short works
not ok 3 - returning char works

# Failed test 'returning char works'
# at t/04-nativecall/03-simple-returns.t line 18
# expected​: '-103'
# got​: '153'
ok 4 - returning double works
ok 5 - returning float works
ok 6 - returning string works
ok 7 - returning null string pointer
ok 8 - returning int64 works
ok 9 - returning uint8 works
ok 10 - returning uint16 works
ok 11 - returning uint32 works
# Looks like you failed 1 test of 11

This looks like a problem with the unsigned parts.

t/04-nativecall/02-simple-args.t :

1..13
ok 1 - passed int 42
ok 2 - passed two shorts
ok 3 - passed an int32, int16 and int8
ok 4 - passed a double
ok 5 - passed a float
ok 6 - passed a string
ok 7 - checked previously passed string
ok 8 - wrapped sub
ok 9 - passed int64 0xFFFFFFFFFF
ok 10 - passed uint8 0xFE
not ok 11 - passed uint16 0xFFFE

# Failed test 'passed uint16 0xFFFE'
# at t/04-nativecall/02-simple-args.t line 61
# expected​: '11'
# got​: '0'
ok 12 - passed uint8 0xFFFFFFFE
ok 13 - passed size_t 42
# Looks like you failed 1 test of 13

The failing test here it gets -2 in the function (i.e. it is becoming signed.)

Certainly the nativesizeof() problem may militate against being able to use anything more than simple NativeCall bindings on ARM as getting the wrong allocated size may cause a segfault in native code.

@p6rt
Copy link
Author

p6rt commented Oct 9, 2016

From @FROGGS

This issue is fixed if you configure MoarVM with --has-libffi as of today.
(You need of course the libffi-dev package installed.)

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 9, 2016

From @FROGGS

This issue is fixed if you configure MoarVM with --has-libffi as of today.
(You need of course the libffi-dev package installed.)

@p6rt p6rt closed this as completed Oct 9, 2016
@p6rt
Copy link
Author

p6rt commented Oct 9, 2016

@FROGGS - Status changed from 'new' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Oct 10, 2016

From @jonathanstowe

It actually seems to mostly pass now without doing anything specific

The only failure I am seeing now is

jonathan@​canneloni​:~/devel/perl6/rakudo$ install/bin/perl6 t/04-nativecall/02-simple-args.t
1..14
ok 1 - passed int 42
ok 2 - passed two shorts
ok 3 - passed an int32, int16 and int8
ok 4 - passed a double
ok 5 - passed a float
ok 6 - passed a string
ok 7 - checked previously passed string
ok 8 - wrapped sub
ok 9 - passed int64 0xFFFFFFFFFF
ok 10 - passed uint8 0xFE
not ok 11 - passed uint8 0xFFFE

# Failed test 'passed uint8 0xFFFE'
# at t/04-nativecall/02-simple-args.t line 62
# expected​: '11'
# got​: '0'
ok 12 - passed uint8 0xFFFFFFFE
ok 13 - passed size_t 42
ok 14 - passed ssize_t -42
# Looks like you failed 1 test of 14

Let me test with the ffi

On Sun Oct 09 04​:22​:23 2016, FROGGS.de wrote​:

This issue is fixed if you configure MoarVM with --has-libffi as of today.
(You need of course the libffi-dev package installed.)

@p6rt
Copy link
Author

p6rt commented Oct 10, 2016

From @jonathanstowe

Yep, that's all good with the libffi - top work!

All tests successful.
Files=45, Tests=609, 362 wallclock secs ( 1.18 usr 0.21 sys + 347.91 cusr 10.51 csys = 359.81 CPU)
Result​: PASS

On Sun Oct 09 04​:22​:23 2016, FROGGS.de wrote​:

This issue is fixed if you configure MoarVM with --has-libffi as of today.
(You need of course the libffi-dev package installed.)

@p6rt p6rt added the NativeCall label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant