-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android binary #2
Comments
i flashed, and i get the pie error encountered this before but im not a coder if i remember xidel is written in pascal/lazarus edit: 2nd edit: |
Better add comments instead edits, so github sends notifications Do you have valgrind installed? Xidel compiled with -gv, then valgrind --tool=callgrind xidel ... is a great way to detect slow parts. (kcachegrind to view the output) |
i dont have valgrind, only gcc cause that comes with linux :) didnt compile anything myself, just tested the binaries you posted will probably try next week, but if you post more binaries i can test right on the phone, dont need computer for that so valgrind let me test the binary for arm on x86 and tells me whats wrong ? thank you |
so they work after all?
I will make new ones this weekend But it will probably be called Xidel 0.9.5
Valgrind runs a program and marks the parts that are slow It actually is an emulator itself. |
it works on android 4.4 doesnt work on 5.1 |
New builds will be here: https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%20development/ |
flashed again |
Then the -Cg flag was not enough and -k-pie was needed as well |
http://imgur.com/7pK5vGN |
on android 4.4 terminal closes, probably not related, |
Are the numbers after out of memory always the same? I have uploaded a new version. No changes, but it has debug symbols, so the error might be more informative. You can start it with
How could it close the terminal, even if it crashs? On the emulator I get ./xidel: 1: Syntax error: word unexpected (expecting ")"), Android is a mess
I am not using any part of Lazarus anymore |
http://imgur.com/r4SMRkW gdb xidel doesent work i dont know, on 4.4 it just crashes the terminal what are you using instead of lazarus? android is indeed a mess, couldnt agree more, i just want and x86 phone with linux and classic bios/bootloader, like on desktop will try this new version |
the new version throws error with numbers every time |
Do you have gdb installed? It is useful.
It says it actually runs out of memory After demanding 1.3 gigabyte While reading a /usr/share/zoneinfo/localtime or /usr/lib/zoneinfo/localtime file. Do you have those? What is their content?
FreePascal alone
Like an Ubuntu phone |
Actually the log says, you do not have them and it crashed somewhere else after it failed loading them |
It adds a random number every time, so it is harder to hack strace should show that random offset. Call |
dont have gdb,is this it? i dont have either of those files i assume you meant to post xidel output first time after restart, if thats the case, this is it, 740kb, too big for pastebin didnt realised, lazarus is just an ide dont have experience with ubuntu phone, is it more like linux ? read about an ubuntu, more like android |
Yes
Yes, but no restart was needed. Now we see in line 192, after 1.3 GB, it wants 3.9 GB which triggers the out of memory Stil some things are truncated (like xid in line 2448), perhaps it helps to get more data with
I do not know it But I would think it is like Ubuntu, when it is called Ubuntu Phone |
Just the |
strace -i -e read=3 xidel logcat |
any news? |
That is now missing the "unhandled exception... " output
I was thinking about uploading a simple program that just prints a single line, compiled with different flags, to see if one of the works. Unfortunately I do not really have any working Android devices, except an old phone I bought used for online banking on which I cannot run anything (especially not the online banking app).
I have an API http://www.videlibri.de/cgi-bin/xidelcgi?raw=true&xpath=1%20to%20100 |
anything you post i will test what android phone do you have? and what else are you using, just curious i wouldnt reccommend using android for banking app, i heard some token keys got stolen i didnt have the time to really try your api, i usually do "xidel filename* -e ... " on a bunch of files i was thinking more like a dedicated xidel pc, online 24/7 im not sure about security :) also thinking about a technique for perl regex html, not very powerful, and a lot of work |
about c/c++ wich would probably be easier to port to android apart from a complete rewrite, wich i assume is pretty close to imposible, and not happening and auto conversion to c-code, http://ivan.vecerina.com/code/delphi2cpp/ it might be stupid, but how about using a xidel library called from a c/c++ front-end cli i admit i dont know very much about programming, dll/so libraries, native code function calls :) just a thought i realise now the problem is freepascal its difficult to get working on its own not counting external libraries |
Same compiling flags as before, but just a hello world: The only thing clear right now is that it is crashing during the initialization. Every Pascal unit initializes itself, before the actual program runs, and that crashes. Xidel has units from me and units from FPC
An HTC Wildfire rooted with Cyanogenmod. Otherwise I use a good old laptop. You have to carry one or two kg, but it can do all the things
That might help. GDB would help, too.
Banking site + banking app They it is double secure, as both devices need to be hacked.
Not necessarily. Freepascal has the advantage that is mostly self contained It just is not tested enough
It would be hard to even port it from FreePascal to Delphi
I am actually using a part of Xidel as a library to be called from a Java apk and that works.
|
The output of
might be interesting, if you have readelf installed |
flashed helloworld on 5.1 please link readelf and gdb or whatever you need output for, on android |
These relocation probably do not matter The important thing is, does it print Hello World? Or some exception error?
It should be in the Android-NDK: https://developer.android.com/ndk/downloads/index.html This might have newer versions: https://termux.com/ With full gdb you call it on the smartphone:
Or you can get the smaller gdbserver, and then run the full gdb on the computer and connect to gdbserver:
|
yes it does print helloworld |
So the compiler works fine. Then the problem has to be in one of the libraries. I made a hello world for each library used in Xidel: Which one works, which one crashes? (each prints some different random nonsense, so you can keep them apart) If you are curious, this is the order the libraries loaded by Xidel:
We know it gets to UNIX$$init as strace mention the time zones, and it crashed before it got to NETDB$$init, because otherwise strace would have shown access of the hosts file.
Yeah, that should directly show the bug
If it printed hello world that is not needed. Readelf would have told us, if the linker is arm5 or arm7. I was making arm5 builds because they should work everywhere, but with these things you can never be certain |
sorry for the delay, been busy |
I just was told fpc 3.0 cannot generate working programs for Android 5+ (http://wiki.freepascal.org/Android#Known_issues) I have uploaded a new [Xidel build with fpc 3.1.1](https://sourceforge.net/projects/videlibri/files/Xidel/Xidel development/) (r34554) |
hello and it works, on android 5.1.1, dont have anything else to test on a bit slow compare to linux 386 version linux x86 ( time xidel -h ) android 5.1.1 ( time xidel -h ) linux x86 ( time xidel f -e "//*[@id='products-holder']/div/form/div[2]/h2/a/@href" ) android 5.1.1 ( time xidel f -e "//*[@id='products-holder']/div/form/div[2]/h2/a/@href" ) what could be the cause for this? execution time when given work compared to simple showing help on android there is termux thank you for your work |
I just made a version for 0.9.6: https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%200.9.6/xidel-0.9.6.androidarm.tar.gz/download
Perhaps timing strace helps to find something slow:
Maybe you can ask them directly? My last three attempts to get something in some repository have failed. Maintainers are busy, or want to compile it and have no Pascal compiler... |
just flashed and tested |
i managed to select the text from terminal emulator also it doesent work in termux, but i think this is their fault i tried to contact termux on irc, no answer also i think theres still a god thing you provide binaries u0_a59@kccat6xx:/sdcard/download/code $ xidel --version http://www.videlibri.de/xidel.html An unhandled exception occurred at $B6E5D028: 217|u0_a59@kccat6xx:/sdcard/download/code $ |
time strace -tt -T xidel > out4.txt 2>&1 |
That is my modified memory management. Weird, it is not supposed to do anything on --version. What do you get on Do you have gdb to get a longer backtrace?
I always thought xidel is just like TempleOs
ui, it is loading /etc/hosts How many lines does that have? On linux I have 10 lines. Why do you have so many? |
/etc/hosts protection for ads/malware, also use it on linux, not the same file though its moab hosts from xda, this seems to be 170,000 lines, ~4.7mb in what way is xidel like templeos, isnt that the religious guy? where to get gdb from also installed gdb from termux, but "gdb xidel" doesent work, shows gdb help any ideea? |
That is fpc's net initialization code. I cannot change it. I could write a bug report: http://bugs.freepascal.org/view.php?id=31129 Although it might also be possible to create a version that does not use fpc for internet access, but Apache HttpComponents from Android.
Because I have spent so much time adding unnecessary, overcomplicated stuff to it...
Did you try what I described above: #2 (comment) |
i dont really use the download part on xidel, probably used it 2-3 times, compared to probably tens of uses for extraction, for thousands of pages, dont know how other people use it i use aria2c for mass downloading, it supports gzipped downloading with auto decompression for list of file, then i just xidel p* -e "..." i mean its nice to have it, but i think the most important part of xidel is the xpath/css extraction i also tend to overcomplicate stuff :) but i run away for everything that has java in it, and android native so can you make a version with just the internet part commented out? |
There are standard XPath function that depend on downloading, e.g. fn:doc
Perhaps later I am more concerned about the crash in 0.9.6. I could reproduce it in the emulator (although gdb kept crashing...) and it seems to be another freepascal bug (http://bugs.freepascal.org/view.php?id=31135)... |
its pretty awkward if you ask me for xpath to depend on downloading since xpath is made for working with xml wich is not neccessarely html and can be generated locally by other apps but every language/compiler must have its share of bad decisions :) |
i have tested xidel without hosts file and it seems to be fine |
also tested on termux on android 6.0 not rooted |
any chance to build an arm-linux binary? |
Yes, I uploaded one |
thank you |
why is the android binary size so big (3x)? |
It is probably a debug build for gdb. Then you can make it small with strip --strip-all xidel |
hello there
can you please provide an android binary? nothing special just plain arm self contained binary
i may have sent you a message before, im not sure
i have busybox, aria2 and perl all i need is xidel :)
thank you for your work. it really does wonders
cheers
The text was updated successfully, but these errors were encountered: