The Most Efficient Gnutella Client
gtk-gnutella is a server/client for the Gnutella peer-to-peer network. It runs on Microsoft Windows, MacOS and every Unix-like system which supports GTK+ (1.2 or above). The GNOME desktop environment is not required. It is currently developed and tested under Linux (Debian) as well as NetBSD. It is known to run at least on Linux, FreeBSD, NetBSD, Darwin, Solaris, Tru64 UNIX (OSF/1), SGI IRIX, BeOS whereas CPU architectures include x86, AMD64, PowerPC, SPARC, MIPS. And of course Microsoft Windows (XP at least).
gtk-gnutella is free open-source software and released under the GNU General Public License (GPL).
gtk-gnutella is not finished yet, but it is fully functional: you may share, search, and download. And it is stable too, users usually just leave it run unattended for days.
This website follows HTML5 and CSS3 web standards and uses cookies only to record language preferences.
All ideas and comments are welcome to the gtk-gnutella-devel mailing list. Bugs should be reported to the SourceForge.net Bug Tracker
We need additional contributors for C development and documentation
News
25 February 2022, Version 1.2.2 Released
This is a maintenance release with major bug fixes.
There were several shortcomings with bandwidth management: capping was not performed correctly and could overuse uploading bandwidth. Also when the DHT is turned off or on, we need to recompute proper bandwidth stealing.
Corruption of the DHT disk databases could also lead to a crash.
There was a critical old bug in the Dynamic Querying layer that affected Ultrapeers mostly: we could corrupt memory and/or crash when the current node was removed and we were processing a Dynamic Query for that node. This is more likely to happen when running as an Ultrapeer but it could also affect nodes running as leaves, although the probability of that bug happening is much less in that case.
Finally, it is best to not iterate on a global list that could get changed due to a node removal. This was the case when sending pongs to neighbouring nodes, so we now take a private copy.
Improvements
- Extended "props" shell command with -e (exact) and -i (ignore missing).
- The "props" command now takes a set of properties, handled as one batch.
Bug Fixes
- Properly recompute bandwidth stealing on DHT changes.
- Avoid crashing in D-Bus lib when filename is improperly UTF-8 encoded.
- DHT: protect against corrupted database.
bw_available(): fix invalid logic for I/O source capping.pong_all_neighbours_but_one(): iterate on local list.dq_node_removed(): must free dq object asynchronously.
Under the Hood
- Update IRC network information: moved from freenode to libera.chat
- Chunk size limiting for uploads accounts for bandwidth.
- Reduce memory footprint for statx_t if no data kept.
- CQ: defer freeing of dispatched event.
- watchdog: be more verbose within critical messages.
node_parse(): signal to callers when we have BYE-ed the node.cq_event_called(): use better diagnostic on assert failure.dbus_util_send_message(): protect against invalid text.prepare_entry(): ensure entry invariant remains true.wd_expire(): do nothing if watchdog was asleep.
12 July 2021, Version 1.2.1 Released
This is a maintenance release with minor bug fixes.
Note that our project IRC #gtk-gnutella channel is now on irc.libera.chat.
When launching gtk-gnutella and there is a stale lockfile present, listing some PID, and it happens that there is already another process running under this PID, we abort, complaining that another gtk-gnutella is running. However, if the lockfile is really stale, and the PID listed in there has nothing to do with gtk-gnutella at the moment, the user will need to remove the stale lockfile. Hence we show them the command to run, listing the full lockfile path so that it is easy to overcome this little inconvenience!
When using hashtables for memory management, it was possible to trigger a resizing and, during the course of operations, have further memory used, requiring tracking of new items in the same hashtable we were in the process of resizing. That led to double VMM freeing of the region used to store the data.
Add properties to track bytes exchanged by schedulers. These properties track the amount of bytes exchanged by session and are reset to 0 whenever a new user session starts. It allows users to see the actual amount of data consumed by running gtk-gnutella sessions, programatically via the shell interface.
Add -t switch to shell "status" command: this displays the total amount of bandwidth consumed during the session for the different schedulers.
Improvements
- Show command to clean stale lockfile.
- Add properties to track bytes exchanged by schedulers.
- Add -t switch to shell "status" command.
- Make use of libera.chat instead of freenode.
- Expiration time now increased from 1 to 2 years.
- New --no-expire switch to disable GUI popup when expired.
Bug Fixes
pattern_prefix_period(): don't corrupt end-of-block.- Fix subtle recursive resizing bug.
- Do not emit empty leading description in saved properties.
- For time sync over UDP, write replying time later!
hash_table_resize(): clear last cached lookup!ev_link(): insert events in the proper bucket!
Under the Hood
- Updated GeoIP databases.
- Ad
bit_generic_count_set(). - Add
plural_child(). - Add
progstart_was_called(). - Add
H_STRFREEV_NULL(). - Add syn=c to *.ht and *.ct files for vim.
- Add
hash_table_copy_foreach(). - Add
tm_precise_elapsed_ns()convenience routine. - Add
thread_stack_size()to get configured stack size. - Add
pattern_string()to get the string being looked for. - Add
str_2c_from()to grab C string from a given offset. - Add
eval_subst_atom(). - Add
stacktrace_caller_fast()and stack-test program. - Add thread_{un}
suspend(). - Add
tmalloc_contains()for assertions. - Add public VMM validate/invalidate routines.
- Add macros to ease printing for tmval and tmspec.
- Add
node_check()to node traversal loops. - Avoid branches in
SIGN()as well. - Avoid regeneration of Geo DB if no data changes.
- Bump python dependency for jhbuild on OSX.
- Better clock skew computation.
- Handle time-sync exchanges via UDP better.
- Make use of travis cache feature for OSX builds.
- Only include <sys/sysctl.h> if we actually need it.
- Allow compilation with usemymalloc=n on 32-bit CPUs.
- Let
mem_test()run only once. - When no
backtrace(), ensure we compile with a frame pointer. - Compile with -DTRACK_MALLOC -DREMAP_ZALLOC again.
- Made -DTRACK_ZALLOC usable again.
- Do not check stack at
longjmp()if on altstack. - Do not trap hash_list_{new,free}() under REMAP_ZALLOC.
- Ensure properties use
xmalloc()for their values. - Wait until
main()starts to allocate the signal chunk. - Made
ascii_toupper()andascii_tolower()avoid branching. - Trace saving time whithin property files.
- Trace page (PA) and offset within page on SEGV.
- Trace page protection on SEGV faults, if possible.
- Trace how and where symbols were loaded in crash log.
- Symbol quality definition moved to symbols!
- Windows: handle freopen("a") specially to allow read sharing.
- Windows: no need to dump stack again if no gdb.
- mutex: supply more context on lock errors.
- ostream: now also accepts str_t as output medium.
- rwlock: added debug option to track wlock location.
- random-test: added -a to benchmark all routines.
- random-test: add -v to be verbose when -a is used.
- VMM: added extra debugging tools / assertions.
- VMM: trace new compile-time options.
- clock: simplify code by using aging table.
- xmalloc: avoid late page pool creation.
- xmalloc: extended assertions to detect freelist corruption.
- zalloc: avoid warnings when compiling with REMAP_ZALLOC.
- zalloc: with ZONE_SAFE, ensure block tagging never changes!
- malloc.c: enhanced and fixed some errors with multi-threading.
- malloc.c: huge refactoring and cleanup.
aging_destroy(): remove periodic GC before cleanup.bfd_util_init(): avoid warning onbfd_init()call.clock_adjust(): removed MAX_SDEV.clock_adjust(): stop pruning if we keep everything.clock_update(): lowered required amount of data.compat_setjmp(): protect against gone contexts.crash_handler_process(): only callcrash_auto_restart()if needed.ev_free(): assert event is not linked in queue!ev_unlink(): added list consistency assertions.eval_subst(): remove the size limitation on the susbtituted string.evq_close(): be silent if event queue not created.fi_pick_rarest_chunk(): fixed assertion failure.fi_pick_rarest_chunk(): log assertion values.get_prop(): also trace failing property when ps is NULL.ggept_filesize_encode(): can return 0 if given 0.hash_compute_increment(): make it odd without branch.main(): do not set a crash dir if not running for long.name_to_single_host_addr(): usepslist_random().ntp_send_probes(): comment updates, cleanup.once_recursive(): avoid callingstacktrace_function_name().progstart_duplicate(): added assertions.prop_lock(): use macro for locking (hiding lock type).rwlock_deadlocked(): trace write owner if known.spinlock_loop(): document why no memory barrier.statusbar_gui_push_v(): be safe if called early.str_avail(): new implementation and semantics.str_ichar()andstr_istr()can now append.strvec_cpy(): was failing when called with cnt=0.thread_id_name_to_buf(): be nicer with negative IDs.thread_lock_waiting_done(): cleanup when no problems.tok_version_valid(): no longer runclock_update().xcopy(): not defined as inlined routine when TRACK_MALLOC.
14 June 2020, Version 1.2.0 Released
This is an evolution release, hence the minor version bump.
Several cases of bad input (from network) causing assertion failures were fixed. In particular, bad DHT response after a security token lookup or invalid G2 input streams were fatal.
There was also a critical bug, originating from a harmful code typo, which led gtk-gnutella to serve unvailable file chunks from partial files, as if they were available, resulting in unintended download corruption on the remote end!
Thanks to Laurent Gil's efforts, it is now possible to run gtk-gnutella
from a Docker container. See https://github.com/angegar/gtk-gnutella-docker.
Running within docker raised some issues about sbrk() and
thread_self(), which were fixed.
The computation of the build date was fixed, to avoid corner cases where gtk-gnutella would complain it was "old" when freshely compiled from up-to-date sources in a git tree whose "master" branch was only infrequently updated.
The file selector was fixed, to avoid displaying grayed-out folders, a setup wich did not allow one to actually select directories in the preferences.
Many improvements were done to allow smoother uploading for servents with more bandwidth than the recipients. Instead of drastically limiting upload bandwidth (which was negatively impacting everyone), we are now monitoring and adjusting our uploading speed to avoid congestion on the remote end. When stalling happens, we also react quickly to reduce the available bandwidth of the connection, not that of all connections to whom we are uploading.
We also no longer rely on MaxMind GeoIP for providing the IP -> country mappings. Their distribution mode now requires a specific licence which seems totally incompatible with the gtk-gnutella's distribution mode. Instead, we are now using IP2Location, and the GEO_LICENCE file now lists the conditions under which these data are re-distributed (gtk-gnutella transforms the data into a form that it can digest, so we are distributing a modified, derived work, not the original).
If you are still using a version of gtk-gnutella earlier than the 1.1.x series, you are strongly encouraged to upgrade. Starting from this release, we are now considering these versions too old to connect to.
Improvements
- Let --compile-info show which
malloc()is used. - It is now possible to run gtk-gnutella from a Docker container.
- Added details in the README file about required packages to compile.
- Use gradual bandwidth penalty when uploads are stalling.
- Added upload bandwidth capping.
- Forcefully reduce request chunk if b/w is limited.
- Emit a Retry-After header on 416 replies.
- On HTTP 416, emit a Last-Modified header.
- Switched to IP2Location for mapping IPs to countries, dropping MaxMind GeoIP.
- Upload tab now shows our own partial completion ratio, not just "(partial)".
- Detect abuse from HTTP clients not reading payloads.
- Enforce Retry-After softly.
- Ban them when they abuse of the browse-host feature.
- Smarter detection of duplicate incoming Gnutella connections.
Bug Fixes
- [GTK2] Fixed file selector to avoid greyed-out folders.
- [GTK2] Guarantee updating of properties when refresh button is clicked.
- Added emergency path during startup should
sbrk()fail. - Fixed instructions following build.sh run.
- Fixed possible
thread_self()instability at startup. - Fixed backward portability issue with the BFD library.
- Fixed computation of build date.
- Fix 2 harmful typos, affecting serving of partial files.
- Regenrate Configure to fix gccversion usage bug.
- Restored compilation of a standalone local shell.
- Remove executable permissions on C source file!
- Rename our ARC4 interface on systems with native
arc4random(). - Updated all files to fix obsolete FSF postal address.
- Avoid banning hosts issuing legitimate upload requests.
- Implement GNU extension
malloc_usable_size()when using ourmalloc(). - UHC: when hardwired list is exhausted, reload it.
- Make Content-Range and Content-Length prioritary headers.
ban_allow(): was never returning BAN_FORCE.download_reply(): reload available ranges after 416 if needed.download_stop_switch(): forgot to remove passive queue indication.gtk_gnutella_exit(): must close UPnP layer before HTTP.http_send_status(): reworked to avoid undue header truncation.node_g2_read(): fixed faulty assertion.pb_token_found(): be more robust against unexpected input.search_gui_close_search(): avoid crash when emptying search list twice.update_available_ranges(): revisited range processing logic.upload_416_extra(): was generating non-compliant headers.vmm_dump_pmap_log(): fixed deadlock.download_moved_with_bad_sha1(): always reset fileinfo.file_info_reset(): also discard previous TTH info.
Under the Hood
- Added temporary "xk" country code for Kosovo.
- Added
vmm_type_pointer()to determine region type. - Add lingering period for unreferenced file_descriptor objects.
- Add shell command "show files -d" to list currently used file_descriptor.
- Raise minimum b/w scheduling slot to 256 bytes per second.
- Fixed
HashGenericCat()in Jmakefile, leading to wrong .c dependency. - Fast assertions are a must for GTKG nowadays, always compile with them.
- Do not post multiple randomness generation messages.
- Split bit_generic routines into .ht and .ct.
- Reserve
file_object_close()for user code. - Made it possible to compile with TRACK_MALLOC again.
- Improved "thread elements" shell command to trace callback function names.
- Avoid VMM magazine allocation when running with TRACK_MALLOC.
- Enhanced TRACK_MALLOC to be able to trap
xalloc()as well. - Enhanced TRACK_MALLOC debugging power with MALLOC_CATCH_MALLOC.
- Extended
bool_to_string()to display value if not 0 or 1. - TEQ: optimize I/O events by posting them directly to I/O queue.
- VMM pmap logging shows allocated size per fragment type.
- Removed gone / probably gone logic for discovered threads.
- Ensure
thread_atexit()callbacks run in discovered threads. - Ensure
walloc0()redirects to underlying zeroing routines, for statistics. - Simplified shell I/O condition management and logging.
- Separate Gnutella and HTTP (upload) banning categories.
- STATIC_ASSERT: use a more compact version for less verbose errors.
- Made thread exit value read-only in
thread_atexit()callbacks. - Emit thread mask in crash logs upon detected deadlock.
- ADNS: the cache is now thread-safe and cached replies shuffled.
- ADNS: added expiring periodic callback for cached DNS entries.
- Added new "adns_debug" property for ADNS debugging.
- Avoid
g_memmove()which has been deprecated. - Added
ripening_contains()andripening_update()routines, not used yet. - Optimize ripening table when no value is kept.
- Use aging table to track download mesh sending times.
- Use 429 instead of 550 for "Too Many Requests".
- Remind less often about banning status.
- Let emulated
alloca()cleanup when thread exits. - Ensure
alloca_stack_direction_compute()is never inlined. - Smarter detection of duplicate incoming Gnet connections.
- xmalloc: must "embed"
xstrdup()andxstrndup(). - xmalloc: simplified allocation entry points.
- xmalloc: ensure stricter memory alignment when
xmalloc()replacesmalloc(). ban_delay(): fixed to return remaining ban time.ban_force(): read incoming data beforeshutdown().ban_vendor(): GTKG earlier than version 1.1 deemed too old.bitcmp(): usememcmp()for byte comparison.bool_to_string(): added carp trace to help spot the culprit.cq_cancel(): fix logic to return TRUE if event was NULL.crash_deadlocked(): no longer dump stacks.crash_handler(): enter thread crash mode before signal cleanup.crash_time_internal(): usethread_safe_small_id()in raw mode.download_queue_delay_switch(): explicitly turn off queuing if switching.download_queue_v(): explicitely reset passive queuing info.download_reply(): Content-Length not necessary if Content-Range.download_send_push_request(): trace server GUID.erbtree_foreach(): added cheap safety assertion.evq_trampoline(): cleanup event if cannot signal thread.extract_retry_after(): ensure amount in seconds is the only value.fi_pick_rarest_chunk(): be smarter about selected chunk.fi_pick_rarest_chunk(): ensure first free chunk is available.hcache_fill_caught_array(): fix array fill logic.http_send_status(): ensure generated header has trailing CRLF.local_shell_mainloop(): must flag "writable" on POLLHUP.mingw_exception_log(): use static variables and be more careful.natpmp_handle_discovery_reply(): trace inconsistent replies.natpmp_handle_mapping_reply(): trace inconsistent replies.parq_upload_send_queue(): tie PARQ upload queue and upload.pcache_pong_received(): also validate changing ports.- rand31: avoid race condition during intial seeding.
random_pool_append(): ensure no endless recursion, ever!send_pproxy_error_v(): remove dead code.shell_handle_event(): alwayswrite()when having pending data.shell_handle_event(): on exception, setup EOF/shutdown.shell_write_data(): make sure to flush as much as possible.sig_compute_pc_index(): be paranoid about optimization.signal_name(): contort to avoid gcc-10 warning.signal_trap_with(): avoid kernel signal desynchronisation.signal_uncaught(): dump stack trace if harmful signal.sorted_array_lookup(): sort array if they forgot to do it!spinlock_deadlocked(): capture lock status early.stacktrace_atom_lookup_and_store(): trace race conditions.stacktrace_load_symbols(): do nothing if too early.thread_create_full(): keep async exit callback separated.thread_deadlock_check(): disable locks when deadlock is certain.thread_deadlock_check(): only dump stacks of involved threads.thread_stack_check_overflow(): also log used stack size.upload_remove_v(): create better logging message.vmm_malloc_inited(): now only called internally.xmalloc_show_settings_log(): trace chosen memory alignment.zgc_zalloc(): transformed some assertions into verbose ones.
