mythtv-backend needs to run in writable directory

Bug #1073580 reported by Brian J. Murrell on 2012-10-31
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mythtv (Ubuntu)
Medium
Thomas Mashos

Bug Description

The mythtv-backend process needs to be run in a directory that it can write into, ~mythtv for example. This is required so that a core file can be collected if/when it segfaults -- like it has been doing here.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: mythtv-backend 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4 [origin: LP-PPA-mythbuntu-0.25]
ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
Uname: Linux 3.2.0-31-generic i686
.var.log.mythtv.mythavtest.log:

.var.log.mythtv.mythbackend.log:

.var.log.mythtv.mythccextractor.log:

.var.log.mythtv.mythcommflag.log:

.var.log.mythtv.mythfrontend.log:

.var.log.mythtv.mythjobqueue.log:

.var.log.mythtv.mythlcdserver.log:

.var.log.mythtv.mythmediaserver.log:

.var.log.mythtv.mythmetadatalookup.log:

.var.log.mythtv.mythpreviewgen.log:

.var.log.mythtv.mythshutdown.log:

.var.log.mythtv.mythtranscode.log:

.var.log.mythtv.mythtv.setup.log:

.var.log.mythtv.mythutil.log:

.var.log.mythtv.mythwelcome.log:

ApportVersion: 2.0.1-0ubuntu13
Architecture: i386
CrashDB: mythbuntu
Date: Wed Oct 31 10:07:13 2012
Installed_mythtv_dbg: 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: mythtv
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.logrotate.d.mythtv.backend: [modified]
mtime.conffile..etc.init.mythtv.backend.conf: 2012-10-31T10:05:57
mtime.conffile..etc.logrotate.d.mythtv.backend: 2012-06-04T22:15:10

I should add, look at the modified.conffile..etc.init.mythtv.backend.conf.txt attachment for an example of how to do this.

Thomas Mashos (tgm4883) wrote :

Shouldn't the crash file already be written to /var/crash/ ?
http://www.mythtv.org/wiki/Debugging#Ubuntu_packages

Changed in mythtv (Ubuntu):
assignee: nobody → Thomas Mashos (tgm4883)
importance: Undecided → Medium
status: New → Incomplete

Yeah apport should be catching this stuff for you I believe.

On Wed, Oct 31, 2012 at 3:40 PM, Thomas Mashos
<email address hidden>wrote:

> Shouldn't the crash file already be written to /var/crash/ ?
> http://www.mythtv.org/wiki/Debugging#Ubuntu_packages
>
>
> ** Changed in: mythtv (Ubuntu)
> Importance: Undecided => Medium
>
> ** Changed in: mythtv (Ubuntu)
> Status: New => Incomplete
>
> ** Changed in: mythtv (Ubuntu)
> Assignee: (unassigned) => Thomas Mashos (tgm4883)
>
> --
> You received this bug notification because you are a member of Mythbuntu
> Bug Team, which is subscribed to mythtv in Ubuntu.
> https://bugs.launchpad.net/bugs/1073580
>
> Title:
> mythtv-backend needs to run in writable directory
>
> Status in “mythtv” package in Ubuntu:
> Incomplete
>
> Bug description:
> The mythtv-backend process needs to be run in a directory that it can
> write into, ~mythtv for example. This is required so that a core file
> can be collected if/when it segfaults -- like it has been doing here.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 12.04
> Package: mythtv-backend
> 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4 [origin:
> LP-PPA-mythbuntu-0.25]
> ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
> Uname: Linux 3.2.0-31-generic i686
> .var.log.mythtv.mythavtest.log:
>
> .var.log.mythtv.mythbackend.log:
>
> .var.log.mythtv.mythccextractor.log:
>
> .var.log.mythtv.mythcommflag.log:
>
> .var.log.mythtv.mythfrontend.log:
>
> .var.log.mythtv.mythjobqueue.log:
>
> .var.log.mythtv.mythlcdserver.log:
>
> .var.log.mythtv.mythmediaserver.log:
>
> .var.log.mythtv.mythmetadatalookup.log:
>
> .var.log.mythtv.mythpreviewgen.log:
>
> .var.log.mythtv.mythshutdown.log:
>
> .var.log.mythtv.mythtranscode.log:
>
> .var.log.mythtv.mythtv.setup.log:
>
> .var.log.mythtv.mythutil.log:
>
> .var.log.mythtv.mythwelcome.log:
>
> ApportVersion: 2.0.1-0ubuntu13
> Architecture: i386
> CrashDB: mythbuntu
> Date: Wed Oct 31 10:07:13 2012
> Installed_mythtv_dbg: 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4
> ProcEnviron:
> TERM=xterm
> PATH=(custom, no user)
> LANG=en_CA.UTF-8
> SHELL=/bin/bash
> SourcePackage: mythtv
> UpgradeStatus: No upgrade log present (probably fresh install)
> modified.conffile..etc.logrotate.d.mythtv.backend: [modified]
> mtime.conffile..etc.init.mythtv.backend.conf: 2012-10-31T10:05:57
> mtime.conffile..etc.logrotate.d.mythtv.backend: 2012-06-04T22:15:10
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/1073580/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~mythbuntu-bugs
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~mythbuntu-bugs
> More help : https://help.launchpad.net/ListHelp
>

