[Bug 470645] New: SCR execute returns nil if it has been called via DBUS
https://bugzilla.novell.com/show_bug.cgi?id=470645 Summary: SCR execute returns nil if it has been called via DBUS Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: schubi@novell.com QAContact: jsrain@novell.com Found By: --- That happens temporary. I have seen this bug only with the call: ExternalProgram.cc(start_program):202 Executing 'polkit-auth' '--user' 'root' '--explicit' This call returns "sometimes" a result and "sometimes" not. Calling it on the console everything works correctly ( with and without tty_wrapper) Tested yast version: yast2-core-2.17.25-2.10 I will attach the y2log in order to show the results. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User schubi@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c1 --- Comment #1 from Stefan Schubert <schubi@novell.com> 2009-01-29 08:58:18 MST --- Created an attachment (id=268671) --> (https://bugzilla.novell.com/attachment.cgi?id=268671) y2log (please search for polkit-auth) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User schubi@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c2 --- Comment #2 from Stefan Schubert <schubi@novell.com> 2009-01-29 09:07:44 MST --- It seems that something will be cut: (see "Checking for....") 2009-01-29 17:21:35 <1> e217(8499) [y2dbus] DBusMsg.cc(arguments):439 Message has 3 arguments 2009-01-29 17:21:35 <4> e217(8499) [SCR-service] DBusServer.cc(isActionAllowed):435 User is authorized to do action org.opensuse.yast.scr.execute 2009-01-29 17:21:35 <1> e217(10923) [liby2util++] ExternalProgram.cc(start_program):202 Executing '/usr/sbin/rccron' 'status' 2009-01-29 17:21:35 <1> e217(8499) [SCR-service] DBusServer.cc(run):288 Result: $["exit":0, "stderr":"", "stdout":"Checking for Cron: "] 2009-01-29 17:21:35 <1> e217(8499) [SCR-service] DBusServer.cc(run):411 Flushing connection... 2009-01-29 17:21:35 <1> e217(8499) [SCR-service] DBusServer.cc(run):413 ...done 2009-01-29 17:21:35 <1> e217(8499) [SCR-service] DBusServer.cc(run):417 Message processed 2009-01-29 17:26:15 <1> e217(8499) [SCR-service] DBusServer.cc(isProcessRunning):471 Process /proc/8400 is running: true 2009-01-29 17:26:41 <1> e217(8499) [SCR-service] DBusServer.cc(run):172 Received request from :1.429: interface: org.opensuse.yast.SCR.Methods, method: Execute 2009-01-29 17:26:41 <1> e217(8499) [y2dbus] DBusMsg.cc(arguments):439 Message has 3 arguments 2009-01-29 17:26:41 <4> e217(8499) [SCR-service] DBusServer.cc(isActionAllowed):435 User is authorized to do action org.opensuse.yast.scr.execute 2009-01-29 17:26:41 <1> e217(11238) [liby2util++] ExternalProgram.cc(start_program):202 Executing '/usr/sbin/rccron' 'status' 2009-01-29 17:26:41 <1> e217(8499) [SCR-service] DBusServer.cc(run):288 Result: $["exit":0, "stderr":"", "stdout":"Checking for Cron: "] 2009-01-29 17:26:41 <1> e217(8499) [SCR-service] DBusServer.cc(run):411 Flushing connection... 2009-01-29 17:26:41 <1> e217(8499) [SCR-service] DBusServer.cc(run):413 ...done 2009-01-29 17:26:41 <1> e217(8499) [SCR-service] DBusServer.cc(run):417 Message processed 2009-01-29 17:26:50 <1> e217(8499) [SCR-service] DBusServer.cc(run):172 Received request from :1.429: interface: org.opensuse.yast.SCR.Methods, method: Execute 2009-01-29 17:26:50 <1> e217(8499) [y2dbus] DBusMsg.cc(arguments):439 Message has 3 arguments 2009-01-29 17:26:50 <4> e217(8499) [SCR-service] DBusServer.cc(isActionAllowed):435 User is authorized to do action org.opensuse.yast.scr.execute 2009-01-29 17:26:50 <1> e217(11341) [liby2util++] ExternalProgram.cc(start_program):202 Executing '/usr/sbin/rccron' 'status' 2009-01-29 17:26:50 <1> e217(8499) [SCR-service] DBusServer.cc(run):288 Result: $["exit":0, "stderr":"", "stdout":"Checking for Cron: ..running\n"] 2009-01-29 17:26:50 <1> e217(8499) [SCR-service] DBusServer.cc(run):411 Flushing connection... 2009-01-29 17:26:50 <1> e217(8499) [SCR-service] DBusServer.cc(run):413 ...done 2009-01-29 17:26:50 <1> e217(8499) [SCR-service] DBusServer.cc(run):417 Message processed -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User schubi@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c3 Stefan Schubert <schubi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |mvidner@novell.com |ovo.novell.com | --- Comment #3 from Stefan Schubert <schubi@novell.com> 2009-02-04 00:59:03 MST --- Martin, Ladislav can you help here please ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User mvidner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c4 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |schubi@novell.com --- Comment #4 from Martin Vidner <mvidner@novell.com> 2009-02-04 05:40:37 MST --- I am a bit lost here. Please guide me how to reproduce the problem (even if it is not deterministic). Also, in the logs I do not see any "nil" that you mention in the summary. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User schubi@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c5 Stefan Schubert <schubi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|schubi@novell.com | --- Comment #5 from Stefan Schubert <schubi@novell.com> 2009-02-04 06:16:02 MST --- It is not a nil but it is a stripped return string in stdout: See comment #2: $["exit":0, "stderr":"", "stdout":"Checking for Cron: "] The same call returns later: $["exit":0, "stderr":"", "stdout":"Checking for Cron: ..running\n"] You can reproduce it by calling the "status" of the "cron" service in the YaST-Webclient. Much often it happens in the "permission" module of the YaST-Webclient (e.g. search for permissions of the user "root") -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User lslezak@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c6 --- Comment #6 from Ladislav Slezak <lslezak@novell.com> 2009-02-04 07:15:09 MST --- Um, I did several hundreds of SCR calls over DBus, all were OK. But I suspect ExternalProgram class from doing something bad. This class is used in both components (.bash_output agent and in tty_wrapper). If I start "date" for several times [*] in tty_wrapper the output is sometimes lost: 189 St úno 4 15:05:11 CET 2009 190 191 St úno 4 15:05:11 CET 2009 192 St úno 4 15:05:12 CET 2009 Here, the 190th line was lost. I have no idea how to debug it, I can't imagine running it 200 times in gdb... I'll check the code more carefully. [*] for num in `seq 1 1000`; do echo -n "$num " && /usr/lib/YaST2/bin/tty_wrapper date; done -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User schubi@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c7 --- Comment #7 from Stefan Schubert <schubi@novell.com> 2009-02-04 07:30:03 MST --- You can reproduce this error very often with "polkit-auth --user root --explicit" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User schubi@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c8 --- Comment #8 from Stefan Schubert <schubi@novell.com> 2009-02-04 07:35:24 MST --- comment #4 Sorry Martin, the headline of that bug concerning "nil" is wrong and missleading. My fault. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 Stefan Schubert <schubi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|SCR execute returns nil if |SCR execute returns |it has been called via DBUS |incomplete string if it has | |been called via DBUS -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User lslezak@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c9 --- Comment #9 from Ladislav Slezak <lslezak@novell.com> 2009-02-04 08:17:29 MST --- I have added debugging info to the tty_wrapper and it prints the total number of received bytes on stdout. The interesting thing is that this number is also lost when the stdout is missing: 429 St úno 4 16:03:40 CET 2009 Read 29 430 431 St úno 4 16:03:40 CET 2009 Read 29 Here, 430th run doesn't print the output and the total size is also missing. When the counter is printed on stderr it is printed correctly even when the stdoutput is missing: 75 St úno 4 16:13:54 CET 2009 Stderr: Read 29 76 Stderr: Read 29 77 St úno 4 16:13:54 CET 2009 Stderr: Read 29 (BTW calling std::cout.flush() at the end doesn't help.) It's probably something more serious in the system related to stdout handling... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User lslezak@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c10 --- Comment #10 from Ladislav Slezak <lslezak@novell.com> 2009-02-04 08:21:26 MST --- Created an attachment (id=270042) --> (https://bugzilla.novell.com/attachment.cgi?id=270042) counter patch for tty_wrapper Here is the counter patch to reproduce my tests. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User mvidner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c11 --- Comment #11 from Martin Vidner <mvidner@novell.com> 2009-02-04 08:49:49 MST --- Some time ago I tried to catch bugs in ag_background (another subprocess wrapper) and wrote a testsuite: http://svn.opensuse.org/svn/yast/trunk/core/agents-perl/testsuite Its main drawback is that it is currently disabled :-(( but it could be used as a building block to catch bugs here. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User mvidner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c12 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #12 from Martin Vidner <mvidner@novell.com> 2009-02-18 02:38:32 MST --- I can reproduce the case from comment 6, but it is resisting my attempts at debugging. As soon as I strace it or redirect the output, the bug seems to go away... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User mvidner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c13 --- Comment #13 from Martin Vidner <mvidner@novell.com> 2009-02-25 07:07:32 MST --- It turns out write(2) was returning errno:EINTR, probably because of the SIGCHLD that we explicitly asked for :-/ I don't know the proper way of dealing with that on the iostream or FILE level, so I fixed it on the syscall level, looping over write(2): http://lists.opensuse.org/yast-commit/2009-02/msg00568.html Note that there has been already an (unsuccessful) attempt to call this a bug in fwrite: http://sourceware.org/bugzilla/show_bug.cgi?id=5998 The fix is in the trunk, and will be in yast2-core-2.18.4. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User mvidner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c14 --- Comment #14 from Martin Vidner <mvidner@novell.com> 2009-02-25 09:18:15 MST --- Ugh, one more fix was needed, this time on the input end: http://lists.opensuse.org/yast-commit/2009-02/msg00571.html -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=470645 User mvidner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=470645#c15 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #15 from Martin Vidner <mvidner@novell.com> 2009-03-06 06:46:53 MST --- yast2-core-2.18.4 submitted -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com