Skip to content

Fix "cannot find the function: strcpy()" error on arm32 on Travis CI.#2686

Merged
nurse merged 1 commit into
ruby:masterfrom
junaruga:hotfix/travis-ci-arm32
Dec 5, 2019
Merged

Fix "cannot find the function: strcpy()" error on arm32 on Travis CI.#2686
nurse merged 1 commit into
ruby:masterfrom
junaruga:hotfix/travis-ci-arm32

Conversation

@junaruga

@junaruga junaruga commented Nov 21, 2019

Copy link
Copy Markdown
Member

This PR is pointed out from https://bugs.ruby-lang.org/issues/16234#note-25 .

This PR fixes the failure in Travis CI arm32.
So, I remove arm32 case from allow_failures.

Here is the example of the issue.
https://travis-ci.org/ruby/ruby/jobs/611483288#L3018

/home/travis/build/ruby/ruby/build/.ext/common/fiddle/import.rb:299:in `import_function': cannot find the function: strcpy() (Fiddle::DLError)

This issue happened when libc.so and libm.so path were not found
and ldd ruby command also failed to print the shared dependencies
in test/fiddle/helper.rb.

I set libc6:armhf as a installing dependency explicitly.

The Travis is succeeded at my forked repository.
https://travis-ci.org/junaruga/ruby/builds/615088201

This issue happened when `libc.so` and `libm.so` path were not found
and `ldd ruby` command also failed to print the shared dependencies
in `test/fiddle/helper.rb`.

See https://travis-ci.org/ruby/ruby/jobs/611483288#L3018
/home/travis/build/ruby/ruby/build/.ext/common/fiddle/import.rb:299:in `import_function': cannot find the function: strcpy() (Fiddle::DLError)

* Set libc6:armhf as a installing dependency explicitly.
* Remove arm32 from allow_failures.
@nurse nurse merged commit c0d118f into ruby:master Dec 5, 2019
shyouhei added a commit to shyouhei/ruby that referenced this pull request Jan 23, 2020
The same as ruby#2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack below does not work.
matzbot pushed a commit that referenced this pull request Jan 24, 2020
The same as #2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack implemented some lines
below does not work.
nobu pushed a commit to nobu/fiddle that referenced this pull request Apr 29, 2020
The same as ruby/ruby#2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack implemented some lines
below does not work.
nobu pushed a commit to nobu/fiddle that referenced this pull request Apr 29, 2020
The same as ruby/ruby#2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack implemented some lines
below does not work.
kou pushed a commit to ruby/fiddle that referenced this pull request Apr 29, 2020
* Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"

This reverts commit ce6caade7c57a505f73086ccd7b33c14f7715f22.

* Revert "[ruby/fiddle] test: use env Hash"

This reverts commit 4d844cbaed518743776594fa5ae33b86fe176ad1.

* Deprecate taint/trust and related methods, and make the methods no-ops

This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.

* More fixes for $SAFE/taint post merging

* Fix "cannot find the function: strcpy()" error on arm32 on Travis CI. (#2686)

This issue happened when `libc.so` and `libm.so` path were not found
and `ldd ruby` command also failed to print the shared dependencies
in `test/fiddle/helper.rb`.

See https://travis-ci.org/ruby/ruby/jobs/611483288#L3018
/home/travis/build/ruby/ruby/build/.ext/common/fiddle/import.rb:299:in `import_function': cannot find the function: strcpy() (Fiddle::DLError)

* Set libc6:armhf as a installing dependency explicitly.
* Remove arm32 from allow_failures.

* Drop executable bit of *.{yml,h,mk.tmpl}

* pass appropriate libc path

The same as ruby/ruby#2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack implemented some lines
below does not work.

* Use ffi_closure_free if available

* ffi_closure_free is available in the bundled libffi

* Fixed never-defined symbol name

* use ffi_closure_alloc only with 3.2 or later

* always use ffi_closure_alloc on Windows

* Fixed a typo

* Switch to download libffi source package to github releases from sourceware.org

* Use osuosl instead of GitHub releases

  Because the package provided by GitHub releases is different from sourceware.

* Do not set USE_FFI_CLOSURE_ALLOC=1 in fiddle on OpenBSD

On OpenBSD, USE_FFI_CLOSURE_ALLOC was always set to 0 previously. In
633a1f15d8228236094ddee12e4e169d655ec49e, the code was modified in a
way that it ended up being set to 1 on OpenBSD.  However, that results
in SIGABRT when running make test-all, inside ffi_closure_free.
Setting USE_FFI_CLOSURE_ALLOC back to 0 fixes the issue.

* Show libffi version only if set

* Fix helper to not assume glibc

* `Dir.glob` always returns an array

It is not needed to test itself, but the element should be tested
instead.

Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-authored-by: Jun Aruga <junaruga@users.noreply.github.com>
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
Co-authored-by: 卜部昌平 <shyouhei@ruby-lang.org>
Co-authored-by: Paul Jordan <paullj1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants