I haven't really made any extensive use of the following, but they're pretty well known (whatever that may be worth to you):
Edgewall Trac - bug and project management. Integrates with
Subversion. Written in Python using SQLLite as a backend.
Bugzilla - probably the best known of the open source bug trackers. Written in Perl with MySQL or PostgreSQL as backends.
Gemini - a decent ASP.NET/Sql Server solution with a free 10 user (or for an open source project) license. Also has a desktop client (in beta, last I looked) and web services support.
BugTracket.NET - another ASP.NET solution.
As for helpdesk software, the only free one I've ever used is
Liberum. It's in (classic) ASP, but was pretty decent the 4 or so years ago that I deployed it. I'm sure there's a million and one LAMP style apps out there now though.