Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#9421 closed Developer Task (fixed)

MythSystem Rewrite bug tracking

Reported by: beirdo Owned by: beirdo
Priority: minor Milestone: 0.25
Component: MythTV - MythSystem Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I am opening this ticket for bug reporting on the new MythSystem? setup. Rather than opening many tickets, maybe it might work better if we track any issues here.

Please, as usual: No me toos. If you have an issue to report that has not already been reported, adding it is OK. If you have comments on a previous issue that has been reported, please put your comments in the mailing lists. I don't want to have to be locking this ticket due to bad behavior. Thanks.

Attachments (19)

0001-Make-background-runs-not-block-the-foreground.patch (1.6 KB) - added by beirdo 13 years ago.
mythweb.segfault.data (76.0 KB) - added by Bill Meek <keemllib@…> 13 years ago.
--version, gdb and backend log for segfault when using mythweb + MiscStatusScript?
0001-Fix-race-condition-on-m_pMap-read-on-close.patch (891 bytes) - added by beirdo 13 years ago.
netgrabbermanager.patch (1.2 KB) - added by Jonatan <mythtv@…> 13 years ago.
0001-Fix-no-argument-constructor.patch (1.3 KB) - added by beirdo 13 years ago.
frontend-crash-bt.txt (27.0 KB) - added by otto@… 13 years ago.
frontend-crash-log.txt (13.2 KB) - added by otto@… 13 years ago.
0002-Move-timeout-setting-to-before-fork.patch (3.0 KB) - added by beirdo 13 years ago.
frontend-crash-bt2.txt (16.9 KB) - added by otto@… 13 years ago.
frontend-crash-log2.txt (13.4 KB) - added by otto@… 13 years ago.
0003-Don-t-bother-managing-a-child-that-failed.patch (1.2 KB) - added by beirdo 13 years ago.
0001-Changes-to-MythSystemUnix-to-fix-when-a-launched-pro.patch (5.2 KB) - added by beirdo 13 years ago.
replaces 0001-0003 for okolsi, rebased onto current master
frontend-crash-bt3-with-patch.txt (21.8 KB) - added by otto@… 13 years ago.
frontend-crash-log3-with-patch.txt (16.4 KB) - added by otto@… 13 years ago.
frontend-crash-bt4-with-patch.txt (23.8 KB) - added by otto@… 13 years ago.
playback-startup-bt.txt (59.6 KB) - added by otto@… 13 years ago.
0002-In-myth_system-use-the-updated-settings.patch (1.0 KB) - added by beirdo 13 years ago.
playback-startup-bt2.txt (56.4 KB) - added by otto@… 13 years ago.
0001-Change-to-using-QPointer-so-double-delete-issues-sto.patch (2.4 KB) - added by beirdo 13 years ago.

Download all attachments as: .zip

Change History (50)

comment:1 Changed 13 years ago by otto@…

Executing background processes from the menu using following XML does not work:

<button>
    <type>WEBPAGE</type>
    <text>Chrome</text>
    <action>EXEC /usr/bin/google-chrome &amp;</action>
    <depends>mythbrowser</depends>
</button>

Problematic part seems to be putting process into background using &amp;. Without it EXEC works as expected. It seems that -v system logging is also not working while this problem happens.

Changed 13 years ago by beirdo

comment:2 Changed 13 years ago by beirdo

Please download the attached patch and apply it with "git apply patchfilename". Let me know if this fixes the issue or not. Also, when running, you will need -v system,extra for most of the logging to show up.

comment:3 Changed 13 years ago by sphery

In 20009dcd4d31152b330573d718859317a447b464:

Change DBUtil::CountClients?() to use MSqlQuery.

No need to use the mysql command-line client, anymore. Refs #9421.

Changed 13 years ago by Bill Meek <keemllib@…>

Attachment: mythweb.segfault.data added

--version, gdb and backend log for segfault when using mythweb + MiscStatusScript?

comment:4 Changed 13 years ago by Bill Meek <keemllib@…>

I forgot to add a 'how to duplicate' section to the mythweb.segfault.data attachment.

Create a script and point MiscStatusScript to it via the GUI
Restart apache
Start mythbackend -v general,important,system,extra (with gdb)
Browse to hostname/mythweb/status
Expect 'headers only' on the status page and at the top:

