Open ghost opened 2 years ago
Wow! Cool! I think I see what the problem is, and how to fix it, but it will require a bit of patience from you.
About 6 months ago (circa November 2021) The AtomSpace was switched to use a C++ smart-pointer to hold references. This means that you can no longer use AtomSpace * p = new AtomSpace()
in your code; you must use AtomSpacePtr p = createAtomSpace()
instead. The older style might work, sometimes; depending on C++ implementation details. (I've seen it work! Surprising but true!) but overall, you must port to the new style, in order to get things to work.
More details in the next comment.
A C++ smart pointer is three words: one word is a pointer to the "actual object", plus an atomic, plus some other stuff - messy low-level CPU stuff. To use this in your jni code, you have to treat it excactly the same way that you treat Handle
. In fact, you can cast to/from AtomSpacePtr
and Handle
.
So, in your com_cogroid_atomspace_whatever.cc
file, you need code similar to this pseudocode:
JNIEXPORT jlong JNICALL Java_com_cogroid_atomspace_something
(JNIEnv *env, jobject thisObj, jlong as_jni_ptr) {
opencog::AtomSpacePtr *ptr_to_asp = NULL;
if (as_jni_ptr != 0) {
ptr_to_asp = new AtomSpacePtr(); // create a new smart pointer
*ptr_to_asp = createAtomSpace(); // create a new AtomSpace and assign it to the smart ptr.
}
// equivalently, the following would work:
AtomSpacePtr asp = createAtomSpace();
void* ptr_to_ptr = malloc(sizeof (AtomSpaacePtr));
AtomSpacePtr* pasp = ptr_to_ptr;
*pasp = asp;
// here, pasp->use_count() prints the usecount,
// and pasp->get() returns a pointer to the actual AtomSpace
and then, in the destructor/finalizer, you would
*ptr_to_asp = nullptr; // decrement use count on the AtomSpace
delete ptr_to_asp; // C++ delete the smart pointer.
I hope this makes sense and is clear; if not, let me know.
If you haven't already written code for Handles, you will need to do something similar to the above. If you have working code for handles, then do exactly that.
More pseudocode. To actually use the AtomSpace, your c++ code would look like this:
... foo(JNIEnv *env, jobject thisObj, jlong as_jni_ptr) {
void* ptr_to_ptr = (void*) as_jni_ptr; // get pointer to the 3-word smart pointer.
AtomSpacePtr* pasp = ptr_to_ptr; // let C++ know what the 3-word area is.
AtomSpacePtr asp = *pasp; // make a copy of the smart pointer. (optional)
if (nullptr == asp) error();
asp->any_atomspace_method();
...
// exiting block scope automatically deletes asp. That's fine.
// print pasp->use_count() if confused.
// the actual atomspace is at pasp->get() so the following would also work:
AtomSpace* as = pasp->get();
as->any_atomspace_method();
}
You don't have to make a copy of the smart pointer, but it will be easier to read the code if you do.
Wow! Cool! I think I see what the problem is, and how to fix it, but it will require a bit of patience from you.
About 6 months ago (circa November 2021) The AtomSpace was switched to use a C++ smart-pointer to hold references. This means that you can no longer use
AtomSpace * p = new AtomSpace()
in your code; you must useAtomSpacePtr p = createAtomSpace()
instead. The older style might work, sometimes; depending on C++ implementation details. (I've seen it work! Surprising but true!) but overall, you must port to the new style, in order to get things to work.More details in the next comment.
I don't think that is the problem because I used the same code as createAtomSpace() in creating AtomSpace. Please see following extractions.
...
template< class... Args >
AtomSpacePtr createAtomSpace( Args&&... args )
{
return std::make_shared<AtomSpace>(std::forward<Args>(args) ...);
}
...
...
template <typename T>
class SPW {
std::shared_ptr<T> _object;
public:
template <typename ...ARGS>
explicit SPW(ARGS... a) {
_object = std::make_shared<T>(a...);
}
explicit SPW(std::shared_ptr<T> obj) {
_object = obj;
}
virtual ~SPW() noexcept = default;
long instance() {
return reinterpret_cast<long>(this);
}
std::shared_ptr<T> object() {
return _object;
}
T *get() {
return _object.get();
}
static SPW<T> *get(long jni_ptr) {
return reinterpret_cast<SPW<T> *>(jni_ptr);
}
static std::shared_ptr<T> object(long jni_ptr) {
return get(jni_ptr)->get();
}
static long dispose(long jni_ptr) {
auto obj = get(jni_ptr);
delete obj;
return 0;
}
};
...
...
JNIEXPORT jlong JNICALL Java_com_cogroid_atomspace_AtomSpace_jni_1init
(JNIEnv *env, jobject thisObj) {
cogroid::SPW<opencog::AtomSpace> *spw_asp = new cogroid::SPW<opencog::AtomSpace>();
return spw_asp->instance();
}
...
Shouldn't this:
static std::shared_ptr<T> object(long jni_ptr) {
return get(jni_ptr)->get();
}
be this:
static std::shared_ptr<T> object(long jni_ptr) {
return get(jni_ptr)->object();
}
That's because get(jni_ptr)
returns SPW<T> *
-- and so get(jni_ptr)->get()
returns T*
-- wherereas get(jni_ptr)->object()
returns std::shared_ptr<T>
.
However, it does not seem that you actually call the above methods in your code, so that is not the source of the problem. So, some more comments follow, as I review things.
Looking at your tombstone file, I see libguile-2.2.so
-- Is guile-3.0 not available for Android? Most of the atomspace will work with guile-2.2 but there are perhaps some minor obscure problem areas where it might not.
So what's in datomspace-test.txt
? You said "App runs about 30 seconds, then it crashes." -- How far did it get in Tester.java
? Did it actually get through at least one call to poll_result()
? Or did it fail before the very first begin_eval()
?
Tester.java
should be modified to keep polling until there is no more output:
while (true) {
rs = se.poll_result();
writeLog("poll_result();");
writeLog(rs);
if (rs == "") break;
}
The reason for this is that you are sending the entire file contents to scheme, in one big lump. If there are multiple scheme blocks in that file, a lot of output might be generated. You should wait for all of it to be processed, before moving to the next file.
There's another design issue, that might cause problems with guile-2.2 -- it does not like long strings. You are taking the contents of each file, and converting it to one big string. That string then is copied into C++, and then the C++ string is copied into a SCM
guile object. Then, finally, the guile evaluator runs on the SCM
object, and then, much later, the guile garbage collector tries to collect that SCM
object. The size of the SCM
object is about the same as the size of the input file you provided.
If you are trying to load genetic or protein data from agi-bio, these files can be 50 MBytes or 100MBytes long, containing millions of scheme statements in them. I've noted in the past that if you send strings longer than a few MBytes to the guile-2.2 evaluator, it will run for a while, and then crash in weird ugly ways. I don't know if this is still a problem in guile-3.0 or not.
There are several solutions to this large-file problem, but first, I want to know how far things have gotten... are you able to run any scheme statements at all? Or does it work fine, and only crash much later, after you've already done lots of scheme evals?
So what's in
datomspace-test.txt
? You said "App runs about 30 seconds, then it crashes." -- How far did it get inTester.java
? Did it actually get through at least one call topoll_result()
? Or did it fail before the very firstbegin_eval()
?
I failed at following statement:
SchemeEval se = new SchemeEval(pv);
The tombstone file shows that guile is crashing somewhere inside of gc, and that it has crashed because it tried to touch something about 400 bytes past the end of a 128KByte sized block (at dd880000-dd9fffff rw- 0 180000 [anon:libc_malloc]
) Normally, the gc does not run for quite a while -- until you've done a fair amount of computing in scheme. So it seems like ... some fair amount of scheme code must have already been run. If so, then ... well, debugging gets a bit harder.
For your test files in Tester.java
you should try things like
(+ 2 2)
(gc)
(display "Hello world\n")
(gc)
(gc-stats)
You could try that in one file, or even better: four files, one line each. Does that work?
whoops we posted at the same time. One moment, let me review...
It failed at following statement:
SchemeEval se = new SchemeEval(pv);
Are you sure? That does not match the tombstone file. (I should have looked at the tombstone file more carefully; I would have been able to answer my own questions.) The tombstone file shows a crash in this code:
static void immortal_thread(void)
{
scm_with_guile(c_wrap_init_only_once, NULL);
set_thread_name("atoms:immortal");
which means that it already crashed in your java wrapper SchemeEval.init_scheme();
so this should not have advanced past that.
So the questions are:
SchemeEval.init_scheme();
finished and returned?SchemeEval.init_scheme();
returned even though the stack trace shows that it's still running in there ... I need to eat dinner now. What timezone are you in? Perhaps a chat on discord might be faster?
I created a version with debug printfs that surround the area that crashes in in the tombstone. You can get it from there: https://github.com/linas/atomspace/tree/android-dbg so, maybe like this:
cd atomspace-git
git checkout -b arm-dbg
git pull https://github.com/linas/atomspace/ android-dbg
cd build; make; make install
Then capture the prints to stdout and post those.
BTW, there is also a completely different possibility, too. Can you get a guile shell? If so, then the following should work:
(use-modules (opencog))
(Concept "foo")
I created a version with debug printfs that surround the area that crashes in in the tombstone. You can get it from there: https://github.com/linas/atomspace/tree/android-dbg so, maybe like this:
cd atomspace-git git checkout -b arm-dbg git pull https://github.com/linas/atomspace/ android-dbg cd build; make; make install
Then capture the prints to stdout and post those.
BTW, there is also a completely different possibility, too. Can you get a guile shell? If so, then the following should work:
(use-modules (opencog)) (Concept "foo")
I don't know how to capture stdout and stderr on Android app. Can you write logs to /storage/emulated/0/Download/datomspace-test.txt file?
I am thinking of that in case of this issue can not be fixed, I can write a simulated SchemeEval class which converts scheme code to javascript using scheme2js, then runs javascript code in Atomize - JavaScript Sandbox for AtomSpace.
Atomize - JavaScript Sandbox for AtomSpace now can convert scheme code to javascript using scheme2js and can run it.
If this issue can not be fixed, I will write SchemeEval class which contains a flag for simulating or not. If simulating is true, it will convert scheme code to javascript and then run it. If simulating is false, it will call SchemeEval class of AtomSpace.
dAtomSpace Tester with Atomize
Download datomspace-tester.apk
Install datomspace-tester.apk (Do not run!)
Go to Settings -> Apps -> dAtomSpace Tester. Set Storage permission.
Run dAtomSpace Tester
View results in datomspace-test.txt file in Download folder
in case of this issue can not be fixed
I'm fairly certain the issue is in some code that we control, and thus can be fixed.
scheme2js
This won't work: there is some heavy/complicated interfacing to call c++ code from scheme (and vice-versa).
Install datomspace-tester.apk
How do I install?
write logs to
/storage/emulated/0/Download/datomspace-test.txt
I'll do that in just a few minutes.
write logs to
/storage/emulated/0/Download/datomspace-test.txt
Done. Edit opencog/guile/SchemeEval.cc
if you need to change this (its in two places)
Install datomspace-tester.apk
How do I install?
scheme2js
This won't work: there is some heavy/complicated interfacing to call c++ code from scheme (and vice-versa).
I think it will work. The process is javascript <--> java <--> jni C code <--> AtomSpace classes.
(ConceptNode "dream") will be converted to ConceptNode("dream"). So I have to add function definition "function ConceptNode(name) { }". I have to test and add all function definitions which are available on scheme files of AtomSpace.
However, this process will be very slow. So it is better if this issue is fixed.
The process is javascript <--> java <--> jni C code <--> AtomSpace classes.
Naively, that is correct, but you are vastly underestimating the actual complexity. The code in SchemeEval.cc is big and bloated not because it's guile, but because there's dozens of needed functions in there. Plus also SchemePrimitive.h
. It's .. complicated.
How do I install?
OK I will try that, but I would like it much better if you did most of the work. Don't make me do things that give me headaches ...
OK, I've installed. I now see a plain panel. At the top it says "dAtomSpace Tester" and then URL: and then a red line, a blinking cursor on the red line, a button next to the red line that says "DOWNLOAD & RUN" and then a blank white page. At the very bottom: it says
Log File:
/storage/sdcard0/Download/datomspace-test.txt
Note that my logfile is in a different location from yours.
OK, I've installed. I now see a plain panel. At the top it says "dAtomSpace Tester" and then URL: and then a red line, a blinking cursor on the red line, a button next to the red line that says "DOWNLOAD & RUN" and then a blank white page. At the very bottom: it says
Log File: /storage/sdcard0/Download/datomspace-test.txt
Note that my logfile is in a different location from yours.
You open 'Download' folder, then view datomspace-test.txt file for results.
After I compile AtomSpace with your SchemeEval.cc and run, I receive datomspace-test.txt file as:
===== PseudoValue =====
isAtom: true
isNode: false
isLink: false
isType: true
disposed: true
===== AtomSpace =====
isAtom: true
isNode: false
isLink: false
isType: true
getHash: 2
toString(indent): indent(AtomSpace "(uuid . 2)")
toShortString(indent): indent(AtomSpace "(uuid . 2)")
disposed: true
===== SchemeEval =====
duude enter init_scheme tid=7776
duude enter SchemeEval() ctor tid=7776 this=0xff80c134 as=0x0
duude enter init_only_once done=0
duude init_only_once gonna make immortal me=7776
duude init_only_once done make immortal me=7776
duude enter immortal tid=7818
This is tombstone file.
And then what ... I guess it hangs after the enter immortal tid=7818
? Is it a hang, or a crash?
It should have printed this:
duude enter immortal tid=7818
duude enter cwrap_niit_only_once tid=7818
duude exit cwrap_niit_only_once tid=7818
duude immortal done with guile init tid=7818
duude return from init_only_once me=7776
duude in SchemeEval() ctor before wrap_init this=0x55aae3c7de40
duude in SchemeEval() ctor after wrap_init this=0x55aae3c7de40
When I do it, and look at the text file, I don't see any of what you have above. Instead, I get a java stack trace that looks like its due to my clicking on the "INSTALL & RUN" button, with the bad URL.
It says something like ENOENT file not found
(that's a standard error message, its coming from guile-snarf
(so it seems guile is running) and then java.io.FileStream
and com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
and more which looks like a very ordinary file-not-found error because my URL was bad ...
When I do it, and look at the text file, I don't see any of what you have above. Instead, I get a java stack trace that looks like its due to my clicking on the "INSTALL & RUN" button, with the bad URL.
It says something like
ENOENT file not found
(that's a standard error message, its coming fromguile-snarf
(so it seems guile is running) and thenjava.io.FileStream
andcom.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
and more which looks like a very ordinary file-not-found error because my URL was bad ...
That is caused by that the app has not permission to write to sdcard. You have to set permission for the app and run again.
There's no tombstone file in the Download
directory. The datomspace-test.txt
file just reports my failed URL attempts. I picked a file that looked OK .. I get this:
===== /storage/sdcard0/Download/jsb/fs/ConceptNode.scm
java.net.MalformedURLException: etc.
com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
etc.
I tried other variants, but none worked.
I looked at your tombstone file .. it looks a lot like your earlier one. The stack trace is more or less the same as before. ... its crashing in the GC. The printf's affirm the stack trace in the tombstone file: immortal_thread(void)
was called, which then calls scm_with_guile(c_wrap_init_only_once, NULL);
There is a print statement in c_wrap_init_only_once
but that printf never happens. This is consistent with the tombstone stack.
As before, the GC crashed trying to access some invalid address. This time, the address is different than before; this time, its some unlabelled 4K page between some shared libs, not too far away from a libc_malloc pool. Close enough that it's plausible that the GC wanted to search the malloc pool, got confused, and wandered away from the pool to a nearby area.
This suggests that there's a bug with the GC. If this is happening only on arm, and you've tested on non-arm android, then ... (I'm confused .. did you test on non-arm android? or some non-arm java system? ) ...
The easiest thing to try is to find some other version of the GC, ideally a newer version, and see if that works. Trying older versions are worthwhile, too.
A little bit harder is to download the code for the gc, and compile it yourself (its not hard) and see if that works. It's bdw-gc.
Can you explain what is happening on my phone? Did the atomspace initialize, or not? Did guile initialize, or not, on my phone?
That is caused by that the app has not permission to write to sdcard.
But it wrote to the txt file just fine! And the txt file is on the sdcard, in the Download directory.
There's no tombstone file in the
Download
directory. Thedatomspace-test.txt
file just reports my failed URL attempts. I picked a file that looked OK .. I get this:===== /storage/sdcard0/Download/jsb/fs/ConceptNode.scm java.net.MalformedURLException: etc. com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170) etc.
I tried other variants, but none worked.
Please try following URL: https://github.com/cogroid/d-atomize-bin/raw/main/samples/Tests.js. The URL is for javascript file in JavaScript Sandbox format which contains following function:
function __exec__(data) {
}
This suggests that there's a bug with the GC. If this is happening only on arm, and you've tested on non-arm android, then ... (I'm confused .. did you test on non-arm android? or some non-arm java system? ) ...
I tested on non-arm java system (java 64bit and 32bit for linux). On that systems, it worked well.
Can you explain what is happening on my phone? Did the atomspace initialize, or not? Did guile initialize, or not, on my phone?
Without log file, I don't know what happens on your phone. Can you do following?
With dAtomSpace Tester which you download here, atomspace can be initialized but guile is not initialized because it is not called (if it is called, it will crash).
The easiest thing to try is to find some other version of the GC, ideally a newer version, and see if that works. Trying older versions are worthwhile, too.
A little bit harder is to download the code for the gc, and compile it yourself (its not hard) and see if that works. It's bdw-gc.
I am building gc-8.0.6.tar.gz. When it will complete, I will update log file and tombstone file.
The easiest thing to try is to find some other version of the GC, ideally a newer version, and see if that works. Trying older versions are worthwhile, too. A little bit harder is to download the code for the gc, and compile it yourself (its not hard) and see if that works. It's bdw-gc.
I am building gc-8.0.6.tar.gz. When it will complete, I will update log file and tombstone file.
I built gc-8.0.6.tar.gz and results were:
===== PseudoValue =====
isAtom: true
isNode: false
isLink: false
isType: true
disposed: true
===== AtomSpace =====
isAtom: true
isNode: false
isLink: false
isType: true
getHash: 2
toString(indent): indent(AtomSpace "(uuid . 2)")
toShortString(indent): indent(AtomSpace "(uuid . 2)")
disposed: true
===== SchemeEval =====
duude enter init_scheme tid=19464
duude enter SchemeEval() ctor tid=19464 this=0xff80c12c as=0x0
duude enter init_only_once done=0
duude init_only_once gonna make immortal me=19464
duude init_only_once done make immortal me=19464
duude enter immortal tid=19502
This is tombstone file.
I removed .go from cache folder of guile package and it did not crash. But it runs too long, may be it compile .scm files.
I removed .go from cache folder of guile package and it did not crash. But it runs too long, may be it compile .scm files.
Ah! This is interesting! But now I am very confused -- I thought that only guile-3.0 used *.go files, and that you were using only guile-2.2 !??
Yes, the .go files contain guile bytecode; yes, they are the result of compiling .scm files. And yes, they take a very long time to compile - painfully long -- several minutes on my main desktop. However, the compile is done only once; The second and later startup should be fast. Removing the .go files will cause a recompile. Sometimes (but not always) changing the .scm files will cause a recompile. On rare occasions, one can have stale *.go files that are broken, and exhibit crazy nonsense errors. This happens once or twice a year for me...
I have no idea if the *.go files are architecture-dependent. They might contain amd64 or i386 assembly in them. There might be differences in stack-growth direction, memory mapping, endian-ness. Differences in how scheme objects are laid out in memory.
The safe solution is to remove the .go files, compile them once, on arm, and then ship the new .go files as a part of the apk. The compilation should happen automatically, but there is also a way to trigger it manually. I've never done a manual compile for the atomspace ...
Huh apparently, guile-2.2 also creates .go files. OK, I'd forgotten about that. I did find some go files in your opencog/java/data/armv7/guile.zip
but those are go files for the guile system. Compiling those will take hours. Maybe many hours. I did not see any opencog .go files in there. For fast startup, you will need to provide opencog *.go files, too.
Here's the full contents of the file (as of last night) Note that sometimes I get guile-snarf errors, and sometimes not. The first thing I did was to try to open an empty URL:
java.io.FileNotFoundException: /storage/emulated/0/guile/bin/guile-snarf: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:453)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
at com.cogroid.atomspace.tester.MainActivity$RunTestsRunnable.run(MainActivity.java:124)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:437)
... 13 more
===== =====
java.net.MalformedURLException: Protocol not found:
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== aaaa =====
java.net.MalformedURLException: Protocol not found: aaaa
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== aaaa =====
java.net.MalformedURLException: Protocol not found: aaaa
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== aaaa =====
java.net.MalformedURLException: Protocol not found: aaaa
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== aaaa =====
java.net.MalformedURLException: Protocol not found: aaaa
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== aaaa =====
java.net.MalformedURLException: Protocol not found: aaaa
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== aaaa =====
java.net.MalformedURLException: Protocol not found: aaaa
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== jsb/js/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: jsb/js/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== jsb/js/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: jsb/js/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== jsb/js/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: jsb/js/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== jsb/fs/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: jsb/fs/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== jsb/fs/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: jsb/fs/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== jsb/fs/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: jsb/fs/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== /storage/sdcard0/Download/jsb/fs/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: /storage/sdcard0/Download/jsb/fs/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== /storage/sdcard0/Download/jsb/fs/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: /storage/sdcard0/Download/jsb/fs/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
===== /storage/sdcard0/Download/jsb/fs/ConceptNode.js =====
java.net.MalformedURLException: Protocol not found: /storage/sdcard0/Download/jsb/fs/ConceptNode.js
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
java.io.FileNotFoundException: /storage/emulated/0/guile/bin/guile-snarf: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:453)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
at com.cogroid.atomspace.tester.MainActivity$RunTestsRunnable.run(MainActivity.java:124)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:437)
... 13 more
===== fff =====
java.net.MalformedURLException: Protocol not found: fff
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:170)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
And then this with the URL you suggested:
===== https://github.com/cogroid/d-atomize-bin/raw/main/samples/Tests.js =====
javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x62a53638: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x5ef866fd:0x00000000)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
at com.android.okhttp.Connection.connect(Connection.java:107)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:355)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:306)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:513)
at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:136)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:172)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x62a53638: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x5ef866fd:0x00000000)
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)
... 17 more
And one more try:
===== file://storage/sdcard0/Download/jsb/fs/Tests.js =====
java.lang.ClassCastException: libcore.net.url.FtpURLConnection cannot be cast to java.net.HttpURLConnection
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.downloadFile(MainActivity.java:171)
at com.cogroid.atomspace.tester.MainActivity$DownloadRunTask.doInBackground(MainActivity.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
java.io.FileNotFoundException: /storage/emulated/0/guile/bin/guile-snarf: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:453)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
at com.cogroid.atomspace.tester.MainActivity$RunTestsRunnable.run(MainActivity.java:124)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:437)
... 13 more
java.io.FileNotFoundException: /storage/emulated/0/guile/bin/guile-snarf: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:453)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
at com.cogroid.atomspace.tester.MainActivity$RunTestsRunnable.run(MainActivity.java:124)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:437)
... 13 more
java.io.FileNotFoundException: /storage/emulated/0/guile/bin/guile-snarf: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:453)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:512)
at com.cogroid.atomspace.tester.MainActivity$RunTestsRunnable.run(MainActivity.java:124)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:437)
... 13 more
OK, so on my phone:
https://
or file:/
URL's. -- I don;'t understand why./storage/emulated/0/guile/bin/guile-snarf
-- I can explain this: my phone does not have a /storage/emulated
folder. So apparently, this is a hard-coded path, somewhere ... I can see that inside of guile.zip
you do have ./guile/bin/guile-snarf
and also ./guile/bin/guile
but I do not know how to run these ...
I have a terminal emulator installed on my phone, but the unzip
command is missing, so I cannot unpack. I am now trying to copy the unzipped files from my desktop to my phone, but its incredibly slow: 5kB/sec, will take 5 hours to copy 49 MB. So I will try running the guile shell by hand, later. I suspect it will not work, because the install paths will be all wrong ... it would be nice if I could do this.
Your new tombstone is interesting: the stack trace is:
backtrace:
#00 pc 0004ad30 /system/lib/libc.so (tgkill+12)
#01 pc 000484c3 /system/lib/libc.so (pthread_kill+34)
#02 pc 0001dd99 /system/lib/libc.so (raise+10)
#03 pc 0002b743 /data/app/com.cogroid.atomspace.tester-1/lib/arm/libgc.so (__aeabi_idiv0+6)
#04 pc 000a5e1f /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_weak_table_refq+98)
#05 pc 0004184f /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_i_define_class_for_vtable+74)
#06 pc 0009243f /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_set_struct_vtable_name_x+90)
#07 pc 0009874d /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (vm_regular_engine+1120)
#08 pc 000976af /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_call_n+270)
#09 pc 0004f9ad /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_primitive_load_path+464)
#10 pc 0004803b /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_i_init_guile+774)
#11 pc 0009358d /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_i_init_thread_for_guile+100)
#12 pc 00094e7b /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (with_guile+14)
#13 pc 00024f94 /data/app/com.cogroid.atomspace.tester-1/lib/arm/libgc.so (GC_call_with_stack_base+44)
#14 pc 000935db /data/app/com.cogroid.atomspace.tester-1/lib/arm/libguile-2.2.so (scm_with_guile+34)
#15 pc 001aa130 /data/app/com.cogroid.atomspace.tester-1/lib/arm/libdatomspace.so (_ZL15immortal_threadv+68)
#16 pc 001aa278 /data/app/com.cogroid.atomspace.tester-1/lib/arm/libdatomspace.so (_ZNSt6__ndk114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEPFvvEEEEEEPvSA_+40)
#17 pc 00047f93 /system/lib/libc.so (_ZL15__pthread_startPv+22)
#18 pc 0001a161 /system/lib/libc.so (__start_thread+6)
The scm_weak_table_ref
and scm_i_whatever
are ordinary C subroutines in guile. They look great, exactly as they should be.
This line looks suspicious or wrong:
#03 pc 0002b743 /data/app/com.cogroid.atomspace.tester-1/lib/arm/libgc.so (__aeabi_idiv0+6)
So eabi
says this is part of the ABI (for arm7, I guess) and idiv0
suggests that this is supposed to be arm7 emulation code for integer division (I'm guessing here...) and then it raises an exception 6 bytes in. This suggests that the exception is in trampoline code or shared lib glue code or something like that. This suggests that libgc.so
is incompletely linked, or has missing symbols or was compiled for the wrong architecture. One way to debug this is to disassemble __aeabi_idiv0
and look what is happening 6 bytes in. It's presumably telling the linker-loader to do something insane...
The good news is that guile itself looks OK. The bad news is that either libgc.so
is bad, or that maybe you didn't relink your version of guile to the new libgc
? And so the linker loader is using bad offsets or something like that?
Calling SchemeEval class does not crash but it run forever without any output although I have redirected stdout & stderr to files.
INFO: Readonly settings: {}
INFO: Writable settings: {}
INFO: ===== /AtomSpace.js =====
INFO: Readonly settings: {}
INFO: Writable settings: {}
INFO: isAtom: true
INFO: isNode: false
INFO: isLink: false
INFO: isType: true
INFO: getHash: 1
INFO: toString(indent): indent(AtomSpace "(uuid . 1)")
INFO: toShortString(indent): indent(AtomSpace "(uuid . 1)")
INFO: disposed: true
INFO: Result: null
INFO: ===== /ConceptNode.js =====
INFO: Readonly settings: {}
INFO: Writable settings: {}
INFO: isAtom: true
INFO: isNode: true
INFO: isLink: false
INFO: getName: dream
INFO: getArity: 1
INFO: toString: (ConceptNode "dream") ; [2281a00710ad9][2]
INFO: toShortString: (ConceptNode "dream")
INFO: equals(true, dream): true
INFO: equals(false, dream): false
INFO: equals(false, atomspace): false
INFO: disposed: true
INFO: Result: null
Running scheme2js: /data/user/0/com.cogroid.atomspace.tester/cache/37b2dbe5056349378922fe855d768f33.scm , /data/user/0/com.cogroid.atomspace.tester/cache/9f3a919fa1f14545b72452e92e891a8a.js
INFO: ===== /ConceptNode.scm.js =====
INFO: Readonly settings: {}
INFO: Writable settings: {}
INFO: (ConceptNode "dream") ; [2281a00710ad9][3]
INFO: Result: null
===== PseudoValue =====
isAtom: true
isNode: false
isLink: false
isType: true
disposed: true
===== AtomSpace =====
isAtom: true
isNode: false
isLink: false
isType: true
getHash: 5
toString(indent): indent(AtomSpace "(uuid . 5)")
toShortString(indent): indent(AtomSpace "(uuid . 5)")
disposed: true
===== Node =====
isAtom: true
isNode: true
isLink: false
getName: dream
getArity: 1
toString: (ConceptNode "dream") ; [2281a00710ad9][6]
toShortString: (ConceptNode "dream")
disposed: true
===== Concept Node =====
isAtom: true
isNode: true
isLink: false
getName: dream
getArity: 1
toString: (ConceptNode "dream") ; [2281a00710ad9][7]
toShortString: (ConceptNode "dream")
equals(true, dream): true
equals(false, dream): false
equals(false, atomspace): false
disposed: true
===== SchemeEval =====
duude enter init_scheme tid=1322 duude enter SchemeEval() ctor tid=1322 this=0xc14fe8fc as=0x0 duude enter init_only_once done=0 duude init_only_once gonna make immortal me=1322 duude init_only_once done make immortal me=1322 duude enter immortal tid=1323 redirect stdout & stderr to file ... done try to write to stdout ... done
In this datomspace-tester.apk, I have removed harded-code and fixed error with 'https' url.
does not crash but it run forever without any output
If you removed the *.go files from guile.zip
, then recompiling those might take hours even 12 or 24 hours, depending on the speed of your phone. There will be no output until those are rebuilt.
Starting the atomspace for the first time will cause the atomspace .scm files to be compiled into .go files. This might take 2 or 5 or 10 minutes, depending on your phone. It would be best if the apk included those go files (It would be best if the atomspace cmake did this automatically; I will look into it. #2945)
SchemeEvall.cc
Could you change
fh = fopen ("/storage/emulated/0/Download/datomspace-test.txt", "a+");
to
fh = fopen ("datomspace-test.txt", "a+");
(in two places). This will write a file into "the current directory", whatever that is. I think it will then be the right directory for both you and I. (This is not urgent, however. I can live without it, I think...)
SchemeEvall.cc
Could you change
fh = fopen ("/storage/emulated/0/Download/datomspace-test.txt", "a+");
to
fh = fopen ("datomspace-test.txt", "a+");
(in two places). This will write a file into "the current directory", whatever that is. I think it will then be the right directory for both you and I. (This is not urgent, however. I can live without it, I think...)
Can I change as following?
struct stat sb;
if (stat("/storage/emulated/0/Download", &sb) == 0 && S_ISDIR(sb.st_mode)) {
fh = fopen ("/storage/emulated/0/Download/datomspace-test.txt", "a+");
} else {
fh = fopen ("/storage/sdcard0/Download/datomspace-test.txt", "a+");
}
I installed this, and clicked on new "test SchemeEval" button, and nothing else. I get this:
$ cat datomspace-test.txt
java.util.zip.ZipException: Central Directory Entry signature not found; was 04034B50
at java.util.zip.ZipFile.throwZipException(ZipFile.java:427)
at java.util.zip.ZipEntry.<init>(ZipEntry.java:360)
at java.util.zip.ZipFile.readCentralDir(ZipFile.java:414)
at java.util.zip.ZipFile.<init>(ZipFile.java:151)
at java.util.zip.ZipFile.<init>(ZipFile.java:123)
at com.cogroid.atomspace.tester.MainActivity.unzipFile(MainActivity.java:767)
at com.cogroid.atomspace.tester.MainActivity$RunTestsRunnable.run(MainActivity.java:178)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
===== SchemeEval =====
java.lang.UnsatisfiedLinkError: Native method not found: com.cogroid.atomspace.SchemeEval.jni_init_scheme:()V
at com.cogroid.atomspace.SchemeEval.jni_init_scheme(Native Method)
at com.cogroid.atomspace.SchemeEval.initScheme(SchemeEval.java:46)
at com.cogroid.atomspace.Tester.testSchemeEval(Tester.java:263)
at com.cogroid.atomspace.tester.MainActivity$SchemeEvalRunnableBG.run(MainActivity.java:440)
at java.lang.Thread.run(Thread.java:841)
SchemeEval.initScheme() ... done.
java.lang.UnsatisfiedLinkError: Native method not found: com.cogroid.atomspace.AtomSpace.jni_init:()J
at com.cogroid.atomspace.AtomSpace.jni_init(Native Method)
at com.cogroid.atomspace.AtomSpace.<init>(AtomSpace.java:35)
at com.cogroid.atomspace.Tester.testSchemeEval(Tester.java:268)
at com.cogroid.atomspace.tester.MainActivity$SchemeEvalRunnableBG.run(MainActivity.java:440)
at java.lang.Thread.run(Thread.java:841)
Can I change as following?
Yes, that will work.
SchemeEval run smoothly on x64 and i386 but it crashes on armv7-a.
Steps to reproduce bug
Download datomspace-tester.apk
Install datomspace-tester.apk (Do not run!)
Go to Settings -> Apps -> dAtomSpace Tester. Set Storage permission.
Run dAtomSpace Tester
App runs about 30 seconds, then it crashes. There is tombstone file.
View results in datomspace-test.txt file in Download folder
Source codes
dAtomSpace Tester
dAtomSpace
SchemeEval.java
com_cogroid_atomspace_SchemeEval.h
com_cogroid_atomspace_SchemeEval.cc
Tester.java