--
Mario Limonciello
<email address hidden>

On 12-10-31 10:40 AM, Thomas Mashos wrote:
> Shouldn't the crash file already be written to /var/crash/ ?

Interesting point. It doesn't seem to be the case however. Given this
segfault:

Oct 30 22:00:03 pvr kernel: [1937721.428406] mythbackend[13502]: segfault at 28 ip 0620ef91 sp b2ffe140 error 4 in libQtCore.so.4.8.1[607d000+2d4000]

There was nothing in /var/crash about it.

However given a different segfault:

Oct 29 16:02:05 pvr kernel: [1829843.051149] mythcommflag[2020]: segfault at b37fb3f4 ip 080626cc sp bfa4d1f0 error 4 in mythcommflag[8048000+6e000]

There is indeed a:

-rw-r----- 1 mythtv mythtv 11878631 Oct 29 16:02 _usr_bin_mythcommflag.103.crash

So what's different about these processes and why one's segfault is
being caught by apport and the other is not?

Mario Limonciello (superm1) wrote :
Download full text (3.6 KiB)

I believe there was some sort of problem starting in 0.24 that the ulimit
needs to be raised to allow the process to core dump

If you add this to the upstart script:

ulimit -c unlimited

that will allow mythbackend to do core dumps. I'm unsure of the security
implications of this though (there might be some).

On Wed, Oct 31, 2012 at 10:09 AM, Brian J. Murrell <email address hidden>wrote:

> On 12-10-31 10:40 AM, Thomas Mashos wrote:
> > Shouldn't the crash file already be written to /var/crash/ ?
>
> Interesting point. It doesn't seem to be the case however. Given this
> segfault:
>
> Oct 30 22:00:03 pvr kernel: [1937721.428406] mythbackend[13502]:
> segfault at 28 ip 0620ef91 sp b2ffe140 error 4 in
> libQtCore.so.4.8.1[607d000+2d4000]
>
> There was nothing in /var/crash about it.
>
> However given a different segfault:
>
> Oct 29 16:02:05 pvr kernel: [1829843.051149] mythcommflag[2020]:
> segfault at b37fb3f4 ip 080626cc sp bfa4d1f0 error 4 in
> mythcommflag[8048000+6e000]
>
> There is indeed a:
>
> -rw-r----- 1 mythtv mythtv 11878631 Oct 29 16:02
> _usr_bin_mythcommflag.103.crash
>
> So what's different about these processes and why one's segfault is
> being caught by apport and the other is not?
>
> --
> You received this bug notification because you are a member of Mythbuntu
> Bug Team, which is subscribed to mythtv in Ubuntu.
> https://bugs.launchpad.net/bugs/1073580
>
> Title:
> mythtv-backend needs to run in writable directory
>
> Status in “mythtv” package in Ubuntu:
> Incomplete
>
> Bug description:
> The mythtv-backend process needs to be run in a directory that it can
> write into, ~mythtv for example. This is required so that a core file
> can be collected if/when it segfaults -- like it has been doing here.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 12.04
> Package: mythtv-backend
> 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4 [origin:
> LP-PPA-mythbuntu-0.25]
> ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
> Uname: Linux 3.2.0-31-generic i686
> .var.log.mythtv.mythavtest.log:
>
> .var.log.mythtv.mythbackend.log:
>
> .var.log.mythtv.mythccextractor.log:
>
> .var.log.mythtv.mythcommflag.log:
>
> .var.log.mythtv.mythfrontend.log:
>
> .var.log.mythtv.mythjobqueue.log:
>
> .var.log.mythtv.mythlcdserver.log:
>
> .var.log.mythtv.mythmediaserver.log:
>
> .var.log.mythtv.mythmetadatalookup.log:
>
> .var.log.mythtv.mythpreviewgen.log:
>
> .var.log.mythtv.mythshutdown.log:
>
> .var.log.mythtv.mythtranscode.log:
>
> .var.log.mythtv.mythtv.setup.log:
>
> .var.log.mythtv.mythutil.log:
>
> .var.log.mythtv.mythwelcome.log:
>
> ApportVersion: 2.0.1-0ubuntu13
> Architecture: i386
> CrashDB: mythbuntu
> Date: Wed Oct 31 10:07:13 2012
> Installed_mythtv_dbg: 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4
> ProcEnviron:
> TERM=xterm
> PATH=(custom, no user)
> LANG=en_CA.UTF-8
> SHELL=/bin/bash
> SourcePackage: mythtv
> UpgradeStatus: No upgrade log present (probably fresh install)
> modified.conffile..etc.logrotate.d.mythtv.backend: [modified]
> mtime.conffile..etc.init.mythtv.backend.conf: 2012-10-31T10:05:57
> mtime.conffile..etc.lo...

