Skip to main content

Squawk Helloworld Error

3 replies [Last post]
anandkulkarni86
Offline
Joined: 2011-05-04
Points: 0

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:"Times New Roman";}

I am trying to run HelloWorld program using squawk. I have successfully build the squawk code on ubuntu. The test program runs fine. But when I run the helloworld test program, i get this error. I tried using native code in branches directory, and also the code in trunk. Both give the following error. Any help provided in this is greatly appreciated! :)

$ ./d user-suite tests/HelloWorld
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
PLATFORM_TYPE=NATIVE
[running user-suite...]
[compiling user project at tests/HelloWorld...] [linking user project at tests/HelloWorld...] Total time: 0s

$ ./squawk -suite:tests/HelloWorld/HelloWorld
java.lang.RuntimeException: Can't find native symbol __xfstat. OS Error: ./squawk: undefined symbol: __xfstat
at java.lang.Throwable.<init>(bci=16)
at java.lang.Throwable.<init>(bci=5)
at java.lang.Exception.<init>(bci=6)
at java.lang.RuntimeException.<init>(bci=6)
in virtual method #13 of com.sun.cldc.jna.NativeLibrary(bci=118)
at com.sun.cldc.jna.NativeLibrary.getFunction(bci=6)
at com.sun.squawk.platform.posix.natives.LibCImpl.<init>(bci=84)
at com.sun.squawk.platform.posix.linux.natives.LibCImpl.<init>(bci=5)
in virtual method #11 of com.sun.squawk.Klass(bci=53)
at java.lang.Class.newInstance(bci=86)
at com.sun.cldc.jna.Native.loadLibrary(bci=59)
at com.sun.squawk.platform.posix.natives.LibC.<clinit>(bci=27)
in virtual method #109 of com.sun.squawk.Klass(bci=49)
in virtual method #106 of com.sun.squawk.Klass(bci=328)
in virtual method #36 of com.sun.squawk.Isolate(bci=13)
in static method #4 of com.sun.squawk.VM(bci=11)
at com.sun.squawk.platform.posix.GCFFileImpl.<init>(bci=10)
in virtual method #11 of com.sun.squawk.Klass(bci=53)
in static method #2 of com.sun.squawk.platform.Platform(bci=40)
in static method #5 of com.sun.squawk.platform.Platform(bci=9)
in static method #3 of com.sun.squawk.io.j2me.file.Protocol(bci=6)
in virtual method #43 of com.sun.squawk.io.j2me.file.Protocol(bci=9)
in virtual method #45 of com.sun.squawk.io.j2me.file.Protocol(bci=20)
at com.sun.squawk.io.j2me.file.Protocol.openInputStream(bci=8)
at com.sun.squawk.io.ConnectionBaseAdapter.openDataInputStream(bci=8)
at javax.microedition.io.Connector.openDataInputStream(bci=38)
in static method #4 of com.sun.squawk.ObjectMemoryLoader(bci=54)
in static method #3 of com.sun.squawk.Suite(bci=16)
in static method #4 of com.sun.squawk.Suite(bci=6)
in virtual method #44 of com.sun.squawk.Isolate(bci=28)
at com.sun.squawk.Isolate.<init>(bci=132)
at com.sun.squawk.Isolate.<init>(bci=16)
at com.sun.squawk.JavaApplicationManager.main(bci=138)
in virtual method #95 of com.sun.squawk.Klass(bci=25)
at com.sun.squawk.Isolate.run(bci=313)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VMThread(bci=42)
in static method #3 of com.sun.squawk.VM(bci=6) Error constructing Isolate based on suite: file://tests/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: ExceptionInInitializer: com.sun.squawk.platform.posix.natives.LibC:java.lang.RuntimeException: Can't find native symbol __xfstat. OS Error: ./squawk: undefined symbol: __xfstat

--------------------------------------------------------------------
GCs: 0 full, 0 partial
** VM stopped: exit code = 999 **

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
qawsed123
Offline
Joined: 2009-10-21
Points: 0

