fscanf changes value when reading . cc version 4.1.2 20071124 (RedHat 4.1.2-42)

From: Beverly Seavey
Date: Tue Aug 12 2008 - 12:10:57 EST


hornbill% 10:36>g++ -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)
hornbill% 10:36>



(gdb) watch *(allLeavesUpperBounds + 12)
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)
(gdb) run
Starting program: /v/v03/s/seavey/private/condStuff/apD14L14-S07-75751_S04-1616-100f-NF
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)

Old value = 0 <<<<<<<<<<<<<<< this I did
New value = 1
0x00546231 in _IO_vfscanf_internal () from /lib/libc.so.6
(gdb) cont
Continuing.
Hardware watchpoint 1: *(allLeavesUpperBounds + 12)

Old value = 1
New value = 0 <<<<<<<<<<<<<<< fscanf did this
0x00546231 in _IO_vfscanf_internal () from /lib/libc.so.6
(gdb) where
#0 0x00546231 in _IO_vfscanf_internal () from /lib/libc.so.6
#1 0x00547b33 in vfscanf () from /lib/libc.so.6
#2 0x0054c612 in fscanf () from /lib/libc.so.6
#3 0x0804b7e2 in readCompiled (readParamsPtr=0x870f070, treeCtr=14, numLeaves=1, allTreesLowerBounds=0x804efa0, allTreesUpperBounds=0x8050bc0)
at apD14L14-S07-75751_S04-1616-100f-NF.c:880
#4 0x0804c230 in main () at apD14L14-S07-75751_S04-1616-100f-NF.c:423
(gdb)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/