jesec / libtorrent Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
LibTorrent Copyright (C) 2005-2014, Jari Sundell LICENSE GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is originally from the Mozilla NSS and is under a triple license; MPL, LGPL and GPL. An exception to non-NSS code has been added for linking to OpenSSL as requested by Debian, though the author considers that library to be part of the Operative System and thus linking is allowed according to the GPL. Use whatever fits your purpose, the code required to compile with Mozilla's NSS implementation of SHA1 has been retained and can be compiled if the user wishes to avoid using OpenSSL. CONTACT Jari Sundell Skomakerveien 33 3185 Skoppum, NORWAY Send bug reports, suggestions and patches to <[email protected]> or to the mailinglist.
Binaries built with clang 14 segfault when calling random_char()
(and probably random_uniform_char()
and random_uint8
too)
According to this uniform_int_distribution
is undefined for char and int8, and clang is generating code that segfaults.
This patch seems to work for me, but I'm don't know much C++.
diff --git a/include/torrent/utils/random.h b/include/torrent/utils/random.h
index 76b51e2e..ffd00567 100644
--- a/include/torrent/utils/random.h
+++ b/include/torrent/utils/random.h
@@ -32,7 +32,7 @@ static thread_local auto dist_uint32 = uniform_dist<uint32_t>();
inline char
random_char() {
- return dist_char(mt32);
+ return static_cast<char>(random_uniform_template(0, 255, mt32));
}
inline int32_t
@@ -47,7 +47,7 @@ random_int64() {
inline uint8_t
random_uint8() {
- return dist_uint8(mt32);
+ return static_cast<uint8_t>(random_uniform_template(0, 255, mt32));
}
inline uint32_t
@@ -56,8 +56,8 @@ random_uint32() {
}
inline char
-random_uniform_char(char min, char max) {
- return random_uniform_template(min, max, mt32);
+random_uniform_char(uint32_t min, uint32_t max) {
+ return static_cast<char>(random_uniform_template(min, max, mt32));
}
inline size_t
error while loading shared libraries: libtorrent.so.21: cannot open shared object file: No such file or directory
See NixOS/nixpkgs#121058 (comment) for additional context.
On the https://github.com/jesec/rtorrent page it states that building libtorrent is required before building rTorrent where amongst other instructions it says:
# Compile and install libtorrent (matching version required)
# Check README of libtorrent for instructions
Unfortunately the readme file in the libtorrent repo does not contain any building instructions.
As discussed in #3, this test is flaky, specifically in this assertion.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.