tingsu / Stoat

Stoat (STochastic model App Tester) - an automatic testing tool for android apps
https://tingsu.github.io/files/fse17-stoat.pdf
143 stars 37 forks source link

Process stucked with message "Server started at Port 0 " #8

Closed mj170420 closed 5 years ago

mj170420 commented 5 years ago

Sir, I've seen your tool and it's amazing, but when I'm trying to run it but it's giving me an error for this command

"ruby run_stoat_testing.rb --app_dir /home/mayank-pc/harsh/app-debug.apk --real_device_serial 91cfed847d43 --stoat_port 2000 --project_type apk "

for a real device with an output.txt attached below. Please help us with that. Also, we have noticed the installation of uiautomator and test application in the Real Device. We will be very thankful to you.

Output.txt

tingsu commented 5 years ago

Can you change to another port, e.g., 2002, does that work?

b1ackm4x commented 5 years ago

I have same problem , it stuck at [SocketServer] I: the server is started ...waiting at port 2002

tingsu commented 5 years ago

Has the client side normally start? Can you give me the whole log file so that I can inspect it. Thanks.

b1ackm4x commented 5 years ago

I reset some env and it's ok now, it works well. thanks for your reply

willianferrari commented 5 years ago

What were the changes to solve your problem?

808/trabalho/ferramenta/android-sdk-linux/platforms/android-19/android.jar [ConfigOptions] I: DO_STATIC_ANALYSIS = false [ConfigOptions] I: MAX_MCMC_ITERATION = 1000 [ConfigOptions] I: MAX_TEST_SUITE_SIZE = 30 [ConfigOptions] I: MAX_TEST_SEQUENCE_LENGTH = 20 [ConfigOptions] I: MAX_TEST_SUITE_SIZE_COMPARE_MODEL = 400 [ConfigOptions] I: PROB_MODEL_MODE = 1 [ConfigOptions] I: PROB_MODEL_FILE_NAME = optimal_markov_model.txt [ConfigOptions] I: PORT = 2002 I: start android app static analysis to detect actions.... I: finish static analysis, there are total [0] statically inferred actions. port = 2002 [SocketServer] I: the server is started ...waiting at port 2002 Get app states exception! java.net.BindException: Endereço já em uso (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.(ServerSocket.java:237) at java.net.ServerSocket.(ServerSocket.java:128) at SocketServer.a(Unknown Source) at SocketServer.main(Unknown Source)

tingsu commented 5 years ago

@b1ackm4x Sounds good! Could you tell me what did you change? I would like to update more details in the project page so that I could prevent such issues from annoying other users (like @willianferrari ).

tingsu commented 5 years ago

@willianferrari do you still have this issue? just let me know, and i will inspect.

willianferrari commented 5 years ago

It was some conflict from 64 bit to 32 bit OS. I solved installing sudo apt-get install lib32z1

Now I have another problem with MCMC

$ grep de.freewarepoint.whohasmystuff /home/willian/Documentos/Stoat/benchmark/whohasmystuff/stoat_mcmc_sampling_output/crashes/2/emulator-5554_logcat.txt [emulator-5554] I: the test sequence is completed. D: kill the previous logcat process $ for pid in $(ps aux | grep "[-]s emulator-5554 logcat" | awk '{print $2}'); do kill -9 $pid; done $ rm -rf /home/willian/Documentos/Stoat/benchmark/whohasmystuff/stoat_mcmc_sampling_output/crashes/2 [emulator-5554]$ timeout 2s adb -s emulator-5554 shell am broadcast -a edu.gatech.m3.emma.COLLECT_COVERAGE error: device not found error: device not found adb -s emulator-5554 pull /mnt/sdcard/coverage.ec /home/willian/Documentos/Stoat/benchmark/whohasmystuff/stoat_mcmc_sampling_output/MCMC_coverage/coverage_emulator-5554_TEST_2_MCMC_1.ec shell$ adb -s emulator-5554 pull /mnt/sdcard/coverage.ec /home/willian/Documentos/Stoat/benchmark/whohasmystuff/stoat_mcmc_sampling_output/MCMC_coverage/coverage_emulator-5554_TEST_2_MCMC_1.ec error: device not found error: device not found adb -s emulator-5554 shell r

log-20.txt

tingsu commented 5 years ago

I took a careful look at the provided log, I saw the message "error: device not found". It indicates the device is offline. When such errors appear, can you open another terminal, and type "adb devices" to see whether the device is indeed properly online? According to my experience, sometimes, emulators can be not that stable.

Another issue I found from the log is that, I saw Stoat repeatly restarts the app and UI-Automator sometimes also fails. Can I know what the app you are testing?

willianferrari commented 5 years ago

Yes, but it's online, open.

When it arrives at specific point of the MCMC, it starts with the message "error: device not found"

I'm testing four app alogcat, arxiv-mobile, tippytiper, and whohasmystuff.

send my bashrc and Config.txt bashrc.txt CONF.txt

tingsu commented 5 years ago

I read the two files, and compared with mine.

Two differences:

Let me know if you still have the issue. I am a bit busy with another project, and I cannot reply very quickly. But I will try my best.

willianferrari commented 5 years ago

I was able to solve the problems, The problem was in the emulator, I was creating the emulator using the SDK - 19, when I created the emulator used the SDK - 28, problem was solved. So I am using the SDK - 28 for the emulator, but with android 19 for running the stoat, as can be seen in bashrc_2.txt and conf.txt

bashrc_2.txt CONF.txt

tingsu commented 5 years ago

Good to hear your problem was solved, and thanks for the explanation. I personally use Android-19 in most of our previous evaluation, and also tried on Android-23 above. Stoat should work. let me know if there are still issues or any problems/feedback you encounter during use. Then I will close this issue.