Warning at /var/www/mythweb/modules/status/handler.php, line 31:
!!NoTrans: file_get_contents(http://192.168.2.200:6544): failed to open stream: HTTP request failed

Expect gdb to trigger on a segfault

This was the most reliable method of recreating the problem. I'll upload the script if needed, it includes a ping -c1 -t4... and the script runs for about 2 seconds. Simply reloading the page isn't reliable.

Changed 13 years ago by beirdo

comment:5 Changed 13 years ago by beirdo

Bill: could you check with your test script to see if this patch fixes the issue? Thanks.

comment:6 Changed 13 years ago by Bill Meek <keemllib@…>

170+ tests with 0001-Fix-race-condition-on-m_pMap-read-on-close.patch applied, 0 failures. Also, existing startup, channel changer, preview generator and pre shutdown programs continue to run as before.

Without the patch, I only did two tests -- both generated a segfault.

Sounds like a fix to me!

Thank you.

comment:7 Changed 13 years ago by beirdo

0001-Fix-race-condition-on-m_pMap-read-on-close.patch committed in 88d17d39c1ef. Thanks.

Changed 13 years ago by Jonatan <mythtv@…>

Attachment: netgrabbermanager.patch added

comment:8 Changed 13 years ago by Jonatan <mythtv@…>

MythSystem? usage in libmyth/netgrabbermanager.cpp leaves MythSystem::d uninitialized, causing a segfault. Patch attached.

Changed 13 years ago by beirdo

comment:9 Changed 13 years ago by beirdo

Jonatan: Please revert that patch and try the one above. The true issue is that the bare constructor didn't initialize correctly anymore.

comment:10 Changed 13 years ago by beirdo

Since Jonathan confirmed on IRC that it is working properly: committed 0001-Fix-no-argument-constructor.patch as SHA1 55661dbf7697

comment:11 in reply to:  2 ; Changed 13 years ago by otto@…

Replying to beirdo:

Please download the attached patch and apply it with "git apply patchfilename". Let me know if this fixes the issue or not. Also, when running, you will need -v system,extra for most of the logging to show up.

With patch 0001-Make-background-runs-not-block-the-foreground.patch applied on top of current head (?) of git does not properly fix the background process launch from the menu issue. Process is launched into background, but frontend crashes shortly after the process has been launched. This happens both if I'm using the launched process only (Chrome) or if I'm changing frontend as an active process (Alt-Tab) etc.

Following can be seen from the logs:

2011-01-09 15:14:32.912 Adding background flag
2011-01-09 15:14:32.912 Launching: /usr/bin/google-chrome
2011-01-09 15:14:32.918 Managed child (PID: 18341) has started! *& command=/usr/bin/google-chrome, timeout=0

Sometimes also following line can be seen in logs:

2011-01-09 15:13:57.689 Managed child (PID: 18172) timed out, issuing TERM signal

comment:12 in reply to:  11 ; Changed 13 years ago by beirdo

Replying to otto@…:

OK. Thanks for the update. To further debug this, I will need to see the logs (from the frontend) and also a full backtrace of it when it crashes. It is not possible to debug the real issue without that information. Please don't edit the logs, include everything from at least a minute before you try this (or from starting the frontend) right until it crashes.

Thanks

Changed 13 years ago by otto@…

Attachment: frontend-crash-bt.txt added

Changed 13 years ago by otto@…

Attachment: frontend-crash-log.txt added

comment:13 in reply to:  12 Changed 13 years ago by otto@…

Replying to beirdo:

OK. Thanks for the update. To further debug this, I will need to see the logs (from the frontend) and also a full backtrace of it when it crashes.

Both frontend log and backtrace files attached.

Changed 13 years ago by beirdo

comment:14 Changed 13 years ago by beirdo

Otto: please try this patch in addition to the earlier one.

comment:15 Changed 13 years ago by robertm

MythSystem? rewrite appears to have broken MythXML::GetInternetSources?, which means it's no longer possible to configure MythNetvision? grabbers since the backend hangs forever without returning a list.

Gets through one of the grabbers and then hangs.

2011-01-09 17:39:08.330 Launching: /usr/share/mythtv//internetcontent/bbciplayer.py -v
2011-01-09 17:39:08.332 Managed child (PID: 16238) has started! * command=/usr/share/mythtv//internetcontent/bbciplayer.py -v, timeout=0
2011-01-09 17:39:08.710 Managed child (PID: 16238) has exited! command=/usr/share/mythtv//internetcontent/bbciplayer.py -v, status=0, result=0

comment:16 Changed 13 years ago by robertm

GetInternetSources? appears okay, actually, something fixed within the last three or four days. Sorry about that.

Changed 13 years ago by otto@…

Attachment: frontend-crash-bt2.txt added

Changed 13 years ago by otto@…

Attachment: frontend-crash-log2.txt added

comment:17 in reply to:  14 Changed 13 years ago by otto@…

Replying to beirdo:

Otto: please try this patch in addition to the earlier one.

Unfortunately still crashes, fresh backtrace & log attached.

Changed 13 years ago by beirdo

comment:18 Changed 13 years ago by beirdo

Otto: another patch for you. Please apply all three patches together, and give it a try. Thanks for your patience.

Changed 13 years ago by beirdo

replaces 0001-0003 for okolsi, rebased onto current master

comment:19 Changed 13 years ago by beirdo

Otto: I have posted a single patch which contains all three previous patches, rebased onto master so it will apply correctly after the libmythdb->libmythbase change. Let me know, please.

Changed 13 years ago by otto@…

Changed 13 years ago by otto@…

Changed 13 years ago by otto@…

comment:20 in reply to:  19 Changed 13 years ago by otto@…

Replying to beirdo:

Otto: I have posted a single patch which contains all three previous patches, rebased onto master so it will apply correctly after the libmythdb->libmythbase change. Let me know, please.

Applied the patch, then started xterm with background flag from the menu. That seemed to work and then little bit later started Chrome also with background flag and from the menu. Soon after this frontend segfaulted. I've attached both bt and log. Later tested with only xterm, also segfault this time. Bt attached, looks very similar to the first one.

Changed 13 years ago by otto@…

Attachment: playback-startup-bt.txt added

comment:21 Changed 13 years ago by otto@…

Attached yet another backtrace. This is from recording playback startup and with different frontend. This fe does not have the above patch applied, otherwise it's up-to-date with most recent sources. Might be something else, but looks like there's MythSystem? involved..

Changed 13 years ago by beirdo

comment:22 Changed 13 years ago by beirdo

Otto: thanks once again for your patience. I hope this last patch (apply with the reworked one above) will get the last remaining issue there. The bug seems to be specific to when the & is at the end of the command string, and the updated settings weren't being honored, causing the instance to be deleted while we were still tracking it.

comment:23 Changed 13 years ago by beirdo

Otto: actually, these patches are now on master, so just git pull and try, please. Thanks :)

