public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/30009] New: unterminated options list in benchtest
@ 2023-01-17 12:45 gvalky at tachyum dot com
  2024-08-09 15:18 ` [Bug build/30009] " fweimer at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: gvalky at tachyum dot com @ 2023-01-17 12:45 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=30009

            Bug ID: 30009
           Summary: unterminated options list in benchtest
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: gvalky at tachyum dot com
                CC: carlos at redhat dot com
  Target Milestone: ---

Component: benchtests
Overview: Tests are crashing while printing CLI help
Steps to reproduce:
  make bench-build && benchtests/bench-bzero --help

Code: 
  Options list is on two locations
  1. support/support_test_main.c:42

    static const struct option default_options[] =
    {
      TEST_DEFAULT_OPTIONS
      { NULL, 0, NULL, 0 }
    };

  2. support/test-driver.c:153

    #ifdef CMDLINE_OPTIONS
      struct option options[] =
        {
          CMDLINE_OPTIONS
          TEST_DEFAULT_OPTIONS
        };
      test_config.options = &options;
    #endif

  The first one is properly terminated, whereas the later one is not.

Suggested fix: Add terminator in support/test-driver.c:153, after this change
the CLI help is printed out without segfault.

    #ifdef CMDLINE_OPTIONS
      struct option options[] =
        {
          CMDLINE_OPTIONS
          TEST_DEFAULT_OPTIONS
          { NULL, 0, NULL, 0 }
        };
      test_config.options = &options;
    #endif

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug build/30009] unterminated options list in benchtest
  2023-01-17 12:45 [Bug build/30009] New: unterminated options list in benchtest gvalky at tachyum dot com
@ 2024-08-09 15:18 ` fweimer at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: fweimer at redhat dot com @ 2024-08-09 15:18 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=30009

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |fweimer at redhat dot com
             Status|UNCONFIRMED                 |RESOLVED
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com
   Target Milestone|---                         |2.41
              Flags|                            |security-

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Sorry, didn't notice this bug before. Fixed for glibc 2.41 via:

commit c2a474f4617ede7a8bf56b7257acb37dc757b2d1
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Aug 9 17:01:17 2024 +0200

    support: Add options list terminator to the test driver

    This avoids crashes if a test is passed unknown options.

    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-09 15:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 12:45 [Bug build/30009] New: unterminated options list in benchtest gvalky at tachyum dot com
2024-08-09 15:18 ` [Bug build/30009] " fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).