Bug 1123222
Summary: | Interrupt (core dumped) while execuing a command in su. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Shriram <shri1984ram> |
Component: | coreutils | Assignee: | Ondrej Oprala <ooprala> |
Status: | CLOSED DUPLICATE | QA Contact: | qe-baseos-daemons |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.5 | CC: | akarlsso, avaddara, ooprala, ovasik, pbrady, shri1984ram, sreber |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-09-08 10:11:37 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Shriram
2014-07-25 06:55:07 UTC
> Additional info:
> I am executing the above command from java program. After dumping core
> it stops the java application. Actually it should proceed with remaining
> steps in my program. In RHEL 6.4 it is working fine.
This might have something to do with su now killing itself with the same signal the child receives. Could you please give me more info about that last part? Or perhaps provide me with a relevant part of the java code snippet?
Thanks.
(In reply to Ondrej Oprala from comment #5) > > Additional info: > > I am executing the above command from java program. After dumping core > > it stops the java application. Actually it should proceed with remaining > > steps in my program. In RHEL 6.4 it is working fine. > > This might have something to do with su now killing itself with the same > signal the child receives. Could you please give me more info about that > last part? Or perhaps provide me with a relevant part of the java code > snippet? > Thanks. Thanks Ondrej import java.io.IOException; public class ProcessBuilderTest { public static void main(String[] args) { String[] commandArgs = { "su","root", "/tmp/command.sh" }; Process currentProcess; ProcessBuilder builder = new ProcessBuilder(commandArgs); try { currentProcess = builder.start(); int exitStatus = currentProcess.waitFor(); System.out.println(" Sub Process Ends with exitCode = " + exitStatus); currentProcess.destroy(); int i = 0; while (i < 15) { Thread.sleep(1000); System.out.println(" i value = " + i++); } } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } } Just run the above program and the prompts sleeps for one hour(3600s). Open another terminal and grep for command.sh using "ps -ef | grep command.sh". It will list the script and bash process. kill the command.sh process using "kill <pid of the command.sh>". After destroying the sub process while loop should continue its execution[because it is in main process]. In RHEL 6.4 while loop will continue its exection but in RHEL 6.5 fails and stops java main process. Hope it helps. Thanks Shriram. Any update? Hi Shriram, I'm able to reproduce the first part ("core dumped") with coreutils in 6.5, though that's just a more verbose way of su's workings. I'm so far unable to reproduce the for cycle failing. With your reproducer, both rhel 6.4 and 6.5 versions finish the loop. I'll be trying with a vanilla 6.5 today. Nope. Vanilla yields the same results :/ . Do you have anything special set/installed on your system or within java. Signal dispositions, dump/other settings in procfs...? One more thing. What version of openJDK are you using? Also, do you use any java subparts from software collections...? Thanks I am not using open jdk instead using oracle jdk 1.7-u 55 and tested with jdk 1.7-u25. Getting the same error. I am checking with the other packages.. No logs are getting dumped. Is there any way to enable loggin for this particular scenario? |