Read more...

Download full text (4.0 KiB)

The other possible change might be making a sysctl change because
mythbackend runs suid

sudo sysctl -w fs.suid_dumpable=2

On Mon, Nov 5, 2012 at 6:04 PM, Mario Limonciello <email address hidden>wrote:

> I believe there was some sort of problem starting in 0.24 that the ulimit
> needs to be raised to allow the process to core dump
>
> If you add this to the upstart script:
>
> ulimit -c unlimited
>
>
> that will allow mythbackend to do core dumps. I'm unsure of the security
> implications of this though (there might be some).
>
> On Wed, Oct 31, 2012 at 10:09 AM, Brian J. Murrell <email address hidden>wrote:
>
>> On 12-10-31 10:40 AM, Thomas Mashos wrote:
>> > Shouldn't the crash file already be written to /var/crash/ ?
>>
>> Interesting point. It doesn't seem to be the case however. Given this
>> segfault:
>>
>> Oct 30 22:00:03 pvr kernel: [1937721.428406] mythbackend[13502]:
>> segfault at 28 ip 0620ef91 sp b2ffe140 error 4 in
>> libQtCore.so.4.8.1[607d000+2d4000]
>>
>> There was nothing in /var/crash about it.
>>
>> However given a different segfault:
>>
>> Oct 29 16:02:05 pvr kernel: [1829843.051149] mythcommflag[2020]:
>> segfault at b37fb3f4 ip 080626cc sp bfa4d1f0 error 4 in
>> mythcommflag[8048000+6e000]
>>
>> There is indeed a:
>>
>> -rw-r----- 1 mythtv mythtv 11878631 Oct 29 16:02
>> _usr_bin_mythcommflag.103.crash
>>
>> So what's different about these processes and why one's segfault is
>> being caught by apport and the other is not?
>>
>> --
>> You received this bug notification because you are a member of Mythbuntu
>> Bug Team, which is subscribed to mythtv in Ubuntu.
>> https://bugs.launchpad.net/bugs/1073580
>>
>> Title:
>> mythtv-backend needs to run in writable directory
>>
>> Status in “mythtv” package in Ubuntu:
>> Incomplete
>>
>> Bug description:
>> The mythtv-backend process needs to be run in a directory that it can
>> write into, ~mythtv for example. This is required so that a core file
>> can be collected if/when it segfaults -- like it has been doing here.
>>
>> ProblemType: Bug
>> DistroRelease: Ubuntu 12.04
>> Package: mythtv-backend
>> 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4 [origin:
>> LP-PPA-mythbuntu-0.25]
>> ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
>> Uname: Linux 3.2.0-31-generic i686
>> .var.log.mythtv.mythavtest.log:
>>
>> .var.log.mythtv.mythbackend.log:
>>
>> .var.log.mythtv.mythccextractor.log:
>>
>> .var.log.mythtv.mythcommflag.log:
>>
>> .var.log.mythtv.mythfrontend.log:
>>
>> .var.log.mythtv.mythjobqueue.log:
>>
>> .var.log.mythtv.mythlcdserver.log:
>>
>> .var.log.mythtv.mythmediaserver.log:
>>
>> .var.log.mythtv.mythmetadatalookup.log:
>>
>> .var.log.mythtv.mythpreviewgen.log:
>>
>> .var.log.mythtv.mythshutdown.log:
>>
>> .var.log.mythtv.mythtranscode.log:
>>
>> .var.log.mythtv.mythtv.setup.log:
>>
>> .var.log.mythtv.mythutil.log:
>>
>> .var.log.mythtv.mythwelcome.log:
>>
>> ApportVersion: 2.0.1-0ubuntu13
>> Architecture: i386
>> CrashDB: mythbuntu
>> Date: Wed Oct 31 10:07:13 2012
>> Installed_mythtv_dbg: 2:0.25.2+fixes.20121002.139bd59-0ubuntu0mythbuntu4
>> ProcEnviron:
>> TERM=xterm
>> PATH=(cust...

Read more...

Mario Limonciello (superm1) wrote :

Well and actually that conflicts with what this commit says:

http://code.mythtv.org/trac/changeset/4a515ba3904bde90f7d9b64c5a7dc10e49a77dd8/mythtv

In theory 0.25 should be able to dump.

On 12-11-05 07:07 PM, Mario Limonciello wrote:
> Well and actually that conflicts with what this commit says:
>
> http://code.mythtv.org/trac/changeset/4a515ba3904bde90f7d9b64c5a7dc10e49a77dd8/mythtv
>
> In theory 0.25 should be able to dump.

I'm using 0.25-fixes and not getting core dumps. I've also set the core
limit to unlimited. I don't think I have had once since I changed the
PWD in the initscript though, so difficult to come to a conclusion yet.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers