This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Core dump (Illegal instruction) with crosstool's GCJ


Hi there (Dan, I presume (o:),

I've been doing tests with crosstools' GCJ for the last couple of weeks, and now I have unfortunately run into some problems.

Until recently I only had problems when I trying to compile any small Java-source with "-static". Applications linked like that wouldn't execute on the target and would cause a core dump immediately after start (signal 4, Illegal instruction).

However, now I've have a small test-example (dynamically linked) using the java.lang.reflect.Proxy-class, that'll fail consequently (Illegal instruction) performing some specific Java-action.

I've tried the same application with gcj-3.4 under MinGW and gcj-3.3.1 under Cygwin, and here it works.

Any ideas to how to overcome this problem?

The crosscompiler has been build on cygwin with crosstool-0.28-rc13 with the for the ppc405-target with gcc-3.4.0-glibc-2.2.5.dat.
A similar compiler has been created under my RedHat, and also a cygwin-compiler with glibc-2.3.2.


The target system runs the a root-filesystem from ELDK 2.0.2 (or maybe 2.2.0) from Denx Software, and the kernel is a patched 2.4.20 from DAVE (http://www.dave-tech.it/) specific for my PPChameleonEVB-board.

I've attached the sourcefile if anyone feels like trying...

Best regards,
 Martin Egholm
import java.lang.reflect.*;

public class ProxyTest2
{
	public static void main(String[] args)
		throws
			SecurityException,
			NoSuchMethodException,
			IllegalArgumentException,
			InstantiationException,
			IllegalAccessException,
			InvocationTargetException
	{
		System.out.println("1: starting...");

		ClassLoader classLoader = Runnable.class.getClassLoader();

		System.out.println("2: classloader: " + classLoader);

		Class proxyClass = Proxy.getProxyClass(classLoader, new Class[] { Runnable.class });

		System.out.println("3: proxyClass: " + proxyClass);

		Constructor constructor =
			proxyClass.getConstructor(new Class[] { InvocationHandler.class });

		System.out.println("4: constructor: " + constructor);

		InvocationHandler myHandler = new InvocationHandler()
		{
			public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
			{
				System.out.println("In invoke...: " + method.getName());
				return null;
			} // invoke
		}; // myHandler

		Runnable r = (Runnable) constructor.newInstance(new Object[] { myHandler });

		System.out.println("5: got proxy! About to invoke...");

		r.toString();
	} // main
} // ProxyTest2
------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]