Bug 14229 - strtok_r() doesn't work with x32
Summary: strtok_r() doesn't work with x32
Status: VERIFIED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.15
: P1 normal
Target Milestone: 2.16
Assignee: H.J. Lu
URL: http://sourceware.org/ml/libc-alpha/2...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-13 16:11 UTC by Mike Frysinger
Modified: 2014-06-19 14:31 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-linux-gnux32
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2012-06-13 16:11:34 UTC
tested the patched glibc-2.15 as well as the latest git mainline

$ cat test.c
#include <stdio.h>
#include <string.h>
int main() {
    char line[] = "udf 75868 1 - Live 0xffffffffa0bfb000\n";
    char *saveptr, *tok = strtok_r(line, " \t", &saveptr);
    printf("tok: {%s}\nshould be: {udf}\n", tok);
    return 0;
}

$ gcc -Wall test.c -m64 && ./a.out
tok: {udf}
should be: {udf}

$ gcc -Wall test.c -m32 && ./a.out
tok: {udf}
should be: {udf}

$ gcc -Wall test.c -mx32 && ./a.out
tok: {}
should be: {udf}
Comment 1 H.J. Lu 2012-06-13 17:40:59 UTC
A patch is posted at

http://sourceware.org/ml/libc-alpha/2012-06/msg00357.html
Comment 2 H.J. Lu 2012-06-14 17:42:45 UTC
Fixed on master branch and hjl/x32/release/2.15 branch.
Comment 3 Mike Frysinger 2012-06-14 18:31:29 UTC
works great!

# lsmod
Module                  Size  Used by
udf                    75868  0
usb_storage            35339  1
dm_mod                 63508  0
xt_tcpudp               2311  2
iptable_filter          1120  1