Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jun 2008 21:53:57 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>, Chuck Robey <chuckr@telenix.org>
Subject:   Re: git problems
Message-ID:  <20080604195357.GD1176@hoeg.nl>
In-Reply-To: <20080604191137.GC1028@server.vk2pj.dyndns.org>
References:  <4845AC84.6040407@telenix.org> <TbQi51CAu4j4cFDkKULTI53ON0k@8ZdGo3QYE5K669Y/W2Z6ZKf2XtY> <4846A77B.9060603@telenix.org> <L4F%2B2AmHcL4Uix8Rch4QiSpqQwc@RzJPyOBFuChtvuf1tf1krA3%2BwkI> <4846B40A.4010309@telenix.org> <20080604191137.GC1028@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--veXX9dWIonWZEC6h
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Peter Jeremy <peterjeremy@optushome.com.au> wrote:
> On 2008-Jun-04 11:26:02 -0400, Chuck Robey <chuckr@telenix.org> wrote:
> >#3  0x08066467 in unlock_pack () at builtin-fetch.c:56
> >#4  0x2848b5f3 in __cxa_finalize () from /lib/libc.so.7
> >#5  0x2843b1aa in exit () from /lib/libc.so.7
> >#6  0x0804b0e3 in handle_internal_command (argc=3D2, argv=3D0xffffffff) =
at git.c:379
> >#7  0x0804b7ed in main (argc=3D2, argv=3DCannot access memory at address=
 0x12) at git.c:414
>=20
> __cxa_finalise() is part of the atexit() processing - the source comments
> imply it handles shared object destructors.
>=20
> >379                     exit(run_command(p, argc, argv));
> >380             }
> >
> >First I want to comment on that weird line 379, because while it
> >might work, it sure seems to me to be a very strange and wasteful way
> >to do a fork.
>=20
> There's no fork involved.  It's just shorthand for:
> 	return_code =3D run_command(p, argc, argv);
> 	exit(return_code);
> By the time exit() is invoked, run_command() has completed.
>=20
> >  Second, the second argument to handle_internal_command seems to
> >have been a argv=3D0xffffffff, which is very obviously a bad string
> >pointer
>=20
> Note that argv in main is also corrupt.  I suspect gdb is confused by
> the level of optimisation being done by gcc.
>=20
> In a later posting, you indicate that there's a double-free bug.
> Possibly unlock_pack() is being registered as a destructor (or
> similar) _and_ is being explicitly called.  Without studying the
> code, the solution is probably to either skip the explicit cleanup
> (leaving just the destructor processing) and/or flag freed data (ie
> NULL pointers after freeing them).

I just solved this on my systems by removing the call to free(). I know,
it's awful, but it was good enough for me to live with on short term.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--veXX9dWIonWZEC6h
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkhG8tUACgkQ52SDGA2eCwWWqwCfWyeNg9NWoU7PZGJ9w4//aU5v
5NAAn0O4MRYjFZFv3lY5dvF2OmKMXC6v
=7ivG
-----END PGP SIGNATURE-----

--veXX9dWIonWZEC6h--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080604195357.GD1176>