Code Monkey home page Code Monkey logo

Comments (11)

ColinIanKing avatar ColinIanKing commented on June 2, 2024 1

Fixed in commit d533345 - please re-try with this fix and let me know if it helps.

from stress-ng.

ColinIanKing avatar ColinIanKing commented on June 2, 2024 1

Order fixed in commit 20b483e

from stress-ng.

vt-alt avatar vt-alt commented on June 2, 2024 1

@ColinIanKing Thanks for the fixes!
ps. Tested build and it's clean.

from stress-ng.

ColinIanKing avatar ColinIanKing commented on June 2, 2024

I'm not implicitly using this symbol, the only ppoll symbols in the code are:

objdump -t ./stress-ng | grep ppoll
0000000000710670 l F .text 0000000000000020 bad_ppoll1
0000000000710690 l F .text 0000000000000050 bad_ppoll2
0000000000711140 l F .text 000000000000006a bad_ppoll4
00000000007111b0 l F .text 0000000000000076 bad_ppoll3
0000000000718340 l F .text 00000000000000b7 syscall_ppoll
0000000000000000 F UND 0000000000000000 ppoll

Which distro is this being built on so I can try and reproduce this?

from stress-ng.

vt-alt avatar vt-alt commented on June 2, 2024

ALT Linux, there instructions for building in Docker #283 (comment)

There is temporary build log https://git.altlinux.org/tasks/337783/build/200/i586/log

from stress-ng.

vt-alt avatar vt-alt commented on June 2, 2024
builder@i586:~/RPM/BUILD/stress-ng-0.17.03$ grep -rl __ppoll_chk
stress-poll.o
stress-ng
builder@i586:~/RPM/BUILD/stress-ng-0.17.04$ objdump -r stress-poll.o | grep __ppoll_chk
0000068c R_386_PLT32       __ppoll_chk
00000773 R_386_PLT32       __ppoll_chk
00000842 R_386_PLT32       __ppoll_chk

Only compilation difference from previous version is

old: cc -pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic -Wall -Wextra -DVERSION='"0.17.03"' -std=gnu99 -fstack-protector-strong -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -c -o stress-poll.o stress-poll.c
new: cc -pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic -Wall -Wextra -DVERSION='"0.17.04"' -std=gnu99   -c -o stress-poll.o stress-poll.c

(Btw, We have _FORTIFY_SOURCE=3 by default.)

from stress-ng.

vt-alt avatar vt-alt commented on June 2, 2024

So I think this is _FORTIFY_SOURCE related, can this be a glibc bug? @ldv-alt

builder@i586:~/RPM/BUILD/stress-ng-0.17.04$ objdump -dS stress-ng | less
...
__fortify_function __fortified_attr_access (__write_only__, 1, 2) int
ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout,
       const __sigset_t *__ss)
{
  return __glibc_fortify (ppoll, __nfds, sizeof (*__fds),
  11220a:       58                      pop    %eax
  11220b:       8d 85 70 fe ff ff       lea    -0x190(%ebp),%eax
  112211:       ff b5 44 fe ff ff       push   -0x1bc(%ebp)
  112217:       57                      push   %edi
  112218:       89 85 3c fe ff ff       mov    %eax,-0x1c4(%ebp)
  11221e:       50                      push   %eax
  11221f:       ff b5 6c fe ff ff       push   -0x194(%ebp)
  112225:       ff b5 4c fe ff ff       push   -0x1b4(%ebp)
  11222b:       e8 b0 c8 f0 ff          call   1eae0 <__ppoll_chk@plt>
...
                        ts.tv_nsec = 1999999999;
  1122ea:       c7 85 74 fe ff ff ff 93 35 77   movl   $0x773593ff,-0x18c(%ebp)
  1122f4:       ff b5 44 fe ff ff       push   -0x1bc(%ebp)
  1122fa:       ff b5 48 fe ff ff       push   -0x1b8(%ebp)
  112300:       ff b5 3c fe ff ff       push   -0x1c4(%ebp)
  112306:       ff b5 6c fe ff ff       push   -0x194(%ebp)
  11230c:       ff b5 4c fe ff ff       push   -0x1b4(%ebp)
  112312:       e8 c9 c7 f0 ff          call   1eae0 <__ppoll_chk@plt>
        if (UNLIKELY(!g_stress_continue_flag))
...
                                                ts.tv_sec = 0;
  1123ac:       c7 85 70 fe ff ff 00 00 00 00   movl   $0x0,-0x190(%ebp)
  1123b6:       83 ec 0c                sub    $0xc,%esp
                                                ts.tv_nsec = 0;
  1123b9:       c7 85 74 fe ff ff 00 00 00 00   movl   $0x0,-0x18c(%ebp)
  1123c3:       ff b5 44 fe ff ff       push   -0x1bc(%ebp)
  1123c9:       ff b5 48 fe ff ff       push   -0x1b8(%ebp)
  1123cf:       ff b5 3c fe ff ff       push   -0x1c4(%ebp)
  1123d5:       ff b5 6c fe ff ff       push   -0x194(%ebp)
  1123db:       ff b5 4c fe ff ff       push   -0x1b4(%ebp)
  1123e1:       e8 fa c6 f0 ff          call   1eae0 <__ppoll_chk@plt>
                                                (void)setrlimit(RLIMIT_NOFILE, &old_rlim);
...

from stress-ng.

vt-alt avatar vt-alt commented on June 2, 2024

FYI. After switched fortify level from 3 to 2 (with -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 in CFLAGS) the non-LFS functions error disappeared. I think I will stick to this.

from stress-ng.

ColinIanKing avatar ColinIanKing commented on June 2, 2024

Looks like a regression due to commit:

commit c9f29f6
Author: Colin Ian King [email protected]
Date: Sat Dec 23 16:50:05 2023 +0000

Makefile: add cc_supports_flag to simplify CFLAGS checking

from stress-ng.

vt-alt avatar vt-alt commented on June 2, 2024

Thanks. With this commit cherry-picked your redefinition of _FORTIFY_SOURCE is returned, as in previous release, and non-LFS functions error disappeared. Except, there is 369 new warnings like this:

[00:00:05] CC core-perf.c
[00:00:05] cc -pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic -Wall -Wextra -DVERSION='"0.17.04"' -std=gnu99 -Wformat -fstack-protector-strong -D_FORTIFY_SOURCE=2 -U_FORTIFY_SOURCE -Werror=format-security -fipa-pta -c -o core-perf.o core-perf.c
[00:00:05] <command-line>: warning: "_FORTIFY_SOURCE" redefined
[00:00:05] <built-in>: note: this is the location of the previous definition

I think this is because it should be ordered as -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2. In commit c9f29f6 ("Makefile: add cc_supports_flag to simplify CFLAGS checking") you also changed their ordering.

from stress-ng.

ColinIanKing avatar ColinIanKing commented on June 2, 2024

Ah, OK, I'll fix that

from stress-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.