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

FS#1464 - Perl built with gcc > v5 segfaults on apm821xx #6704

Closed
openwrt-bot opened this issue Apr 1, 2018 · 6 comments
Closed

FS#1464 - Perl built with gcc > v5 segfaults on apm821xx #6704

openwrt-bot opened this issue Apr 1, 2018 · 6 comments
Labels

Comments

@openwrt-bot
Copy link

russell:

  • Device problem occurs on

I have seen this on recent builds for Meraki MR24 (apm821xx)

  • Software versions of OpenWrt/LEDE release, packages, etc.

Currently at commit db893ec.

Noticed recently since the update to gcc version 7 as default (at commit 61eee1a).
Using GCC_USE_VERSION_5=y builds a perl that doesn't segfault. GCC_USE_VERSION_6=y also segfaults. Perl installed is 5.26.1-3

  • Steps to reproduce

Start perl, type "use strict;" followed by a carriage return. BOOM

root@hostname:/# perl
use strict;
Attempt to free unreferenced scalar: SV[65050.255294] perl[16847]: unhandled signal 11 at 529303c4 nip b7a193b4 lr b7a19380 code 1
0x10493190 at /usr/lib/perl5/5.26/strict.pm line 38.
Segmentation fault

@openwrt-bot
Copy link
Author

chunkeey:

[[https://github.com/arsv/perl-cross/issues/60|perl-cross issue #60]] suggests that the gcc version detection code broke. arsv mentioned a fix and it seems that manually forcing "-fwrapv -fno-strict-aliasing" did the trick here. (See attached patch.)

I had to completely purge the old perl installation too. the --force-reinstall did not on local packages.

@openwrt-bot
Copy link
Author

russell:

That fixes it for me.

@openwrt-bot
Copy link
Author

diizzyy:

Still an issue, perhaps ping Philip on Github (where this should have been reported on in the first place as it's in the package repo)?

@openwrt-bot
Copy link
Author

russell:

diizzyy, it was reported here intentionally, because it was/is not clear if this is a general build system problem for apm821xx, or a problem that is specific to the perl package.

@openwrt-bot
Copy link
Author

pprindeville:

Russell, if other things required this flag they'd be failing too.

Seems to be pretty specific to Perl5.

@openwrt-bot
Copy link
Author

pprindeville:

Spoke to Tony Cook and it seems that much of Perl was written relying on the undefined behavior of signed overflow wrapping around (i.e. exactly what -fwrapv controls).

Ideally someone would scrub this out of Perl, but until then, the workaround is to build with this flag.

Fixed with PR #6623.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant