LibFile complains about lack of memory

Timothy Baldwin T.E.Baldwin99 at members.leeds.ac.uk
Sat Aug 17 07:56:16 PDT 2002


On Friday 16 Aug 2002 4:23 pm, Nick Burrett wrote:
> Timothy Baldwin wrote:
> > A couple more bugs:
> > The number of used chunks is written incorrectly in the library header.
> > The symbol table give incorrect chunks for newly inserted objects.

[snip patch]

> The above patch looks is a reversion of the following change:
>
> [riscos at nick libfile]$ cvs log -r1.3.2.2 Library.cc
>
> RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/libfile/Library.cc,v
> Working file: Library.cc
> head: 1.4
> branch:
> locks: strict
> access list:
> symbolic names:
> 	merge_release_2_95_to_mainline_20020214: 1.3.2.2
> 	release_2_95_4_v1: 1.3.2.2
> 	release_2_95: 1.3.0.2
> 	release_2_0_0: 1.1.1.1
> 	gccsdk: 1.1.1
> keyword substitution: kv
> total revisions: 7;	selected revisions: 1
> description:
> ----------------------------
> revision 1.3.2.2
> date: 2001/09/11 09:09:13;  author: admin;  state: Exp;  lines: +1 -1
> (Library::build): Fix off-by-one error for the setting of the number
> of used chunks.  This caused libfile to set the wrong chunk number for
> new chunks added to an old library.

That sounds like the bug I just fixed with the change to Librarian.cc.

> ===========================================================================
>==
>
>
> [riscos at nick libfile]$ cvs diff -u -r1.3.2.1 -r1.3.2.2 Library.cc
> Index: Library.cc
> ===================================================================
> RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/libfile/Library.cc,v
> retrieving revision 1.3.2.1
> retrieving revision 1.3.2.2
> diff -u -r1.3.2.1 -r1.3.2.2
> --- Library.cc	16 Aug 2001 11:28:25 -0000	1.3.2.1
> +++ Library.cc	11 Sep 2001 09:09:13 -0000	1.3.2.2
> @@ -50,7 +50,7 @@
>    m_data.putInt(members);
>
>    // Number of used chunks
> - m_data.putInt(members);
> + m_data.putInt(members - 1);
>
>    // Get current timestamp
>    m_time->set();
>
>
> My change was made to fix the following issue:
> http://hard-mofo.dsvr.net/gcc/mail-archive/gcc/200109/0517.html
>

This change removes the last chunk from the created library, which used to be 
OFL_TIME. The problem stated occured because when LibFile updated the OFL_TIME 
chunk it moved it to the end of the file, moving all newly added members one 
chunk towards the begining of the file, invalidating the newly recreated 
symbol table. If there is no chunk OFL_TIME in the orignal library this 
didn't happen.

In summary, your change, instead of fixing the bug, made LibFile produce 
broken libraries which did not trigger the bug.

> Are you sure your change doesn't resurrect this problem ?

Yes, in combination with my change to Libarian.cc, it fixes it.

If you only put in my other changes you will find the libraries no longer 
contain a symbol table (according to LibFile at least).

-- 
Timothy Baldwin
Member WYLUG, SWP, ANL, Leeds SA, Leeds Anti-war coalition
Stop the EU Copyright Directive!



More information about the gcc mailing list