<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/bugzilla.dtd">

<bugzilla version="4.0.10"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>14229</bug_id>
          
          <creation_ts>2012-06-13 16:11:00 +0000</creation_ts>
          <short_desc>strtok_r() doesn&apos;t work with x32</short_desc>
          <delta_ts>2012-06-14 18:31:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>glibc</product>
          <component>libc</component>
          <version>2.15</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://sourceware.org/ml/libc-alpha/2012-06/msg00357.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.16</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Frysinger">vapier</reporter>
          <assigned_to name="H.J. Lu">hjl.tools</assigned_to>
          <cc>drepper.fsp</cc>
          <cf_gcchost></cf_gcchost>
          <cf_gcctarget>x86_64-linux-gnux32</cf_gcctarget>
          <cf_gccbuild></cf_gccbuild>
          

      

      

      

          <long_desc isprivate="0">
            <commentid>55685</commentid>
            <who name="Mike Frysinger">vapier</who>
            <bug_when>2012-06-13 16:11:34 +0000</bug_when>
            <thetext>tested the patched glibc-2.15 as well as the latest git mainline

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

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

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

$ gcc -Wall test.c -mx32 &amp;&amp; ./a.out
tok: {}
should be: {udf}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>55690</commentid>
            <who name="H.J. Lu">hjl.tools</who>
            <bug_when>2012-06-13 17:40:59 +0000</bug_when>
            <thetext>A patch is posted at

http://sourceware.org/ml/libc-alpha/2012-06/msg00357.html</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>55725</commentid>
            <who name="H.J. Lu">hjl.tools</who>
            <bug_when>2012-06-14 17:42:45 +0000</bug_when>
            <thetext>Fixed on master branch and hjl/x32/release/2.15 branch.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>55729</commentid>
            <who name="Mike Frysinger">vapier</who>
            <bug_when>2012-06-14 18:31:29 +0000</bug_when>
            <thetext>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</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>