Page MenuHomeSolus

D378.id809.diff
No OneTemporary

D378.id809.diff

diff --git a/files/segmentation-fault-on-podcasts-downloads.patch b/files/segmentation-fault-on-podcasts-downloads.patch
new file mode 100644
--- /dev/null
+++ b/files/segmentation-fault-on-podcasts-downloads.patch
@@ -0,0 +1,93 @@
+From e11b656bda59ca31b4f9ab4c5a14696813b0f6f4 Mon Sep 17 00:00:00 2001
+From: Tilman Keskinoz <arved@FreeBSD.org>
+Date: Thu, 12 Mar 2015 11:03:50 +0100
+Subject: [PATCH 1/3] Detach thread, to avoid thread being destructed when it
+ is going out of scope
+
+---
+ src/pb_controller.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pb_controller.cpp b/src/pb_controller.cpp
+index 09b5e897..da8ffcb1 100644
+--- a/src/pb_controller.cpp
++++ b/src/pb_controller.cpp
+@@ -287,6 +287,7 @@ void pb_controller::start_downloads() {
+ if (it->status() == DL_QUEUED) {
+ std::thread t {poddlthread(&(*it), cfg)};
+ --dl2start;
++ t.detach();
+ }
+ }
+ }
+
+From f79e5527ba5f54677540637f5b8d287215cfa051 Mon Sep 17 00:00:00 2001
+From: Tilman Keskinoz <arved@FreeBSD.org>
+Date: Thu, 12 Mar 2015 11:04:49 +0100
+Subject: [PATCH 2/3] Fix segfault
+
+I think somewhere the poddlthread is copied and the memory messed up.
+Make it a shared_ptr to fix segfault.
+
+Why is this a pointer anyway?
+---
+ include/poddlthread.h | 3 ++-
+ src/poddlthread.cpp | 1 -
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/poddlthread.h b/include/poddlthread.h
+index a10b9e73..cf0f1daa 100644
+--- a/include/poddlthread.h
++++ b/include/poddlthread.h
+@@ -7,6 +7,7 @@
+
+ #include <sys/time.h>
+ #include <time.h>
++#include <memory>
+
+ #include <configcontainer.h>
+
+@@ -24,7 +25,7 @@ class poddlthread {
+ private:
+ void mkdir_p(const char * file);
+ download * dl;
+- std::ofstream *f;
++ std::shared_ptr<std::ofstream> f;
+ timeval tv1;
+ timeval tv2;
+ size_t bytecount;
+diff --git a/src/poddlthread.cpp b/src/poddlthread.cpp
+index 583481eb..3a1b390f 100644
+--- a/src/poddlthread.cpp
++++ b/src/poddlthread.cpp
+@@ -22,7 +22,6 @@ poddlthread::poddlthread(download * dl_, newsbeuter::configcontainer * c) : dl(d
+ }
+
+ poddlthread::~poddlthread() {
+- delete f;
+ }
+
+ void poddlthread::operator()() {
+
+From 49dbf84d9500860c48c1d3137cf0d7ab89588726 Mon Sep 17 00:00:00 2001
+From: Tilman Keskinoz <arved@FreeBSD.org>
+Date: Thu, 12 Mar 2015 11:30:24 +0100
+Subject: [PATCH 3/3] Another threa.detach() missing
+
+---
+ src/pb_view.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pb_view.cpp b/src/pb_view.cpp
+index fb61c726..f3cb4788 100644
+--- a/src/pb_view.cpp
++++ b/src/pb_view.cpp
+@@ -111,6 +111,7 @@ void pb_view::run(bool auto_download) {
+ if (idx != -1) {
+ if (ctrl->downloads()[idx].status() != DL_DOWNLOADING) {
+ std::thread t {poddlthread(&ctrl->downloads()[idx], ctrl->get_cfgcont())};
++ t.detach();
+ }
+ }
+ }
+
diff --git a/package.yml b/package.yml
--- a/package.yml
+++ b/package.yml
@@ -1,6 +1,6 @@
name : newsbeuter
version : 2.9
-release : 4
+release : 5
source :
- http://www.newsbeuter.org/downloads/newsbeuter-2.9.tar.gz : 74a8bf019b09c3b270ba95adc29f2bbe48ea1f55cc0634276b21fcce1f043dc8
homepage : http://www.newsbeuter.org
@@ -17,6 +17,7 @@
rundeps :
- stfl
setup : |
+ %patch -p1 < $pkgfiles/segmentation-fault-on-podcasts-downloads.patch
./config.sh
build : |
%make prefix=/usr
diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml
--- a/pspec_x86_64.xml
+++ b/pspec_x86_64.xml
@@ -3,8 +3,8 @@
<Name>newsbeuter</Name>
<Homepage>http://www.newsbeuter.org</Homepage>
<Packager>
- <Name>Joshua Strobl</Name>
- <Email>joshua@stroblindustries.com</Email>
+ <Name>Pierre-Yves</Name>
+ <Email>pyu@riseup.net</Email>
</Packager>
<License>MIT</License>
<PartOf>network.news</PartOf>
@@ -27,12 +27,12 @@
</Files>
</Package>
<History>
- <Update release="4">
- <Date>2017-05-19</Date>
+ <Update release="5">
+ <Date>2017-06-13</Date>
<Version>2.9</Version>
<Comment>Packaging update</Comment>
- <Name>Joshua Strobl</Name>
- <Email>joshua@stroblindustries.com</Email>
+ <Name>Pierre-Yves</Name>
+ <Email>pyu@riseup.net</Email>
</Update>
</History>
</PISI>
\ No newline at end of file

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 11, 3:32 PM (3 h, 3 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5803902
Default Alt Text
D378.id809.diff (4 KB)

Event Timeline