[Bug dynamic-link/24036] New: _dl_debug_vdprintf bad format "0x%0*Zd" from dl_main

jreiser at BitWagon dot com sourceware-bugzilla@sourceware.org
Tue Dec 25 22:22:00 GMT 2018


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

            Bug ID: 24036
           Summary: _dl_debug_vdprintf bad format "0x%0*Zd" from dl_main
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: jreiser at BitWagon dot com
  Target Milestone: ---

dl_main calls _dl_printf with two formats "%0*Zd" which instead should be
"%0*Zx"; note 'x' replacing 'd' [twice].  The glibc source version is:
commit 57b3ff8e1a4ca8118c5d9a47584e6e0ce6f7002f (HEAD -> master, origin/master,
origin/HEAD)
Date:   Fri Dec 21 19:02:23 2018 +0000


dl_main() in elf/rtld.c near line 1929:
            _dl_printf ("%s found at 0x%0*Zd in object at 0x%0*Zd\n",

However _dl_debug_vdprintf in elf/dl-misc.c near line 167:
          switch (*fmt)
            {
              /* Integer formatting.  */
            case 'u':
            case 'x':
          [[snip]]

has cases only for u,x,s,%; and none for 'd'.  So for the shell invocation:
    $ /lib64/ld-linux-x86-64.so.2 --list ./args __libc_start_main

then the complaint is:
    Inconsistency detected by ld.so: dl-misc.c: 216: _dl_debug_vdprintf:
Assertion `! "invalid format specifier"' failed!

The source code for the testcase ./args is:
=====
#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("argc= %d\n", argc);
    int j;
    for (j=0; j < argc; ++j) {
        printf("arg[%d]= %s\n", j, argv[j]);
    }
    return 0;
}
=====

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


More information about the Glibc-bugs mailing list