-
Notifications
You must be signed in to change notification settings - Fork 42
/
ChangeLog
9112 lines (8131 loc) · 453 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# v 1.1.13 2017-10-22 [stable]
This release primarily addresses issues that were left-over in 1.1.12.
Do not use that previous release, migrate from 1.1.11 to 1.1.13 directly!
The main issue was that of Partial File Sharing. Numerous bugs, dating from
7 years or more, were lurking because my local configuration had switched PFS
off for testing, and it had never been turned back on! In particular,
completed files were not properly shared, it was not possible to upload their
THEX since it was not recomputed, and the files were not properly indexed in
the Query Routing Table due to bugs in the background task layer.
In case of a crash, we now dump the value of all the Gnutella properties to
be able to spot configurations that deviate from the norm. Too many bugs
were reported and ignored because they could not be reproduced, often due
to not having the same setup when attempting to debug!
Another nasty bug was fixed: it was not possible to change the IP support
configuration without causing an immediate crash. The reason is due to a
change that was integrated in 1.1.12 to allow IPv6 UDP traffic from G2 nodes.
The problem was that this created an extra client stack on top of the
low-level UDP traffic scheduler and it was not properly cleaned-up when
switching IP configurations, leading to an assertion failure!
New Features:
Improvements:
- Append all Gnutella properties to the crashlog file.
- At startup, do not needlessly request TTH if we have it cached already.
- Optimized requests for library scan / QRP rebuild, avoiding multiple events.
- Allow TTH computation for seeded files.
- Obsolete and stale entries are now removed from the SHA1 cache.
- [GTK] Added GUI events on more fileinfo changes.
- [GTK] Show information about recomputed TTH for seeded files.
- Prune unshared entries from SHA1 cache at startup.
- Persist information about seeded files in the ASCII fileinfo database.
- Remove unneeded libraries from the default GTK2 ldflags.
Bug Fixes:
- Was not able to properly seed completed files; fixed shared_file_path().
- Was not always updating QRP on the UP side after a library change.
- Could have background tasks stuck after cancelling a multi-ref'ed one.
- Dynamic querying timeout was not properly computed (made too small).
- Changing from "IPv6 & IPv4" to "IPv4 only" mode caused a crash.
- Restored ability for "shutdown -r" to work.
Under the Hood:
- Added prop_to_typed_string().
- Added s_where() to log a stacktrace on stderr only.
- Added tt_slice_size() to compute slice length per leaf in the TTH.
- New crash_dumper_add() to register crash dumper callbacks.
- No panicing when thread cannot block but was actually suspended.
- Was unduly offsetting stacktrace by one extra level.
- bg_sched_sleep(): don't reduce runcount on exiting task!
- bg_sched_timer(): added run count consistency check.
- bg_sched_timer(): fixed logging of task's run time.
- bg_task_cancel(): log task address as well, not just the task name.
- bg_task_wakeup(): must clear user sleeping flag.
- crash_restart_notify(): use smarter crash_exit().
- crash_try_reexec(): suspend other threads as a precaution.
- deflate_flushed(): suppressed soft assertion.
- dq_results_expired(): fixed improper timeout computation.
- fi_free(): cut any pending reference by uploads!
- fi_tigertree_check(): more verbose in case of errors.
- file_info_moved(): must update fi->modified as well.
- file_info_remove_source(): removed unused discard parameter.
- file_info_retrieve(): also validate that DONE is consistent.
- file_info_shared_sha1(): do not share bad files.
- get_file_to_upload_from_urn(): factorized code.
- huge_update_hashes(): enforce one sync of SHA1 cache every minute.
- huge_verify_callback(): use shared_file_indexed().
- node_udp_disable(): was not disabling the G2 UDP IPv6 node.
- parse_and_append_cache_entry(): discard obsolete / stale entries.
- qrt_compressed(): fixed outdated comments.
- qrt_diff_1(): was never considering change.
- request_sha1(): don't request TTH if we have it cached.
- shared_file_fileinfo_unref(): clear fileinfo pointer.
- shared_file_from_fileinfo(): copy TTH atom as well, if any.
- shared_file_is_shareable(): be stricter for partial files.
- shared_file_path(): must process sf->fi correctly!
- upload_file_present(): loudly warn when completed file changed on disk.
- upload_file_present(): loudly warn when file not shareable.
- verify_update(): loudly warn when "progress" callback stops processing.
# v 1.1.12 2017-09-20 [stable]
This release fixes a very critical bug that was only manifesting when Partial
File Sharing was turned on, and which caused possible memory corruption (leading
to a sure crash later) when enqueuing new files for downloading.
New Features:
- Throttle browsing requests to one per hour from a given IP.
- Limit uploads to stalling hosts to 1, regardless of user settings.
- [GTK2] Show proper average data speed on completed uploads.
Improvements:
- Added "WSHR" vendor code for WireShare.
- Added "ENVY" vendor code for Envy.
- Do not attempt costly operations after a crash / auto-restart.
- Updated FAQ -Uploads and Sharing-
- Use 64-bit variables for bandwidth computations.
- Make sure early stalling is not always reported for the same IP.
- Use even HTTP outgoing bandwidth as the last measure when stalling.
Bug Fixes:
- Allow IPv6 UDP traffic from G2 nodes.
- Be sure to use destructive list iteration with tmalloc_free_magazine().
- Critical upload HTTP statuses are now fully sent.
- Must give plain (untranslated) strings to send_upload_error().
- bg_task_finished(): now calls safer bg_task_dead().
- file_object_open_from(): also catch EROFS when opening file.
- node_bye_v(): do not call node_remove_v() for G2 nodes.
- vendor_code_get_name(): fixed validation of unknown code tokens.
- verify_next_file(): fixed wrong argument order in log message.
Under the Hood:
- bfd_util: reworked mutex grabbing in an attempt to avoid deadlocks.
- binary_hash(): disperse bits in initial hash value.
- check_for_events(): optimize path if timeout is 0 or we collect events.
- cq_event_called(): only zero variable holding event when asked!
- cq_zero(): now always nullify the event, as the name suggests.
- crash_setmain(): avoid spurious warnings with recent gcc.
- english_strerror() and symbolic_errno() made thread-safe.
- inputevt_timer(): factorized common code into new inputevt_handle().
- socket_udp_flush_queue(): do not process anything if we cannot devote time.
- stack_sym_trylock(): avoid deadly recursions through stack lock dumping!
- thread_sig_handle(): use atomic exchange operation to clear pending set.
- u32_ptr_hash(): discard lower bits of the multiplication as well.
- upload_timer(): clear the stall flag when it is over.
- Added aging_record() to simplify code for plain keys.
- Added cq_event() to acknowledge reception of events we do not track.
- Added "inputevt_trace" property for tracing dispatched I/O callbacks.
- Added english_strerror() to guarantee English messages.
- Added thread_signal_has_pending() and thread_signal_process().
- Added "lock_sleep_trace" and "lock_contention_trace" properties.
- AJE: changed pool #0 filling policy and reseeding checks.
- Ensure misc_init() is called before using lookup tables.
- Simplify is_ascii_*() by performing table lookup.
- Thread runtime now allows a signal handler to run within another one.
- Updated UHC list, fixed obsolete port numbers.
- Use new cq_event() in thread callout events to avoid possible leaks.
- Watchdog: revisited logic to do more under lock protection.
# v 1.1.11 2016-11-11 [stable]
This release fixes a portability issue on FreeBSD and introduces a main core
feature and minor new GUI features.
The main feature is the addition of "equivalence classes" defining word
aliases, used when sharing files and querying for them.
Currently, the only supported equivalence class deals with naming of series.
Indeed, there are various conventions that can be used to represent these,
and it makes searching inefficient: either one will lookup for all the
possible variations, or one will miss some of the files.
For instance, episode #8 of an hypothetical season #4 can be represented by
any of these strings:
{ "s04e08", "4x08", "408", "04x08", "0408" }
Thanks to the equivalence class, a file bearing one of these strings can
be searched for (and located successfully) by using any of the other strings.
Of course, since this is a local processing, the more servents out there are
deployed with this aliasing support, the more efficient the feature becomes!
There are also new GUI features: the "Clear completed" button from the Download
pane is now doing someething useful, and the current page of different notebooks
is remembered across sessions. The only one which is not restored on normal
resuming is the main notebook tab. It will be restored if GTKG is restarted
after a crash, but otherwise the application will always start up within the
Network tab.
In the Uploads tab, upload requests coming from a G2 servent will now be
flagged with a "[G2]" tab right after the IP address. This helps seeing how
the Gnutella and G2 network unification is evolving.
New Features:
- Flag uploads coming from G2 servents with a "[G2]" tag after IP address.
- Added alias support in sharing/querying.
- Made the "Clear completed" button in Downloads/Tools do something useful.
- Moved "Clear completed" button to the bottom right of the download pane.
- Remember fileinfo notebook tab number across sessions.
- Remember main notebook tab number across sessions, only restored after crash.
- Remember Gnet stats notebook tab number across sessions.
- Remember download info / tools notebook tab number across sessions.
Improvements:
- Added --cleanup to explicitly request for final memory cleanup sequence.
- Updated Italian translation.
- Updated GeoIP databases.
Bug Fixes:
- Leaf nodes could end-up being connected to more ultrapeers than configured.
- Fixed monitoring of alien threads, important when GTK file selector is used.
Under the Hood:
- Debian compatibility level changed from 4 to 5.
- Make sure we can deal with older pkg-config, which needs leading arguments.
- Use "embedded" symbols for xmalloc(), xfree() and friends.
- Added "query_trace" property to trace all queries which were searched.
- Moved halloc-based string functions like h_strdup() to dedicated hstrfn.c.
- Expanded search mask to 64 bits to be able to hold all digits and letters.
- Count aliased queries and hits from aliases.
- Pre-compute shared file media type at record creation time.
- Pass query limits to st_search() to avoid needless pattern matching.
- Added h_strsplit() and h_strsplit_set().
- Added strvec_append_with() to expand vector by appending another vector.
- crash_assert_logv(): don't call crash_mode() if assert failure was recorded.
- entropy_clock_time(): mix the entropy nonce through hashing for more diffusion.
- node_can_accept_connection(): only send headers back when handshaking.
- qrp_add_file(): optimized to avoid computing word length if not required.
- thread_stack_check_overflow(): ignore virtual addresses outside stack range.
- vmm_init_once(): ensure any shared library for stacktrace unwinding is loaded.
# v 1.1.10 2016-09-01 [stable]
This is mostly a bug-fixing release and should be the last update on the
1.1.x release tree, before important core changes in the upcoming 1.2.
Improvements:
- FAQ cleanups.
- Added the ".ape" file extension to the default list of shared files.
- Remember hosts to which a TCP connection failed recently to avoid hammering.
- Updated French and Turkish translations.
- Updated GeoIP databases.
Bug Fixes:
- Don't embed build date if SOURCE_DATE_EPOCH is set for reproducibile builds.
- Missed ":" in variable substitution request, in scripts/nm-list
- nm-list: fixed date computation on BSD systems.
Under the Hood:
- Need TLS 2.12 to generate an X.509 self-signed certificate.
- Added G_PRINTF() hint to tls_logfmt() and tls_cert_log() to avoid warnings.
- Fixed CPP file inclusion protection symbol for lib/mime_type.h.
- Added the "ape" MIME type linked to the ".ape" file extension.
- Ensure we do not suspend threads during an interrupt.
- Track where context was taken in our setjmp wrappers to ease debugging.
- Keep track of "once" initializations in case we end-up recursing.
- Trace which new lock is overflowing the lock stack.
- once: make sure we can insert routine in our tracking table.
- once: arbitrarily limit nesting level in one thread to 32.
- dht_update_size_estimate(): return if our KUID was not initialized yet.
- keys_reclaim(): we can have values attached to key if we can remove it.
- symbols_load_from(): must release write lock when falling back to pre-computed.
- thread_element_block_until(): was not checking for concurrent unblocking.
- thread_element_block_until(): revisited signal handling.
- thread_suspend_others(): don't wait for busy threads already marked suspended.
- walloc: prevent race condition on walloc_stopped being set.
# v 1.1.9 2016-03-06 [stable]
This is mostly a bug-fixing release.
It fixes an important bug in the UPnP discovery path that led to a crash when
it found more than one UPnP device on the network.
It also introduces a new Glossary that can be displayed to explain some terms
that may be hard to understand for newcomers, so that they may in turn benefit
from the tooltips and the information in the FAQ.
On Windows, one important change is that we now force all memory allocations
from the external DLLs to use our own malloc() implementation. This proves
that one of the DLLs is exhibiting a memory leak. Plugging that leak will
unfortunately require that a garbage collector be implemented. Measurements
indicate that 4K leak every second on average, which eventually leads to an
out-of-memory crash after a few days (2 to 3), preventing high uptimes on
Windows. The leak is not originating from gtk-gnutella's code.
Improvements:
- [GTK2] Added menu to display the new glossary window.
Bug Fixes:
- Define PTHREAD_STACK_MIN to 0 in case it is not supplied by <pthread.h>.
- can_become_ultra(): don't account for upload fds if no upload will take place.
- compat_sleep_ms(): fixed the fallback implementation using compat_poll().
- dht_route_parse(): ensure we never use uninitialized variables.
- entropy_collect_host(): no longer attempt to get the host IP addresses.
- file_locate_from_path(): if pathname is qualified, duplicate argument!
- ftw_foreach(): prevent memory leak on error path.
- thread_lock_deadlock(): avoid de-referencing NULL if possible.
- upnp_discovered(): avoid segfault when we have to pick the first device.
Under the Hood:
- Disable warnings about the mem vtable being deprecated in recent glib.
- Suspend threads created after a global suspension is in effect.
- Warn when we cannot find a thread to record / release a lock.
- Added a new crash-level for deadlocks.
- Added optional debugging code to track reading threads on a read-write lock.
- Added spinlock_in_crash_mode_raw() for raw spinlocks to avoid deadly recursion.
- Additional debugging code to track read spots per thread on a read-write lock.
- Added backtrace capture when threads are contending for a lock.
- On deadlocks, suspend the other threads and log origin quickly before handling.
- New strategy in lock "deadlock" routines: ignore when in pass-through mode.
- Do not perturb the lock waiting state of the crashing thread on a deadlock.
- Revisited thread_lock_deadlock().
- Check for stack overflowing each time a lock is grabbed and recorded.
- Added thread diversion support.
- Added thread_halt() to forcefully halt concurrently crashing threads.
- Refactored memory checks to avoid systematic locking in mem_is_valid_ptr().
- Try to divert crash processing to main thread when triggered in a sub-thread.
- On deadlock condition, attempt to collect stacktraces of other threads.
- Add the current process PID and the last crash level to the crash log.
- Use raw logging routines in spinlock / mutex deadlock tracing.
- Added crash_getpid() for safe original PID computation, even across a fork().
- Add dump of all the thread stacks to the crash log if we can't fork().
- Moved equiv() and implies() definitions to "casts.h".
- Added xxx_to_string_grp() to optionally format xxx with thousand groupping.
- Adding win32 dynamic library patcher to trap malloc() in all required DLLs.
- Windows: with win32dlp, no need for monitoring committed memory.
- Renaming of legacy G_GNUC_XXX into G_XXX for concision.
- Renamed G_N_ELEMENTS as N_ITEMS.
- Moved gcc-specific macros to a dedicated file.
- Added pragmas to shut up spurious warnings with the clang 3.4.1 compiler.
- On the lock recording path, we can now use thread_get_element() safely.
- Made sure symbols are thread-safe and properly locked.
- If stacktrace dumps could intertwine, prefix the second with the thread ID.
- Allow for nested lock waiting sequences.
- Added SIGSYS to the list of harmful signals we want to catch.
- Added THREAD_F_WAIT to let thread_create() wait for the new thread to start.
- Windows: was not reconstructing correct stack frame pointer for WINAPI calls.
- Windows: improved backtracing through routines using a large amount of stack.
- Made signal_enter_critical() and signal_leave_critical() thread-safe.
- Made signal_in_handler() thread-safe.
- No longer block signals when waiting for a read-write lock.
- Prevent signals during logging, to avoid recursion if logging from handler.
- rwlock: when waiting for too long, deadlock only when no activity is seen.
- Added hash_table_is_locked().
- Added compat_gettid() and use it to record the system thread ID.
- Added support for thread_interrupt() and thread_os_kill().
- Windows: make sure s_read() can return EINTR and handle it properly.
- Windows: added support for sigprocmask(), sigsuspend() and friends.
- xmalloc: count and loudly trace allocation attempts made from signal handler.
- omalloc: loudly warn when invoked from signal handler.
- VMM: warn when memory allocation / freeing attempted from signal handler.
- VMM: use groupped formatting for region sizes or large numbers.
- Make sure we do not dispatch thread signals when running in an interrupt.
- Added s_minicarp_once() and a circular buffer to avoid memory allocation.
- Monitor when we issue blocking syscalls to flag signal handlers as safe/unsafe.
- Added plumbing to allow longjmp() or siglongjmp() in a signal handler.
- booleanize(): use version not causing any jump, for speed.
- clamp_strlen(): use same optimization as utf8_strlen() to compute length.
- mingw_analyze_prologue(): fixed MOVL immediate offset parsing.
- mingw_exception_log(): simplify processing on stack overflows.
- mingw_getdtablesize(): don't call _getmaxstdio(), hardwire 2048 instead.
- mingw_signal(): only call signal() for SIGSEGV.
- mingw_sigraise(): only log sent signal when asked to.
- mingw_waitpid(): fixed compilation warning given that WAIT_OBJECT_0 is 0.
- mingw_win2posix(): added mapping for ERROR_INVALID_USER_BUFFER.
- mingw_win2posix(): added mapping of ERROR_NO_SYSTEM_RESOURCES to ENOMEM.
- mingw_write(): for Windows 7 and maybe later, do not call write().
- mutex_is_owned(): optimized by avoiding thread_self() call if mutex not locked.
- prop_save_to_file(): use file's timestamp, not the current time.
- rwlock_not_owned(): ignore errors when the rwlock layer is in pass-through.
- s_logv(): made recursion detection thread-safe.
- s_logv(): use raw time computation when running in signal handler.
- s_minierror(): enhanced to enter crash mode immediately and show thread ID.
- s_rawlogv(): force "raw" mode when running in a signal handler.
- s_stacktrace(): downgrade from decorated to plain stack before skipping traces.
- signal_name(): added more items to signals[], so cache linear lookup result.
- spinlock_grab_try_from(): no crashing mode, don't say we locked if we couldn't.
- stacktrace_get_symbols(): make sure we're running this only once.
- stacktrace_unwind(): detect recursion in a thread-safe way.
- stacktrace_unwind(): use gcc-style unwinding if recursing or within malloc.
- str_vncatf(): added verbose assertion to ensure string is not overflowing.
- symbols_name_only(): simplified code.
- symbols_name_only(): simplify processing if we don't have to format an offset.
- thread_check_suspended(): account for thread_find() returning NULL.
- thread_cond_waiting_element(): don't create the cond stack until necessary.
- thread_exiting(): do not reset the QID range on Windows for an exiting thread.
- thread_id_name(): be robust if called during crashes.
- thread_launch_trampoline(): do not harvest entropy, this slows down creation.
- thread_lock_got_swap(): missed accounting of new lock in discovered thread.
- thread_lock_waiting_element(): warn when we detect recursive lock waiting.
- thread_preallocate_element(): also pre-allocate the lock stack.
- thread_sig_handle(): don't handle signals if thread is supposed to be blocked.
- thread_small_id(): bet on the QID lookup success.
- thread_sp(): simpler version defeating compiler optimizations.
- tm_localtime_raw(): use exact time, as this is used during logging.
- xmalloc_thread_alloc(): refuse to allocate if within a signal handler.
# v 1.1.8 2015-12-18 [stable]
This is an emergency bug-fixing release.
It addresses systematic crashes on some platforms, right at startup time,
and prevents random deadlocks on OS/X.
The systematic crash was due to an innocent change, which actually perturbed
the order of the initialization routines and, depending on the conditions,
caused an assertion failure during one of the thread startup. Curiously, the
error manifests randomly and does not seem to depend on the OS but rather on
other subtle environment issues: one Linux distribution could be fine whilst
another was hit by the bug.
# v 1.1.7 2015-12-13 [stable]
This release adds support for new features:
- TLS upgrade of existing connections.
- Inbound HTTPS connections
- Use of a supervisor process to relaunch gtk-gnutella on crashes
The TLS upgrade allows connections that have started without TLS to negotiate
TLS on the fly without having to reconnect. They are flagged as "e" to show
that encryption was dynamically added, as opposed to "E" which indicates an
initial TLS connection.
Certificates are now automatically generated and this allows HTTPS connections
from browsers. For now this is of limited use, but it will come handy in the
near future when building a web-enabled GUI.
To be more resilient against crashes, gtk-gnutella now automatically launches
a supervisor process that will launch the real gtk-gnutella as a child process
and monitor its fate, restarting a new process when the old one failed. This
is far more robust than having the process re-exec() itself at crash time since
there are some crashing conditions that do not even allow the process to go
that far in the crash handling...
On Windows, provided you have installed Cygwin's gdb, crash logs will now
contain a gdb backtrace of the failing process, making analysis of what went
wrong easier than with a simple stack trace.
Your previous GUID and KUID will be regenerated the next time you restart due
to a new algorithm used to detect that a configuration file is not accidentally
reused on another machine: the host name is now included, instead of just the
physical file information. So when moving a disk to another machine, or simply
cloning an existing virtual machine, we are no longer going to reuse these
IDs which are supposed to be unique by properly detecting that the information
was copied over.
A bug in open_read() caused the Geo IP database to not be loaded on Windows.
Finally, all the options given to gtk-gnutella can now be abbreviated as long
as they are not ambiguous (i.e. enough is given to make them non-ambiguous).
For instance, given the current set of options, --p would be ambiguous but --s
will always mean --shell. However, --pi is not ambiguous and refers to --ping.
Improvements:
- By default, gtk-gnutella now supervises its children to restart them.
- Now allows incoming HTTPS connections.
- Added support for Gnutella connection upgrade to TLS.
- Added support of RFC-2817 for upgrading to TLS within HTTP/1.1.
- Dump symbolic stack when crashing in supervised mode with our parent.
- VMM: added new flag to signal OOM condition and be aggressive with the cache.
- Options can now be abbreviated as long as they are not ambiguous.
- Added support for Virtual Memory Emergency Allocation (VMEA).
- Pulled latest translations from Transifex.
Bug Fixes:
- Make sure node_by_guid() cannot return a G2 node!
- VMM: fixed memory allocation logic during crashes.
- open_read(): fixed logic on Windows when no renaming is requested.
- Make sure we don't restart nor pause a failing process on --shell or --ping.
Under the Hood:
- Added spopen(), a simple popen() bypassing the shell.
- Added Windows-specific PROT_GUARD protection type for mprotect().
- Added log_show_pid() to direct the logging layer to show or hide the PID.
- Added library support for file locks.
- Added compat_process_exists() and compat_kill_zero().
- Added ability to dynamically limit walloc() usage, remapping to xmalloc().
- Added ability to disable halloc() at runtime, remapping it to xmalloc().
- Added specific PID file for locking out the supervisor process.
- Do not install periodic xgc() and zgc() unless running in a long-term process.
- Refactored main() initializations to limit memory usage in the supervisor.
- Windows: stop fatal recursion when the VMM layer extends the pmap.
- Windows: revisited exception logging to give more details and simplify code.
- Windows: reworked stack overflow detection logic.
- Windows: added launch() and spopen() support.
- Windows: added support for wait() and waitpid() on launched processes.
- Windows: launch gdb in a separate thread to get symbols when crashing.
- Windows: re-worked early init code to allow memory allocation.
- Windows: will now be building with gnutls-3.4.5.
- Windows: added getppid() support.
- Windows: added getuid(), geteuid(), getgid() and getegid() emulations.
- Windows: try to have SymInitialize() done as soon as possible.
- Windows: added support for getrusage(RUSAGE_CHILDREN).
- Make sure the logic used to construct fallback path is consistent.
- Refactored Windows socket initialization.
- Refactored setproctitle(), adding getprogname() and setprogname() as well.
- Revisited crash_mode() to include the notion of criticity level.
- Switched rand31() to the Park and Miller algorithm.
- SDBM: added fadvise() hint for page accesses, with a "random" access mode.
- Use short_time_ascii() instead of short_time() in log messages.
- TLS: use our own random number generators.
- TLS: use new types, with the _t trailing prefix.
- TLS: added support for a global audit log, available since gnutls 3.0.
- TLS: added vectorized push routine.
- TLS: added generation of private server key at startup if missing.
- TLS: don't need anonymous server credentials if we have a certificate.
- TLS: added generation of self-signed certificate at startup if missing
- TLS: removed ARCFOUR-40 from the list of overrides for GnuTLS 3.4.5.
- TLS: enhanced to support GnuTLS 3.x and allow HTTPS connections.
- TLS: the "custom I/O" push/pull routines are now the norm.
- TLS: normalized logging to always use G_STRFUNC for non-informative messages.
- mingw_fcntl(): return ENOSYS for unimplemented parts, not EINVAL!
- mingw_fcntl(): added F_RDLCK (read-lock) support for F_SETLK operations.
- mingw_sigraise(): trace signal, since it could be the prelude to a crash.
- cq_init(): loudly warn if the callout queue was created automatically before.
- cq_init(): always warn if callout queue exists, regardless of its thread.
- pncs_convert(): avoid using the stack, prefer a thread-private buffer.
- sdbm_set_volatile(): forgot to grab lock on entry.
- sdbm_thread_datum(): avoid too many re-allocation overhead, sacrificing memory.
- thread_launch(): warn once if pthread_attr_setstacksize() returns an error.
- gwc_parse_dispatch_lines(): avoid using "eof", it shadows a global on Windows.
- thread_launch_register(): force new PROT_GUARD protection on red-zone page.
- shell_exec_thread_list(): use configured stack size if available.
- spinlock_crash_mode(): dump PID as well in case process forked.
- crash_invoke_inspector(): also attempt to launch gdb on Windows.
- crash_invoke_inspector(): force emission of decorated stacks.
- crash_generate_crashlog(): dump thread locks before current stack.
- settings_random_save(): now merge randomness instead of just superseding it.
- crash_init(): now calls stacktrace_init() with immediate symbol loading.
- mingw_exception(): maintain exception recursive depth per thread.
- signal_perform_cleanup(): trace signals we get during cleanup.
- mingw_signal(): be thread-safe, in case of concurrent updates.
- tm_init(): now controls whether to start the time thread.
- vxml_parser_remove_buffer(): application logic was done only when debugging!
- crash_try_reexec(): do not exec() ourselves when we have a supervising parent.
- node_can_accept_connection(): even when "offline", accept nearby hosts.
- tls_handshake(): log IP:port and whether remote is client or server.
- SHA1_process_message_block(): make sure SHA1 is correct on big-endian systems.
- node_is_now_connected(): watch out for disconnected nodes after RX injection.
- download_get_server_name(): when name changes, reset some internal attributes.
- entropy_seed(): make sure we're correctly seeding our KISS RNG.
- gtk_gnutella_atexit(): do nothing if we're already crashing.
- unique_file_token(): include the hostname into the unique file ID.
- kuid_random_fill(): use random_key_bytes() to generate unique KUID.
- file_locate_from_path(): tweaked for Windows to add implicit "." in PATH.
- xallocate(): when crashing, use omalloc() for small blocks, instead of sbrk().
- hash_table_replace(): fixed logic when inserting into a fix-sized table.
- stack_print_decorated_to(): switch to lighter tracing if we hit an OOM.
- mingw_execve(): redesigned to avoid using external resources.
# v 1.1.6 2015-11-08 [stable]
This is a bug-fixing release.
This time it focues on Windows, which apparently exercised some bugs in
common code with other platforms -- so some fixes are going to benefit to
everyone even though the bugs did not manifest themselves as often.
Improvements:
- Increased default and max for "max_leaves" to account for modern systems.
- Pulled latest translations from transifex.
- Updated GeoIP databases.
Bug Fixes:
- Fixed memory leak on the error path of OOB / G2 query hit sending.
- Fixed memory leak on the file upload path.
- aging_insert(): was not properly handling freeing of keys, causing leaks.
- Fixed property description message for "max_leaves".
- Windows: no HEAP_NO_SERIALIZE flag on HeapAlloc() since we're multi-threaded.
- mingw_valloc(): fixed monitoring of unreserved VM space.
- Windows: optimized the inital VM space reservation.
- rpc_delay(): avoid int overflowing, which would make delay negative!
- node_udp_sr_data_ind(): do not crash if UDP was disabled or port was 0.
- Fixed crashes in the omalloc() layer.
Under the Hood:
- Make sure an initial GMT offset is computed before the time thread starts.
- Compact the aging structure on 64-bit platforms.
- Fixed possible race between evq_trampoline() and evq_event_discard().
- Added safety assertions: a removed item must belong to the list.
- Fixed typos in safety assertions.
- EVQ: closed race condition betweeen queues recreated in same thread ID.
- Use getrlimit(RLIMIT_AS) to get the available space, not RLIMIT_DATA.
- Windows: try harder to compute a relevant break value with sbrk(0).
- Windows: added cpp trap for dup().
- Windows: fixed fcntl(F_DUPFD) implementation which was not thread-safe.
- Windows: dump symbolic PC on stack overflows, after basic information.
- elist_remove(): assert that removed item must be part of some list.
- evq_event_discard(): be quiet when removing event for the event queue thread.
- evq_event_discard(): correctly handle cancelable events.
- evq_trampoline(): factorize removal of triggered item from queue list.
- evq_trampoline(): fixed logging message to use copied value.
- getgateway(): on Linux, cache previously computed value in case netlink fails.
- getgateway(): on Linux, the netlink socket can return EAGAIN on recv().
- main_command_line(): optimized and simplified!
- malloc_init_vtable(): be sure to set G_SLICE=always-malloc on Windows.
- mingw_exception(): skip printing of stacktrace if we got a stack overflow.
- mingw_getrlimit(): implement a better RLIMIT_DATA query.
- mingw_getrlimit(): return different max / current values to account for usage.
- mingw_signal(): always record signal handler in our internal list of handlers.
- mingw_valloc(): don't complain about non-hinted allocations when crashing!
- mingw_valloc(): use s_minicarp() to limit resource consumption.
- mingw_valloc(): when nearing out-of-memory, take data segment into account.
- mingw_vmm_init(): accelerate initialization, reducing amount of system calls.
- mingw_win2posix(): handle 0 to avoid warnings when called with no error.
- mingw_win2posix(): mapped ERROR_BAD_EXE_FORMAT to ENOEXEC.
- mingw_win2posix(): mapped ERROR_NETNAME_DELETED to EHOSTUNREACH.
- mingw_win2posix(): use s_minicarp() instead of s_warning() to see "culprit".
- omalloc_allocate(): was releasing spinlock too soon in read-only mode.
- omalloc_chunk_allocate_from(): fixed bug when header dissolution was required.
- publisher_handle(): simplified code by factorizing shared_file_unref() call.
- s_minicarp() and s_minicrit(): carefully avoid stdio when dumping stack.
- sdbm_close(): ensure we sync pending dirty data when database is not volatile.
- sdbm_name(): return path to the .pag file if no name was explicitly given.
- settings_init(): when computing max VM space, use max from RLIMIT_AS, not cur.
- socket_create_and_bind(): on Linux systems, force SO_REUSEADDR before bind().
- sort-test: reduce verbosity by default.
- thread_suspend_others(): silently suspends itself if concurrently asked to.
- udp_sched_write_error(): don't dump a stack trace on send errors we expect.
# v 1.1.5 2015-10-08 [stable]
This is a bug-fixing release.
Most of these bugs were discovered by investigating why gtk-gnutella was
frequently crashing on OS/X platforms. Why other platforms were not having
the same problems remains a mystery, since all these bugs were not specific
to OS/X, apart from the vmm_munmap() bug -- since mmap() is only used on
OS/X due to its lack of the sendfile() system call.
One of the fixed bugs could lead to a crash when the network connection was
broken (e.g. a cable unplugged or a WiFi connection terminated).
Improvements:
- UHC: re-engineered the random choice of UHCs in the pre-established list.
Bug Fixes:
- qrt_patch_compress_done(): fixed race with qrp_comp_done().
- xmalloc: prevent deadlock when freeing deferred blocks on the allocation path.
- pmap_remove_from(): protect from exceptional corner case to avoid crash.
- ut_frag_pmsg_free(): don't requeue an unsent message synchronously.
- VMM: fixed race condition in vmm_munmap() that could lead to failures.
- omalloc: fixed chunk management when memory alignment is required.
Under the Hood:
- well_state_discard(): fixed missing indexing of array pointer.
- thread-test: avoid mixed output by using atomic I/Os to stderr for messages.
- thread-test: main testing entry points now clearly flagged in output.
- signal_trampoline(): be verbose and lenient when our pre-condition fails.
- evq_event_discard(): fixed message to log the name of the registering thread.
- hash_list_lookup(): was mistakenly returning a const value.
- thread_private_set_extended(): ensure a NULL free routine clears any old one.
- crash_mode(): removed redundant call to thread_suspend_others().
- rand31_random_seed(): avoid popcount(), prefer modulo with a prime number.
- hash_offset_init_once(): avoid entropy_minirand(), causes dealocks on Windows.
- uhc_send_ping(): if we cannot contact selected UHC, try with another one.
- omalloc_chunk_*protect(): ensure chunk is consistent with page boundaries.
- More assertions in omalloc() to ensure we're not corrupting memory.
- Use global mutex to protect symbols_xxx() calls, simplified stacktrace code.
- Reduced UHC retry time from 1 hour down to 3 minutes.
- Revised UHC list.
- More thread-safe refactoring for other stringification routines.
# v 1.1.4 2015-09-09 [stable]
This release is mostly a bug-fixing release.
One major bug (leading to crash) was found in the G2 frame parsing layer: a
carefully crafted G2 packet sent to GTKG could crash it, leading to a Denial
of Service. For that reason, an upgrade to 1.1.4 is strongly recommended.
The only major new feature is the added cleanups of the TTH cache and the
crash log directory, to make sure we do not keep useless files on the disk
forever.
Because the Phex servent is no longer maintained, there is now a workaround
for that particular servent to ensure it can correctly download from GTKG.
Improvements:
- [GTK2] Added tri-state column sorting in "property editor" preference pane.
- [GTK2] Show icon + warning message when we have no TCP listening socket.
- Added an "install-strip" target to all Makefiles to install with stripping.
- Can no longer edit properties flagged as "internal" through shell or GUI.
- Added new "session_start_stamp" property to hold the true starting time.
- Added support for TTH cache cleanup.
- Added automatic cleanup of the crash log directory.
- New shell command "random stats" to display the statistics on random layer.
- Workaround for Phex: always send X-Gnutella-Content-URN in upload replies.
- Updated GeoIP database.
Bug Fixes:
- upnp_natpmp_discovered(): detect when UPnP layer was shutdown and abort.
- Fixed bad definition of XXTEA key, which led us to use only its first 4 bytes.
- node_g2_read(): need to only read 3 bytes usually to determine frame length.
- thread_sp(): tweaked to defeat gcc 5.x optimization leading to a NULL return.
- File moving: notify main thread as soon as file is completely copied.
- update_available_ranges(): lack of X-Available means file is full on server.
Under the Hood:
- Windows: added getppid() and statvfs() emulation, plus rmdir() support.
- Improved the unpredictability of our random numbers.
- Loudly warn if attempting a file-descriptor operation on a revoked descriptor.
- Added compat_sendfile() with fallback to emulated version when necessary.
- Added compat_statvfs() for portability and code simplification.
- File moving operations now use sendfile() if available.
- XFMT: made it loudly clear that comment nodes are ignored for now.
- VMM: when debugging, trace large allocation spots.
- VMM: raised maximum page cache lifetime from 3 to 15 minutes.
- page_cache_find_pages(): treat user memory as if under short-term strategy.
- filepath_basename(): optimize code when G_DIR_SEPARATOR is '/'.
- Optimized CMP() to avoid branching regardless of the arguments.
- Added ftw_foreach() to traverse a file system and process each entry.
- mingw_readdir(): do not change errno if it was left untouched by _wreaddir().
- Let mingw_{opendir,readdir,closedir} use normal types, not generic ones.
- mingw_stat(): added workaround for trailing "/" or "/." in paths.
- etree_traverse_internal(): minor optimization to avoid trailing +1 each time.
- Added etree_sort() and etree_sort_with_data() to sort children of all nodes.
- Changed signature of decoding base16 and base32 routines.
- Regenerated Configure to fix the fdopendir() compile test.
- Make sure pointer hashing distributes its trailing bits evenly.
- elist_merge_sort(): don't update tail, just do one single pass at the end.
- vmm_dump_pmap_log(): copy pmap data, then process dumping without locks.
# v 1.1.3 2015-04-08 [stable]
This is mainly a critical bug-fixing release, addressing a huge shortcoming
in 1.1.2: all Shareaza leaves are incorrectly flagged as being fakes and are
being removed quicktly from ultrapeers, creating network churn and instability.
Everyone running gtk-gnutella as Ultrapeer must upgrade to 1.1.3 quickly.
Releasing quickly after 1.1.3 is also a pretext for improving stability on
Windows platforms, especially after restarts: because Windows does not support
the "close on exec" flag on file descriptors, restarted processes were left
with several instances of a listening socket bound to the same port, causing
havoc as behaviour is totally undefined and was most probably leading to the
inability for the process to get any incoming connections.
On Windows, we now also monitor the memory usage more closely, in order to
avoid the C runtime from issuing a (blocking) popup signalling a fatal memory
allocation error should it run out of space.
More generally, the VMM layer is now capable of trapping fatal memory
allocation errors and handling them more efficiently. In particular, when
everything has failed, the layer can request a brutal restart of the process.
Under less dire circumstances, a graceful restart will be requested.
This was also an occasion to revisit the long-term allocation strategy in
the VMM layer and optimize it in order to further limit fragmentation of
the VM space. Even though avoiding fragmentation matters mostly for 32-bit
applications, this also limits the amount of individual memory region mappings
the kernel has to maintain and gtk-gnutella has to keep track of.
Finally, a last-minute bug fix where a user reported a deadlock in the QRP
processing code. After investigation, it turned out that there was indeed
a recursive locking on a spinlock that had escaped all real-life testing out
there so far!
Improvements:
- [GTK2] Added popup menu icon in front of "force push mode" for sources.
- [GTK2] Added warning icon in status bar when kernel runs short of net buffers.
- Increased default node connection timeout and size of the quick connect pool.
- Updated the shell "status" command to display "!IP" on net buffer shortage.
- Updated FAQ along with French and Turkish translations.
- Updated GeoIP databases.
Bug Fixes:
- Fixed invalid test for "fake" Shareaza that led to network instabilities.
- Made QRP lock a mutex to allow for recursive locking through qrp_comp_done().
Under the Hood:
- On out-of-memory conditions, attempt to auto-restart if possible.
- Windows: monitor committed memory, crashing before the kernel would kill us.
- Added crash_restart() and controlling routines to request smooth restart.
- On network buffer shortage (ENOBUFS), stop TCP connections for a while.
- UPnP: protect upnp_mapping objects given to callbacks with reference counts.
- Adjusted lock tracking when locks are disabled, fixing lock swapping.
- Windows: remember socket descriptors so that we can close them on exec().
- Refactored code for listening sockets to warn when bound port is already used.
- When shutdowning in "crash mode", skip most of the memory cleanup.
- rwlock_destroy(): make sure to write-unlock the lock if it was owned.
- waiter_ack(): don't panic if waiter was not notified, but loudly complain.
- upnp_map_natpmp_publish_reply(): trace given port on NAT-PMP mapping errors.
- upnp_discover(): force selection of IPv4 interface for UPnP discovery.
- thread_unsuspend_others(): relaxed hard assertion into a soft one.
- alloc_pages(): try harder on OOM conditions to allocate from the page cache.
- socket_connect_finalize(): fixed wrong errno processing for connect().
- socket_connect_prepare(): no need for SO_REUSEADDR for connecting sockets.
# v 1.1.2 2015-03-21 [stable]
This is mainly a bug-fixing release, addressing rare crashes that have been
happening in production. It also contains several improvements.
It fixes a user-reported bug whreby it was not possible to properly configure
the download paths using the GUI -- that led to application crashes due to
the incomplete support for discovered threads (which GTK is using underneath
to manage the dialog box).
Another bug was caused by the HTTP header parsing logic which did not allow
"." in header names. That made it refuse to parse headers sent by some UPnP
devices, such as "BOOTID.UPNP.ORG" or "CONFIGID.UPNP.ORG", prevening UPnP
mappings from being installed.
Hapening rarely but still annoying, there was a bug on the error handling path
of write errors to the TX network stack, leading to assertion failures in
the mq_tcp_putq() routine. That was because the qrt_compressed() routine
was not handling task cancellation properly. The likelyhood of hitting that
bug when running as a leaf node was very low.
On the improvement side, the search list is now highlighting searches for
which we have associated downloads by displaying the text in green. Further
tweaks were made to our GTK2 code to make sure the changes are reported "real
time" when the state changes, which was not always the case before (one needed
to go over a search by explicitly clicking on it to update the display in
the search list).
The SHA1 computation code was also further optimized to be as fast as possible,
reducing file hashing time by two! Since SHA1 hashing happens regularily
in gtk-gnutella to collect entropy, optimizing the SHA1 computation affects
more than just file verification.
Improvements:
- [GTK2] Added translation URL in the "About" GUI dialog.
- [GTK2] Highlight searches with registered downloads by using green text.
- [GTK2] Added tri-state column sorting to the "upload history" panel.
- FAQ: added new entry explaining how to get the magnet of a shared file.
- Map the "collection" G2 query tag to the Windows / Linux "archive" file set.
- Map the "torrent" G2 query tag to the "torrent" file set.
- Added support for "rom", "wordprocessing" and "subtitle" G2 query media types.
- Further optimized SHA1 computation, now going about twice faster for files.
Bug Fixes:
- page_cache_insert_pages(): fixed incorrect write-lock upgrade logic.
- pmap_insert_region(): must recompute insertion index if we extend the pmap!
- tmalloc: fixed thread magazine accounting in the depots.
- Did not commit back to database after updating the DHT key request count.
- routing_chunk_move(): must check messages carefully when chunk was moved.
- route_message(): beware of check_duplicate() which can remove the node.
- thread_element_matches(): pay more attention to discovered threads.
- thread_find_tid(): skip thread elements not marked as being valid!
- node_shutdown_mode(): must correctly account for shutdowning G2 nodes!
- bogons_changed(): forgot to close opened file descriptor
- upload_stats_load_history(): added missing break in switch.
- qrt_compressed(): was not handling QRP compression task cancellation properly.
Under the Hood:
- Added hostile ranges.
- Updated GeoIP databases for IPv4 and IPv6.
- Throttle the amount of PUSH messages we can send for a given remote server.
- Legitimate Shareaza nodes cannot be flagging themselves as ultrapeers.
- Windows: stack unwinding made safer with more memory checks to avoid faults.
- UPNP: attempt rediscovery of port mapping devices every hour, if missing one.
- UPNP: attempt rediscovery of port mapping devices every hour, if missing one.
- Added new TSIG_OVFLOW signal sent when a thread overflows its stack.
- Fixed race condition between concurrent waiter_refcnt_dec() calls.
- Added logging of layer which reports a TX error in case of assert failure.
- Track the last seen time (activity) of discovered threads other than main.
- Prevent glade-2 from outputting support files now, since we patched them.
- Added tracing of funny X-Falt lines we are seeing when demsh_debug is set.
- Added tracing of funny X-Alt lines we are seeing when dmesh_debug is set.
- Added tracing of funny X-Nalt lines we are seeing when dmesh_debug is set.
- Added crash hook for the thread layer.
- Added TX layer write-fault mechansim to help detect user error handling bugs.
- Syntaxic adjustments to make the latest guile happy with definitions.
- The GUI will now display current bandwidth by default, instead of the average.
- mingw_exception(): write shorter messages in case of stack overflows.
- thread_element_reset(): forgot to reset te->stack_base to NULL.
- header_append(): allow "." in header names.
- thread_join_internal(): no thread_cancel_test_element() on foreign thread!
- thread_find_element(): avoid leaving routine without unlocking mutex!
- cond_wait_until(): now correctly handle underlying cond variable mutation.
- thread_block_timeout(): don't panic if main thread already unblocked.
- dir_entry_filename(): made the Windows version thread-safe.
- hfield_dump(): fixed formatting of continuation lines.
- dmesh_collect_locations(): only parse the last timestamp when many given.
- xmalloc_thread_free(): always handle blocks in the cross-thread free list.
- Hide strtok_free(), forcing clients to use new strtok_free_null().
# v 1.1.1 2014-09-02 [stable]
This is mostly a bug-fixing release.
Improvements:
- Share Opus files by default, added opus and webm to search filters.
- No longer automagically unshare directories that do exist currently.
- Revamped peek/poke functions because GCC generated unoptimized code for these.
Bug Fixes:
- Avoid crash when we cannot parse the remotely supplied push-proxy URL.
- Fixed crash when entering "local:" as search term.
- Fixed crash when gtk-gnutella was stopped from terminal and put to background.
- Fixed crash on "Reverse DNS lookup" queries from the GUI node pane.
- Fixed GtkSpinButton "adjustment with non-zero page size" deprecation message.
- Handle G_SEARCHPATH_SEPARATOR in shared base directory correctly.
Under the Hood:
- shared_file_get_index(): fixed lower boundary of assertion.
- fi_find_aggressive_candidate(): prevent division by 0 if no starving download.
- Fixed possible race condition between bg_task_wakeup() and bg_sched_sleep().
- Regenerated Configure to allow BFD library detection for newest versions.
- teq_post_rpc(): use linearily increasing timeouts to limit logging.
- str_vncatf(): made recursion checks before calling s_minicarp() thread-safe.
- ut_frag_pmsg_free(): avoid SIGSEGV when fragment was already acknowledged.
- deflate_add(): refuse further data when the TX deflate layer had an error.
- search_dequeue_all_nodes(): must also iterate on G2 nodes.
- cq_heartbeat(): only log delay adjustements when running with cq_debug > 0.
- g2_node_handle(): silence warnings when not debugging.
- Allow xfl_find_freelist_index() to work with gcc 4.9 and optimizations.
- keys_offload(): do not process if the key layer was shutdown.
# v 1.1.0 2014-07-02 [stable]
This is a major release introducing new features and making gtk-gnutella
a multi-threaded application with drastic performance boosts for background
tasks like file hashing or library rescanning.
Another major feature is the added support for the G2 search protcol: we are
connecting to G2 hubs as a leaf, answer to search / browse requests from G2
hosts. We also use G2 to issue our own searches. Finally, we freely exchange
files with G2 hosts (downloading and uploading).
The G2 protocol was further extended to make sure G2 query hits convey as
much information as Gnutella query hits, in particular for alt-loc propagation
and TLS support. The G2 semi-reliable UDP layer is also leveraging the new
features designed for the corresponding Gnutella layer (cumulative and extended
acknowledgments), gracefully falling back to legacy features if the remote host
is not able to understand the new features.
A critical bug was fixed: reception of carefully crafted invalid DHT messages
would lead to an immediate crash, an open door for Denial of Service (DoS)
attacks. That bug has been present since 0.97 (release of August 2011).
Last but not least, the code base has now been checked by Coverity. There was
a very low defect rate of 0.26 (amount of true defects per thousand lines
of code) and all problems were fixed.
New Features:
- Multi-threading support (file hashing, library rescan, DNS, etc...)
- Added support for the G2 search protocol, connecting as leaf mode to G2.
- Turned gtk-gnutella into a random number server through the "random" command.
- Removed Bitzi support since the service has shutdown.
- Added the --no-dbus command-line option to prevent D-BUS notifications.
- [GTK] Added GUI enabling of the G2 protocol for searches.
- [GTK] Added spin-button to set the amount of G2 hub connections to maintain.
- [GTK] Report amount of G2 hubs to which we are connected.
- [GTK] Show amount of G2 host browsing served, in the upload stats pane.
Improvements:
- [GTK2] Added tri-state column sorting to "Downloads" and "Uploads" panes.
- Better entropy collection to initialize the pseudo random number generators.
- Externally visible randomness (e.g. GUIDs) is now cryptographically strong.
- We now pick random DHT nodes to send back from the whole routing table
- Some entropy collected is persisted, for better reseeding in next session.
- Added time change detection when switching from/to Daylight Saving Time.
- QRP query routing now uses LimeWire's logic, less strict than the GTKG one.
- The shell "status" command now reports the amount of G2 hub connections.
- Detect OOB proxy MUID conflicts for leaf queries.
- Added the "stats drop" shell command to show dropped message statistics.
- Improved random selection of files being matched in the library (local hits).
- When a PUSH request fails to connect back, ban target IP:port for 5 minutes.
- Configure: correctly detect the BFD library even if no -liberty.
- Crash handler now records and logs the ID and name of crashing thread.
- Updated gtk-gnutella.appdata.xml to the latest specifications.
- Updated the FAQ, along with translations to French and Turkish.
Bug Fixes:
- DHT bucket merging was incorrectly handling removal of nodes from table.
- Reception of improper DHT messages could lead to an immediate crash (DoS).
- ut_frag_pmsg_free(): rescheduling of expire event was in wrong block.
- base16_encode(): would cause buffer overflow when destination too small.
- Rotate OOB token keys less often, to avoid expiration whilst in transit.
- socket_udp_event(): ignore empty datagrams.
- Fixed host cache updates to avoid setting "out of bounds" property values.
- hcache_find_nearby(): was missing a "break" in the case for HOST_GUESS.
- Scheduled static checking by Coverity, found 81 problems requring a fix.
- Fixed TCP message size computing bug, which could corrupt the TCP stream.
- Configure: fixed endianess detection of IEEE-754 floats on Solaris.
- Was never configuring TCP quick ACKs due to a missing "break" statement.
- omalloc() could crash when configuring read-only objects.
- Ensure we never insert any "unusable host" in the push-proxy set.
- keys_update_value(): forgot to persist back updated expiration timestamp.
- Properly flag UDP route as deflatable when GGEP "Z" is seen in queries.
- Flag UDP route as supporting semi-reliable UDP when query flags are parsed.
Under the Hood:
- GUESS now avoids querying hosts to which we are connected via TCP
- GUESS: count the amount of hosts reached by query, since G2 queries a cluster.
- GUESS: increased cached lifetime of query keys to a little less than 1 day.
- GUESS: defer hosts we cannot requery to avoid constantly looping over them.
- GUESS: fixed host atom leak when message is synchronously dropped.
- GUESS: invalidate cached query keys on IP or listening port change.
- Added a thread management layer on top of the POSIX thread layer.
- Added support for safe inter-thread signals, handled by our thread layer.
- Expanded the set of atomic operations we can perform.
- Added read-write locks, now used by the VMM layer.
- Addded multi-threaded goodies: barriers, dams, event queues, cond variables.
- VMM: closed race condition during allocations.
- Added support for permanent thread-private data.
- Added primitive fork() handling in a multi-threaded environment.
- Made float formatting code thread-safe, removing need for funnelling.
- The ADNS now always runs in a separate thread.
- Provide both thread-private (hashtable) and thread-local (array) variables.
- Added new "thread list" shell command to monitor running threads.
- Added "task list" shell command to list currently defined background tasks.
- Added the "thread stats" shell command to dump thread statistics.
- Added "lib show callout" shell command to display callout queue information.
- Added "lib show files" to show opened files via file_object_xxx().
- Made sure PROTECT_ATOMS and ATOMS_HAVE_MAGIC are orthogonal settings.
- Moved the reference count of atoms to the tracking hash table.
- Callout queue runs the idle callbacks if not scheduled in the last 30 secs.
- Logging timestamps are now emitted with a millisecond accuracy.
- Improved g_assert_not_reached() to propagate the routine name as well.
- Re-architected file_objects to allow permission checking on opened files.
- Introducing tqsort(), a multi-threaded quicksort for sorting large arrays.