comment:24 Changed 13 years ago by otto@…

This seems to work now, thanks! :)

comment:25 Changed 13 years ago by beirdo

Excellent. I will leave this open until Feb 14 for further findings, at which point if nothing new has been found, I will close it.

Changed 13 years ago by otto@…

Attachment: playback-startup-bt2.txt added

comment:26 Changed 13 years ago by beirdo

I actually had a report of nearly precisely the same thing last night, otherwise I'd need log files as well. A patch to test is attached next.

Changed 13 years ago by beirdo

comment:27 Changed 13 years ago by beirdo

I have committed that patch to master.

comment:28 Changed 13 years ago by beirdo

Milestone: unknown0.25
Resolution: Fixed
Status: newclosed

Have a lovely Valentine's Day... Closing this ticket now. If you have any further issues that seem to be attributable to the myth_system changes, please create a new ticket.

comment:29 Changed 13 years ago by Michael T. Dean

Change DBUtil::CountClients?() to use MSqlQuery.

No need to use the mysql command-line client, anymore. Refs #9421.

Changeset: 20009dcd4d31152b330573d718859317a447b464

comment:30 Changed 13 years ago by Michael T. Dean

Make DBUtil::CountClients?() a bit more portable.

Updates the approach used by 20009dcd4d31152b330573d718859317a447b464 to work with all supported versions of MySQL. INFORMATION_SCHEMA.PROCESSLIST was added in MySQL 5.1.7, so use SHOW PROCESSLIST, instead. Thanks to Gavin Hurlbut for noticing. Refs #9421.

Changeset: 52cef7b1ae94c22c9c5b1a79f95c5afc4d48db9f

comment:31 Changed 13 years ago by Gavin Hurlbut

Resolution: Fixedfixed

Changes to MythSystemUnix? to fix when a launched program dies quickly

This hopefully will fix #9421 (first report).

Make background runs not block the foreground

The problem with running in the background in from the menu XML is that it is blocking the drawing, inputdevs, etc, and then launching in the background. If in the background, there is no reason I can think of that we need to block the UI thread. If the program launched in the background has focus, it should be receiving the keyboard input. The only one think I'm wondering is if LIRC will act oddly.

Move timeout setting to before fork

Don't bother managing a child that failed

If the child quickly failed (i.e. errored on start), there is an apparent race condition that makes it look like the child timed out, and if it was run in the background, it's deleted before the manager thread gets it, so we core dump when we try to remove it.

Changeset: b8ff1e2b92ed6c23ced6f9d622d74c7016688ef6

Note: See TracTickets for help on using tickets.