Runtime.exec() does nothing on Xscale linux

Asutosh Gopinath <[email protected]>
Newsgroups gmane.comp.java.vm.sablevm.general
Message-ID <[email protected]>
Hi,
Following code is supposed to list the content of directory.On Xscale it 
terminates printing nothing. Code runs fine on my linux PC (i686) using sablevm.


public class ListFiles
{
public static void main(String Argv[]) 
{
System.out.println("main");
try {
		
		String ls_str;
		Process ls_proc = Runtime.getRuntime().exec("/bin/ls");
		// get its output (your input) stream

	DataInputStream ls_in = new DataInputStream(ls_proc.getInputStream());
		
		try {
			while ((ls_str = ls_in.readLine()) != null)
			{
				System.out.println(ls_str);
				
			}
		} catch (IOException e)
		{
			System.out.println("caught");
			System.exit(0);
		}
	} catch (IOException e1)
	{
		e1.printStackTrace();
		System.err.println(e1);
		System.exit(1);
	}

System.exit(0);
}

}

Last few lines of strace output:

close(4)                                = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
open("/usr/local/share/sablevm/sablevm-classpath/java/util/ArrayList.class", 
O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0666, st_size=5394, ...}) = 0
old_mmap(NULL, 5394, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40017000
munmap(0x40017000, 5394)                = 0
close(4)                                = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
brk(0x3f000)                            = 0x3f000
brk(0x41000)                            = 0x41000
pipe([4, 5])                            = 0
clone(child_stack=0x40590, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND) = 
1473
write(5, "p\0261A\5\0\0\0!\24\0\0\2\0\0\0\0\0 \0\270C\1\0\0\0\0\0"..., 148) = 
148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
write(5, "\200\25)@\0\0\0\0\0\0\0\0\374y\2@\200\326\2\0\0\0\0\200"..., 148) = 
148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([] <unfinished ...>
--- SIGRTMIN (Unknown signal 32) ---
<... rt_sigsuspend resumed> )           = 32
sigreturn()                             = ?
kill(1474, SIGRTMIN)                    = 0
kill(1474, SIGRTMIN)                    = 0
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
--- SIGRT_1 (Unknown signal 33) ---
wait4(1473, NULL, __WCLONE, NULL)       = 1473
_exit(0)                                = ?



Cheers
Asutosh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.