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

readstat fails to build on arm64, armhf, ppc64el, s390x, riscv64 with GCC 10 or 11 in Ubuntu 21.10 #247

Closed
rikmills opened this issue Jul 8, 2021 · 1 comment

Comments

@rikmills
Copy link

rikmills commented Jul 8, 2021

While build testing to see if readstat can be included in the Ubuntu archive for use by KDE labplot, at the request labplot devs, builds fail for all supported architectures apart from amd64.

Test build: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4609/+sourcepub/12530199/+listing-archive-extra

arm64:

FAIL: test_readstat
===================

Test "UTF-8 column name" failed: Error codes
 * Format: sav (0x1000)
 * Expected: (null)
 * Received: "{��T��" (length=6)
Test "UTF-8 column name" failed: Error codes
 * Format: savrow (0x2000)
 * Expected: (null)
 * Received: "A provided name contains an illegal character" (length=45)
Test "UTF-8 column name" failed: Error codes
 * Format: zsav (0x4000)
 * Expected: (null)
 * Received: "A provided name contains an illegal character" (length=45)
FAIL test_readstat (exit status: 1)

armhf:

src/spss/readstat_sav_write.c: In function ‘sav_begin_data’:
src/spss/readstat_sav_write.c:1307:66: error: ‘%d’ directive output may be truncated writing between 1 and 9 bytes into a region of size 8 [-Werror=format-truncation=]
 1307 |             snprintf(shortname, sizeof(varnames[0].shortname), "V%d_A", i+1);
      |                                                                  ^~
src/spss/readstat_sav_write.c:1307:64: note: directive argument in the range [1, 286331154]
 1307 |             snprintf(shortname, sizeof(varnames[0].shortname), "V%d_A", i+1);
      |                                                                ^~~~~~~
In file included from /usr/include/stdio.h:866,
                 from src/spss/readstat_sav_write.c:2:
/usr/include/arm-linux-gnueabihf/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’ output between 5 and 13 bytes into a destination of size 9
   71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   72 |        __glibc_objsize (__s), __fmt,
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |        __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~

ppc64el & riscv64:

src/spss/readstat_sav_write.c: In function ‘sav_begin_data’:
src/spss/readstat_sav_write.c:1307:66: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Werror=format-truncation=]
 1307 |             snprintf(shortname, sizeof(varnames[0].shortname), "V%d_A", i+1);
      |                                                                  ^~
src/spss/readstat_sav_write.c:1307:64: note: directive argument in the range [1, 2147483647]
 1307 |             snprintf(shortname, sizeof(varnames[0].shortname), "V%d_A", i+1);
      |                                                                ^~~~~~~
In file included from /usr/include/stdio.h:866,
                 from src/spss/readstat_sav_write.c:2:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:71:10: note: ‘__snprintf_chk’ output between 5 and 14 bytes into a destination of size 9
   71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   72 |        __glibc_objsize (__s), __fmt,
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |        __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~

s390x:

In file included from /usr/include/string.h:519,
                 from src/sas/../readstat.h:16,
                 from src/sas/readstat_sas7bdat_write.c:7:
In function ‘strncpy’,
    inlined from ‘sas7bdat_make_text_ref’ at src/sas/readstat_sas7bdat_write.c:130:5,
    inlined from ‘sas7bdat_row_size_subheader_init’ at src/sas/readstat_sas7bdat_write.c:198:20,
    inlined from ‘sas7bdat_subheader_array_init’ at src/sas/readstat_sas7bdat_write.c:359:33,
    inlined from ‘sas7bdat_write_ctx_init’ at src/sas/readstat_sas7bdat_write.c:546:19,
    inlined from ‘sas7bdat_begin_data’ at src/sas/readstat_sas7bdat_write.c:590:26:
/usr/include/s390x-linux-gnu/bits/string_fortified.h:95:10: error: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Werror=stringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |       __glibc_objsize (__dest));
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~
evanmiller added a commit that referenced this issue Aug 4, 2021
@rikmills
Copy link
Author

rikmills commented Sep 9, 2021

Closing as I won't be uploading readstat to Ubuntu

@rikmills rikmills closed this as completed Sep 9, 2021
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