[mythtv-commits] Ticket #9168: use of toUtf8() in myth_system_fork can *still* wedge the child: multiple mythfrontend.real processes; no sound

MythTV mythtv at cvs.mythtv.org
Tue Nov 2 16:33:47 UTC 2010


#9168: use of toUtf8() in myth_system_fork can *still* wedge the child: multiple
mythfrontend.real processes; no sound
-------------------------------------------+--------------------------------
 Reporter:  Kevin Buhr <buhr@…>            |           Owner:  beirdo    
     Type:  defect                         |          Status:  closed    
 Priority:  major                          |       Milestone:  0.24      
Component:  MythTV - General               |         Version:  Trunk Head
 Severity:  medium                         |      Resolution:  Fixed     
 Keywords:                                 |   Ticket locked:  0         
-------------------------------------------+--------------------------------

Comment (by Bill Meek <keemllib@…>):

 It appears that 'cmdargs' (or its contents) is getting stepped on.

 After applying [27064], commands from preSDWUCheckCommand and
 MiscStatusScript etc. don't always run. For example:
 {{{
 010-11-02 08:15:52.791 Launching: /usr/local/sbin/LocalPreShutdownTests.sh
 2010-11-02 08:15:52.825 PID 1848: launched
 sh: uL: not found
 2010-11-02 08:15:52.892 PID 1848: exited: status=32512, result=127
 2010-11-02 08:15:53.899 Launching: q2 (sometimes=^A2 or -2 or just empty)
 2010-11-02 08:15:53.916 PID 1849: launched
 sh: q2: not found
 }}}
 Reverting to [27063] allows the commands to run.

 Not a patch, but this (very ugly) change allows commands to run with
 [27064]:
 {{{
 --- libs/libmythdb/mythsystem.cpp       (revision 27064)
 +++ libs/libmythdb/mythsystem.cpp       (working copy)
 @@ -361,7 +361,8 @@
  #ifndef USING_MINGW
  pid_t myth_system_fork(const QString &command, uint &result)
  {
 -    const char *cmdargs = command.toUtf8().constData();
 +    char cmdargs[256];
 +    strcpy(cmdargs, command.toUtf8().constData());
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/9168#comment:5>
MythTV <http://www.mythtv.org/>
MythTV Media Center


More information about the mythtv-commits mailing list