https://bugzilla.novell.com/show_bug.cgi?id=354113
User bk@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=354113#c15
Bernhard Kaindl changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bk@novell.com
Status|NEEDINFO |NEW
Info Provider|casualprogrammer@yahoo.com |
--- Comment #15 from Bernhard Kaindl 2008-02-12 06:46:26 MST ---
I now tested with -O0 and -O1, but could not isolate it to a individual
optimisation (including -fno-strict-aliasing and -fwrapv) yet, despite
trying even with:
CFLAGS="-O1 -fno-ipa-reference -fno-ipa-pure-const -fno-if-conversion
-fno-if-conversion2 -fno-merge-constants \
-fno-wrapv \
-fno-cprop-registers -fno-defer-pop \
-fno-split-wide-types \
-fno-gcse \
-fmessage-length=0 -Wall \
-fno-defer-pop -fno-guess-branch-probability -fno-unit-at-a-time \
-fno-strict-aliasing -fno-thread-jumps -fno-tree-pre -fno-regmove
-fno-expensive-optimizations -fno-peephole2 -fno-optimize-sibling-calls
-fno-optimize-register-move -fno-delete-null-pointer-checks -fno-caller-saves
-fno-forward-propagate -fno-schedule-insns2 -fno-tree-pre -fno-tree-store-ccp
-fno-tree-vrp -fno-align-jumps -fno-align-labels -fno-align-loops
-fno-crossjumping -fno-cse-follow-jumps -fno-inline-small-functions \
-fno-tree-ccp -fno-tree-ch -fno-tree-copy-prop
-fno-tree-copyrename \
-fno-tree-dce -fno-tree-dse -fno-tree-fre \
-fno-tree-pre -fno-tree-store-ccp -fno-tree-vrp \
-fno-forward-propagate -fno-crossjumping -fno-cse-follow-jumps \
-fno-tree-ccp -fno-tree-ch -fno-tree-copy-prop -fno-tree-copyrename
\
-fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-fre \
-fno-tree-salias \
-fno-tree-sink -fno-tree-sra -fno-tree-ter "
and
CFLAGS="-O0 -fipa-reference -fipa-pure-const -fif-conversion -fif-conversion2
-fmerge-constants \
-fwrapv \
-fcprop-registers -fdefer-pop \
-fsplit-wide-types \
-fgcse \
-fmessage-length=0 -Wall \
-fdefer-pop -fguess-branch-probability -funit-at-a-time \
-fstrict-aliasing -fthread-jumps -ftree-pre -fregmove -fexpensive-optimizations
-fpeephole2 -foptimize-sibling-calls -foptimize-register-move
-fdelete-null-pointer-checks -fcaller-saves -fforward-propagate
-fschedule-insns2 -ftree-pre -ftree-store-ccp -ftree-vrp -falign-jumps
-falign-labels -falign-loops -fcrossjumping -fcse-follow-jumps
-finline-small-functions \
-ftree-ccp -ftree-ch -ftree-copy-prop -ftree-copyrename \
-ftree-dce -fno-tree-dse -fno-tree-fre \
-ftree-pre -ftree-store-ccp -ftree-vrp \
-fforward-propagate -fcrossjumping -fcse-follow-jumps \
-ftree-ccp -ftree-ch -ftree-copy-prop -ftree-copyrename \
-ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre \
-ftree-salias \
-ftree-sink -ftree-sra -ftree-ter "
The result was always identical to just -O0 (working) and -O1 (not working):
Here is the result of my debug session, with unpatched ntfs-3g-1.2129 compiled
with --enable-debug to get extra debug logging enabled in the code.
I diffed the debug log and single-stepped where the 1st difference occured:
In ntfs_attr_lookup(), libntfs-3g/attrib.c
(gdb) l 493
488 {
489 LCN lcn;
490 ntfs_attr_search_ctx *ctx;
491
492 ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn
0x%llx.\n",
493 (unsigned long long)na->ni->mft_no, na->type, (long
long)vcn);
494
495 lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn);
496 if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT)
497 return 0;
Stepping into:
ntfs_rl_vcn_to_lcn (rl=0x0, vcn=0) at runlist.c:978
978 if (vcn < (VCN)0)
(gdb) p vcn
$8 = 0
(gdb) s
985 if (!rl)
(gdb)
986 return (LCN)LCN_RL_NOT_MAPPED;
(gdb) s
ntfs_attr_map_runlist (na=0x8e63630, vcn=0) at attrib.c:496
496 if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT)
(gdb) p lcn
$9 = -2
(gdb) s
497 return 0;
LCN_HOLE is -1 and LCN_ENOENT is -3 (both are defined in an enum)
=> AFAICS, "return 0" may not happen in with this value of lcn.
Code compiled with -O0 does not return and continues successfully to mount.
info registers
eax 0x0 0
ecx 0x1 1
edx 0x0 0
ebx 0xf7fb8ff4 -134508556
esp 0xff9cdfc0 0xff9cdfc0
ebp 0xff9ce018 0xff9ce018
esi 0x3 3
edi 0xffffffff -1
eip 0xf7f75c97 0xf7f75c97
eflags 0x202 [ IF ]
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x0 0
gs 0x63 99
Disassembly of the code after the call:
0xf7f75c6b : call 0xf7f7464c
0xf7f75c70 : mov %eax,%esi
0xf7f75c72 : mov %edx,%edi
0xf7f75c74 : mov $0x1,%ecx
0xf7f75c79 : cmp $0xffffffff,%edi
0xf7f75c7c : jge 0xf7f75c83
0xf7f75c7e : mov $0x0,%ecx
0xf7f75c83 : mov %esi,%eax
0xf7f75c85 : xor $0xfffffffd,%eax
0xf7f75c88 : mov %edi,%edx
0xf7f75c8a : not %edx
0xf7f75c8c : mov %eax,%esi
0xf7f75c8e : or %edx,%esi
0xf7f75c90 : sete %al
0xf7f75c93 : or %al,%cl
0xf7f75c95 : je 0xf7f75ca1
0xf7f75c97 : mov $0x0,%eax
0xf7f75c9c : jmp 0xf7f75d65
The same code, compiled with -O0 (plus the other flags above) looks like this:
0xf7ede08e : call 0xf7edc730
0xf7ede093 : mov %eax,-0x20(%ebp)
0xf7ede096 : mov %edx,-0x1c(%ebp)
0xf7ede099 : cmpl $0x0,-0x1c(%ebp)
0xf7ede09d : jns 0xf7ede0c7
0xf7ede09f : mov -0x1c(%ebp),%eax
0xf7ede0a2 : mov %eax,%edx
0xf7ede0a4 : xor $0xffffffff,%edx
0xf7ede0a7 : mov -0x20(%ebp),%eax
0xf7ede0aa : xor $0xffffffff,%eax
0xf7ede0ad : or %edx,%eax
0xf7ede0af : test %eax,%eax
0xf7ede0b1 : je 0xf7ede0c7
0xf7ede0b3 : mov -0x1c(%ebp),%eax
0xf7ede0b6 : mov %eax,%edx
0xf7ede0b8 : xor $0xffffffff,%edx
0xf7ede0bb : mov -0x20(%ebp),%eax
0xf7ede0be : xor $0xfffffffd,%eax
0xf7ede0c1 : or %edx,%eax
0xf7ede0c3 : test %eax,%eax
0xf7ede0c5 : jne 0xf7ede0d3
0xf7ede0c7 : movl $0x0,-0x2c(%ebp)
0xf7ede0ce : jmp 0xf7ede1ac
The testing above was with -O0 and -O1 with several optimisation options
enabled in -O0 and several disabled with -O1, but the behaviour of ntfs-3g did
not change because of using individial optimisation flags behind -O0 and -O1,
only -O0 and -O1 made a difference in the test wether ntfs3-g mounted the
filesystem or not.
To reproduce:
mkfs.ntfs -F test 6000
cat >.gdbinit <https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.