Bug 11991 - [numpy] segfault when compiling for RPi3 64bits
Summary: [numpy] segfault when compiling for RPi3 64bits
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2019.05
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-26 12:50 UTC by XonqNopp
Modified: 2019-07-15 05:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
log of numpy compilation (19.58 KB, text/x-log)
2019-06-26 12:50 UTC, XonqNopp
Details
Config used when encountering numpy segfault (17.22 KB, text/plain)
2019-07-08 11:36 UTC, XonqNopp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description XonqNopp 2019-06-26 12:50:21 UTC
Created attachment 8126 [details]
log of numpy compilation

When building for RaspberryPi 3 with 64bits from buildroot-2019.05 I get the attached error. It did not happen with 32bits.
Comment 1 Peter Seiderer 2019-07-05 21:11:43 UTC
Which GCC version? Mind to share your config/defconfig?

There is one more reference of the same compile failure on the web, see [1].

numpy/core/src/npymath/npy_math_internal.h.src:482:12: internal compiler error: Segmentation fault
     return @kind@@c@(x, y);
            ^~~~~~~~~~~~~~~

Stating 'Bug does not occur when using -O0 on GCC 8.2.0 and does not occur at all with GCC 9.1.0', mind to try a different compiler and/or optimization setting?

Regards,
Peter

[1] https://github.com/numpy/numpy/issues/13622
Comment 2 XonqNopp 2019-07-08 11:36:17 UTC
Created attachment 8136 [details]
Config used when encountering numpy segfault

Attached my .config (compressed because too large for bugzilla).

I started from configs/raspberry3_64_defconfig and added the stuff I need.

About GCC version I am not sure which one you want... So I have these:

$ /home/buildroot/buildroot201907numpySegFault/output/host/bin/aarch64-buildroot-linux-uclibc-gcc --version
aarch64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2019.05) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Let me know if you want to know about another one...
Comment 3 Peter Seiderer 2019-07-08 20:25:55 UTC
Thanks for the info/config...

With make menuconfig under Toolchain-->GCC compiler Version you
can select different versions, e.g.

- gcc 4.9.x (works)
- gcc 5.x (untested)
- gcc 6.x (untested)
- gcc 7.x (your/default selection, numpy segfault)
- gcc 8.x (numpy segfault)

Or in case you use buildroot master from git

- gcc 9.x (works)
Comment 4 XonqNopp 2019-07-10 06:30:40 UTC
OK for the workaround. So you mean it is intrinsic to the gcc compiler and will be fixed in the next major buildroot release (2019.08)? If so it is fine for me. Thanks for the help.
Comment 5 Peter Seiderer 2019-07-12 19:33:22 UTC
Update:

- gcc 5.x (works)
- gcc 6.x (numpy segfault)

Yes, gcc-9.1 support was added already on git master (see [1]) and will land in the next buildroot release...

[1] https://git.buildroot.net/buildroot/commit/?id=089000eccf584d611ad1a8e5400436952450e883