Hello again (after one year).
I've tried to execute a HelloWorld test with the last version of the Squawk-native and I get same the error (platform Opensuse 11 x86).
/squawk -suite:tests2/HelloWorld/HelloWorld
java.lang.RuntimeException: Can't find native symbol __xfstat. OS Error: ./squawk: undefined symbol: __xfstat
at java.lang.Throwable.<init>(bci=16)
at java.lang.Throwable.<init>(bci=5)
at java.lang.Exception.<init>(bci=6)
at java.lang.RuntimeException.<init>(bci=6)
in virtual method #13 of com.sun.cldc.jna.NativeLibrary(bci=118)
at com.sun.cldc.jna.NativeLibrary.getFunction(bci=6)
at com.sun.squawk.platform.posix.natives.LibCImpl.<init>(bci=84)
at com.sun.squawk.platform.posix.linux.natives.LibCImpl.<init>(bci=5)
in virtual method #11 of com.sun.squawk.Klass(bci=53)
at java.lang.Class.newInstance(bci=86)
at com.sun.cldc.jna.Native.loadLibrary(bci=59)
at com.sun.squawk.platform.posix.natives.LibC.<clinit>(bci=27)
in virtual method #109 of com.sun.squawk.Klass(bci=49)
in virtual method #106 of com.sun.squawk.Klass(bci=328)
in virtual method #36 of com.sun.squawk.Isolate(bci=13)
in static method #4 of com.sun.squawk.VM(bci=11)
at com.sun.squawk.platform.posix.GCFFileImpl.<init>(bci=10)
in virtual method #11 of com.sun.squawk.Klass(bci=53)
in static method #2 of com.sun.squawk.platform.Platform(bci=40)
in static method #5 of com.sun.squawk.platform.Platform(bci=9)
in static method #3 of com.sun.squawk.io.j2me.file.Protocol(bci=6)
in virtual method #43 of com.sun.squawk.io.j2me.file.Protocol(bci=9)
in virtual method #45 of com.sun.squawk.io.j2me.file.Protocol(bci=20)
at com.sun.squawk.io.j2me.file.Protocol.openInputStream(bci=8)
at com.sun.squawk.io.ConnectionBaseAdapter.openDataInputStream(bci=8)
at javax.microedition.io.Connector.openDataInputStream(bci=38)
in static method #4 of com.sun.squawk.ObjectMemoryLoader(bci=54)
in static method #3 of com.sun.squawk.Suite(bci=16)
in static method #4 of com.sun.squawk.Suite(bci=6)
in virtual method #44 of com.sun.squawk.Isolate(bci=28)
at com.sun.squawk.Isolate.<init>(bci=132)
at com.sun.squawk.Isolate.<init>(bci=16)
at com.sun.squawk.JavaApplicationManager.main(bci=138)
in virtual method #95 of com.sun.squawk.Klass(bci=25)
at com.sun.squawk.Isolate.run(bci=313)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VMThread(bci=42)
in static method #3 of com.sun.squawk.VM(bci=6)
Error constructing Isolate based on suite: file://tests2/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: ExceptionInInitializer: com.sun.squawk.platform.posix.natives.LibC:java.lang.RuntimeException: Can't find native symbol __xfstat. OS Error: ./squawk: undefined symbol: __xfstat
--------------------------------------------------------------------
GCs: 0 full, 0 partial
** VM stopped: exit code = 999 **

Thanks

qawsed123
Offline
Joined: 2009-10-21
Points: 0

Hi! I think that there is a mistake in:
/squawk-native/cldc/src/com/sun/squawk/platform/posix/linux/natives/LibCImpl.java
Line 216
} else if (nominalName.equals("fstat")) {
- return "__xfstat";

+ return "__fxstat";
So, "__fxstat" instead of "__xfstat". The I use this instructions for compile and build my Squawk, and then try to generate and execute a helloworld test (Helloworld test files of trunk version).
./d.sh clean
./bld.sh
./d.sh copyphoneme
./d.sh
./d.sh -prod -mac -o2 rom -metadata cldc imp debugger
./d.sh user-suite test2/HelloWorld
./squawk -suite:test2/HelloWorld/HelloWorld

Message:
Error constructing Isolate based on suite: file://tests2/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: invalid hash for parent (memory:bootstrap): expected 9054731, received 9068046

--------------------------------------------------------------------
GCs: 0 full, 0 partial
** VM stopped: exit code = 999 **

Thanks.

qawsed123
Offline
Joined: 2009-10-21
Points: 0

Wow, wow WOW!
It works!
I programmed my own HelloWorld MIDlet (no delegating/tests/HelloWorld) yesterday and then I converted it into a suite format. Finallt I ran it and Squawk showed the message! Obviously it passed com.sun.squawk.Test as well.
This morning I've build the Squawk for my target platform (phyCORE-i.MX31 with arm-1136jfs-gnueabi-gcc and Linux ARM) and it works at once.
Now I want to create a MIDlet test that shows some system properties, but I have no idea about J2ME APIs.
Thanks for all.
PS: My Squawk revision is 760.