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

FreeBSD 13-CURRENT: ZSTD, error: stack frame size of 16440 bytes in function #10772

Closed
PrivatePuffin opened this issue Aug 21, 2020 · 3 comments

Comments

@PrivatePuffin
Copy link
Contributor

PrivatePuffin commented Aug 21, 2020

System information

Type Version/Name
Distribution Name FreeBSD
Distribution Version 13
Linux Kernel na
Architecture na
ZFS Version master 21-08-2020
SPL Version

Describe the problem you're observing

originaly reported by @freqlabs on #10278

Frame stack size warnings are ignored for the ZSTD library (because we don't use said code portions in the library and don't want to edit the library itself to remove those). Those are ignored using:
module/zstd/makefile.in

$(obj)/lib/zstd.o: c_flags += -Wframe-larger-than=20480

and
lib/libzstd/makefile.am:

lib/zstd.$(OBJEXT):  CFLAGS += -Wframe-larger-than=20480
lib/zstd.l$(OBJEXT): CFLAGS += -Wframe-larger-than=20480

Even though said warnings are ignrored, a non-debug build on FreeBSD 13-CURRENT still gives stack frame size warnings.
A non debug build of FreeBSD 12-STABLE works just fine.
So this might be compiler related.

Describe how to reproduce the problem

  • Build without debug options on FreeBSD 13-CURRENT
  • Notice the warnings and failed build due to too many warnings

Include any warning/errors/backtraces from the system logs

../../module/zstd/lib/zstd.c:3030:8: error: stack frame size of 16440 bytes in function 'FSE_decompress' [-Werror,-Wframe-larger-than=]                       [16/3363]
size_t FSE_decompress(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize)
       ^
../../module/zstd/lib/zstd.c:7651:8: error: stack frame size of 4136 bytes in function 'FSE_buildCTable' [-Werror,-Wframe-larger-than=]
size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
       ^
../../module/zstd/lib/zstd.c:8163:8: error: stack frame size of 14424 bytes in function 'FSE_compress2' [-Werror,-Wframe-larger-than=]
size_t FSE_compress2 (void* dst, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog)
       ^
../../module/zstd/lib/zstd.c:8335:8: error: stack frame size of 4136 bytes in function 'HIST_countFast' [-Werror,-Wframe-larger-than=]
size_t HIST_countFast(unsigned* count, unsigned* maxSymbolValuePtr,
       ^
../../module/zstd/lib/zstd.c:8357:8: error: stack frame size of 4136 bytes in function 'HIST_count' [-Werror,-Wframe-larger-than=]
size_t HIST_count(unsigned* count, unsigned* maxSymbolValuePtr,
       ^
../../module/zstd/lib/zstd.c:8780:8: error: stack frame size of 4392 bytes in function 'HUF_buildCTable' [-Werror,-Wframe-larger-than=]
size_t HUF_buildCTable (HUF_CElt* tree, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits)
       ^
../../module/zstd/lib/zstd.c:9114:8: error: stack frame size of 6472 bytes in function 'HUF_compress1X' [-Werror,-Wframe-larger-than=]
size_t HUF_compress1X (void* dst, size_t dstSize,
       ^
../../module/zstd/lib/zstd.c:9151:8: error: stack frame size of 6472 bytes in function 'HUF_compress2' [-Werror,-Wframe-larger-than=]
size_t HUF_compress2 (void* dst, size_t dstSize,
       ^
../../module/zstd/lib/zstd.c:17683:8: error: stack frame size of 6216 bytes in function 'ZSTD_compressBlock_doubleFast' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_doubleFast(
       ^
../../module/zstd/lib/zstd.c:21215:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btopt' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btopt(
       ^
../../module/zstd/lib/zstd.c:21280:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btultra' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btultra(
       ^
../../module/zstd/lib/zstd.c:21288:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btultra2' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btultra2(
       ^
../../module/zstd/lib/zstd.c:21330:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btopt_extDict' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btopt_extDict(
       ^
../../module/zstd/lib/zstd.c:21337:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btultra_extDict' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btultra_extDict(
       ^
../../module/zstd/lib/zstd.c:18241:8: error: stack frame size of 4200 bytes in function 'ZSTD_compressBlock_fast_dictMatchState' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_fast_dictMatchState(
       ^
../../module/zstd/lib/zstd.c:17703:8: error: stack frame size of 6216 bytes in function 'ZSTD_compressBlock_doubleFast_dictMatchState' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_doubleFast_dictMatchState(
       ^
../../module/zstd/lib/zstd.c:21316:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btopt_dictMatchState' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btopt_dictMatchState(
       ^
../../module/zstd/lib/zstd.c:21323:8: error: stack frame size of 6280 bytes in function 'ZSTD_compressBlock_btultra_dictMatchState' [-Werror,-Wframe-larger-than=]
size_t ZSTD_compressBlock_btultra_dictMatchState(
       ^
../../module/zstd/lib/zstd.c:21253:1: error: stack frame size of 6280 bytes in function 'ZSTD_initStats_ultra' [-Werror,-Wframe-larger-than=]
ZSTD_initStats_ultra(ZSTD_matchState_t* ms,
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
@ghost
Copy link

ghost commented Aug 21, 2020

Figured it out, it was in my build script on this machine:

gmake -j20 CFLAGS="-march=native"

Apparently the CFLAGS passed on the command line are overriding what's in the Makefile, instead of being appended to.

@PrivatePuffin
Copy link
Contributor Author

@freqlabs Thats... weird as... well... weird. Thanks for looking into it. So basically I can close this now it seems, but very good to know none-the-less 👍

@ghost
Copy link

ghost commented Aug 21, 2020

Well I think lib/libzfs/Makefile.am could be made to accommodate this since this has been working up until now. I'm testing a patch and will open a PR if it works.

It worked

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

No branches or pull requests

1 participant