[arch-dev-public] archlinux-torrent-utils
Hi all, I had created some usefull tools to create torrent files of our isos based on Thomas' idea of using ktorrent. It includes mktorrent to create torrent including webseeds, lstorrent to get some nformation about a torrent file (e.g. hash) and a script called mktorrent-archlinux which makes it easy to creat iso.torrent files including webseeds. There is also a PKGBUILD to create a package from git. The only problem is that both programs segfault on exit. I am a real noob on C++; so I am in need of a little help here. Everything works fine and my very limited skills show me that the problem occours after the main() method was left. Last but not least the URL: http://git.archlinux.de/archlinux-torrent-utils/ Pierre -- Pierre Schmitz Clemens-August-Straße 76 53115 Bonn Telefon 0228 9716608 Mobil 0160 95269831 Jabber pierre@jabber.archlinux.de WWW http://www.archlinux.de
Pierre Schmitz schrieb:
The only problem is that both programs segfault on exit. I am a real noob on C++; so I am in need of a little help here. Everything works fine and my very limited skills show me that the problem occours after the main() method was left.
The bt::TorrentCreator class uses some ressources that are local in the main procedure - if those are already destroyed when the destructor is called, that might cause the segfault. Try to replace bt::TorrentCreator tc(target, trackers, webseeds, chunk_size, name, comment, priv, decentralized); with bt::TorrentCreator *tc = new bt::TorrentCreator(target, trackers, webseeds, chunk_size, name, comment, priv, decentralized); Then replace every occurrence of tc.foo with tc->foo and add delete tc; before the every return command. If I am right, the segfault should be gone. Another problem: The ktorrent torrent libraries are linked against all kinds of stuff which is not needed - probably because KDE is not compiled with -Wl,--as-needed.
Am Sonntag 31 Mai 2009 22:05:44 schrieb Thomas Bächler:
before the every return command. If I am right, the segfault should be gone.
No, it's still there.
Another problem: The ktorrent torrent libraries are linked against all kinds of stuff which is not needed - probably because KDE is not compiled with -Wl,--as-needed.
KDE is compiled with that option; but maybe ktorrent is not. -- Pierre Schmitz Clemens-August-Straße 76 53115 Bonn Telefon 0228 9716608 Mobil 0160 95269831 Jabber pierre@jabber.archlinux.de WWW http://www.archlinux.de
On Sun, May 31, 2009 at 10:46 PM, Pierre Schmitz <pierre@archlinux.de>wrote:
Am Sonntag 31 Mai 2009 22:05:44 schrieb Thomas Bächler:
before the every return command. If I am right, the segfault should be gone.
No, it's still there.
Another problem: The ktorrent torrent libraries are linked against all kinds of stuff which is not needed - probably because KDE is not compiled with -Wl,--as-needed.
KDE is compiled with that option; but maybe ktorrent is not.
--
no, ktorrent is not, I'll add it tomorrow. ronald
Am Montag, 1. Juni 2009 19:29:20 schrieb Ronald van Haren:
no, ktorrent is not, I'll add it tomorrow.
I already added to trunk; there is a new release anyway. -- Pierre Schmitz Clemens-August-Straße 76 53115 Bonn Telefon 0228 9716608 Mobil 0160 95269831 Jabber pierre@jabber.archlinux.de WWW http://www.archlinux.de
On Sun, May 31, 2009 at 3:46 PM, Pierre Schmitz<pierre@archlinux.de> wrote:
Am Sonntag 31 Mai 2009 22:05:44 schrieb Thomas Bächler:
before the every return command. If I am right, the segfault should be gone.
No, it's still there.
You can go the plan9 route and keep the pointer and just never delete it. The philosophy there is "the OS will clean it up, no need for me to delete/free memory. But I don't think that's the problem - if both segfault, then it's a commonality between them. What's with the QTextStream? You can safely remove those and use std::cout and std::cerr exactly the same way. I expect that may be an issue as it's trying to clean up the stdout/stderr file objects. Just a guess
On Tue, Jun 9, 2009 at 2:47 PM, Aaron Griffin<aaronmgriffin@gmail.com> wrote:
On Sun, May 31, 2009 at 3:46 PM, Pierre Schmitz<pierre@archlinux.de> wrote:
Am Sonntag 31 Mai 2009 22:05:44 schrieb Thomas Bächler:
before the every return command. If I am right, the segfault should be gone.
No, it's still there.
You can go the plan9 route and keep the pointer and just never delete it. The philosophy there is "the OS will clean it up, no need for me to delete/free memory.
But I don't think that's the problem - if both segfault, then it's a commonality between them.
What's with the QTextStream? You can safely remove those and use std::cout and std::cerr exactly the same way. I expect that may be an issue as it's trying to clean up the stdout/stderr file objects.
Just a guess
Also your PKGBUILD needs a makedepends for cmake
participants (4)
-
Aaron Griffin
-
Pierre Schmitz
-
Ronald van Haren
-
Thomas Bächler