Yakov Lerner wrote: > > > > > > On 9/14/06, Haakon Riiser <[EMAIL PROTECTED]> wrote: > > > > > > > After recompiling Vim with -D_FILE_OFFSET_BITS=64, everything > > > > > > > involving tags break, including the help system. Typing :h, > > > > > > > or pressing ^] to jump to a tag, causes Vim to get caught in an > > > > > > > infinite loop. > > > > > > [...] > > > > > > > > Can you find out where in the code this happens? > > > > > > > > > > I suspect the 64 bit library functions work different from the > > > > > "normal" functions. Perhaps fgets(), since that's what is > > > > > being used to read the tags file. > > > > > > > > In situation where fgets() returns NULL, find_tags() enters > > > > infinite loop as follows. > > > > > > Sorry, this doesn't show me where the loop actually is. Please compile > > > without the optimizer, otherwise code reordering confuses the debugger. > > > > > > At least tell us if Vim hangs in tag_fgets() or in find_tags(). > > > > The loop is is inside find_tags(), and it procees around following line > > numbers: > > 1625 1626 1642 1647 1650 1651 1652 1653 1562 1564 1566 > > 1576 1582 1588 1601 1603 1604 1616 1619 1621 1625 > > and infinite loop repeats. Look at this: > > gdb> print print search_info.curr_offset > > $2 = 5258708303049 > > > > The difference must be related to fseek(). I don't see where > > search_info.curr_offset is first initialized, though.
The problem must be that either ftello() doesn't return the right position or fseeko() doesn't position the read pointer properly. I can't think of another reason. > And additionally: > (gdb) print search_info > $3 = {low_offset = 0, high_offset = 10526964844947, curr_offset = > 5258708303049, > curr_offset_used = 5258708303049, match_offset = 10763188046282, > low_char = 0, high_char = 120} This suggests that an unsigned number overflows and is turned into an int somewhere. I can't guess where and I can't reproduce this. Perhaps someone can think of a workaround and try it out. One thing you can do: check that off_t is signed. You should have seen compiler warnings then. -- Arthur pulls Pin out. The MONK blesses the grenade as ... ARTHUR: (quietly) One, two, five ... GALAHAD: Three, sir! ARTHUR: Three. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///