ooni / probe

OONI Probe network measurement tool for detecting internet censorship
https://ooni.org/install
BSD 3-Clause "New" or "Revised" License
751 stars 142 forks source link

ios: upload all button does not seem to work #2512

Closed bassosimone closed 1 month ago

bassosimone commented 11 months ago

Describe the bug

I clicked the upload-all button for measurements that were not uploaded but nothing happened for minutes.

To Reproduce

Disable automatic measurements upload. Run IM. Try to upload the not-uploaded masurements.

Expected behavior

We should upload measurements that were not uploaded.

Screenshots

IMG_8853E2DEB9F3-1

System information (please complete the following information):

Additional context

There are the logs observed using the Xcode debugger:

2023-07-25 13:53:02.108435+0200 ooniprobe[17728:2812453] engine: info: ooniprobe-engine/v3.18.1  dirty= go1.20.6
2023-07-25 13:53:02.451520+0200 ooniprobe[17728:2812556] engine: info: sessionresolver: lookup api.ooni.io using http3://dns.google/dns-query... ok
2023-07-25 13:53:03.311786+0200 ooniprobe[17728:2812453] engine: info: session: using probe services: {Address:https://api.ooni.io Type:https Front:}
2023-07-25 13:53:03.312208+0200 ooniprobe[17728:2812453] engine: info: iplookup: using cloudflare
2023-07-25 13:53:03.481223+0200 ooniprobe[17728:2812067] engine: info: sessionresolver: lookup www.cloudflare.com using https://dns.google/dns-query... ok
2023-07-25 13:53:03.961726+0200 ooniprobe[17728:2812453] engine: info: New reportID: 20230725T115303Z_whatsapp_IT_30722_n1_qVZwDo15vSI3KEOo
2023-07-25 13:53:04.173166+0200 ooniprobe[17728:2812453] File 187-whatsapp.json deleted
2023-07-25 13:53:04.261320+0200 ooniprobe[17728:2812453] engine: info: New reportID: 20230725T115304Z_telegram_IT_30722_n1_ZPsxoAyWH2bgDcKo
2023-07-25 13:53:04.519840+0200 ooniprobe[17728:2812453] File 188-telegram.json deleted
2023-07-25 13:53:04.619627+0200 ooniprobe[17728:2812453] engine: info: New reportID: 20230725T115304Z_facebookmessenger_IT_30722_n1_QwQAcKaQmtNTZXiz
2023-07-25 13:53:04.723001+0200 ooniprobe[17728:2812453] File 189-facebook_messenger.json deleted
2023-07-25 13:53:04.815754+0200 ooniprobe[17728:2812453] engine: info: New reportID: 20230725T115304Z_signal_IT_30722_n1_hTYeLH4O9botM3m7
2023-07-25 13:53:04.943422+0200 ooniprobe[17728:2812453] File 190-signal.json deleted
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIViewController navigationController]
PID: 17728, TID: 2812453, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   ooniprobe                           0x00000001005b9b5c __49-[UploadFooterViewController uploadMeasurements:]_block_invoke.24 + 1488
5   libdispatch.dylib                   0x00000001043b4520 _dispatch_call_block_and_release + 32
6   libdispatch.dylib                   0x00000001043b6038 _dispatch_client_callout + 20
7   libdispatch.dylib                   0x00000001043ca670 _dispatch_root_queue_drain + 972
8   libdispatch.dylib                   0x00000001043cae34 _dispatch_worker_thread2 + 196
9   libsystem_pthread.dylib             0x000000020d0a0da0 _pthread_wqthread + 228
10  libsystem_pthread.dylib             0x000000020d0a0b7c start_wqthread + 8
2023-07-25 13:53:04.944652+0200 ooniprobe[17728:2812453] [reports] Main Thread Checker: UI API called on a background thread: -[UIViewController navigationController]
PID: 17728, TID: 2812453, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   ooniprobe                           0x00000001005b9b5c __49-[UploadFooterViewController uploadMeasurements:]_block_invoke.24 + 1488
5   libdispatch.dylib                   0x00000001043b4520 _dispatch_call_block_and_release + 32
6   libdispatch.dylib                   0x00000001043b6038 _dispatch_client_callout + 20
7   libdispatch.dylib                   0x00000001043ca670 _dispatch_root_queue_drain + 972
8   libdispatch.dylib                   0x00000001043cae34 _dispatch_worker_thread2 + 196
9   libsystem_pthread.dylib             0x000000020d0a0da0 _pthread_wqthread + 228
10  libsystem_pthread.dylib             0x000000020d0a0b7c start_wqthread + 8
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIViewController view]
PID: 17728, TID: 2812453, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   ooniprobe                           0x00000001005b9b70 __49-[UploadFooterViewController uploadMeasurements:]_block_invoke.24 + 1508
5   libdispatch.dylib                   0x00000001043b4520 _dispatch_call_block_and_release + 32
6   libdispatch.dylib                   0x00000001043b6038 _dispatch_client_callout + 20
7   libdispatch.dylib                   0x00000001043ca670 _dispatch_root_queue_drain + 972
8   libdispatch.dylib                   0x00000001043cae34 _dispatch_worker_thread2 + 196
9   libsystem_pthread.dylib             0x000000020d0a0da0 _pthread_wqthread + 228
10  libsystem_pthread.dylib             0x000000020d0a0b7c start_wqthread + 8
2023-07-25 13:53:10.294480+0200 ooniprobe[17728:2812453] [reports] Main Thread Checker: UI API called on a background thread: -[UIViewController view]
PID: 17728, TID: 2812453, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   ooniprobe                           0x00000001005b9b70 __49-[UploadFooterViewController uploadMeasurements:]_block_invoke.24 + 1508
5   libdispatch.dylib                   0x00000001043b4520 _dispatch_call_block_and_release + 32
6   libdispatch.dylib                   0x00000001043b6038 _dispatch_client_callout + 20
7   libdispatch.dylib                   0x00000001043ca670 _dispatch_root_queue_drain + 972
8   libdispatch.dylib                   0x00000001043cae34 _dispatch_worker_thread2 + 196
9   libsystem_pthread.dylib             0x000000020d0a0da0 _pthread_wqthread + 228
10  libsystem_pthread.dylib             0x000000020d0a0b7c start_wqthread + 8

Additionally, after I tried to "upload all", the whole UI for the results was frozen in that screen and I needed to kill the app to be able again to see results.

sloncocs commented 11 months ago

2487

bassosimone commented 11 months ago

@sloncocs thank you!

aanorbel commented 11 months ago

@bassosimone , i think your use case is quite different from that reported in https://github.com/ooni/probe/issues/2487. Looking at the screenshot alone tells me you opened the Performance Test results while Instant Messaging Test was running. In such situations, the page functionality breaks down. Share variables across the various views.

https://github.com/ooni/probe/issues/2487 reported by @sloncocs is more related to https://github.com/ooni/probe/issues/2511 where the upload button is partially or fully covered. This I have investigated in details.

bassosimone commented 11 months ago

@bassosimone , i think your use case is quite different from that reported in #2487. Looking at the screenshot alone tells me you opened the Performance Test results while Instant Messaging Test was running.

Where do you see this in the screenshot? In any case, no, I did not run any other test in the meanwhile.

I think what happens is that there is some race condition because the UI code is called from the background thread, as explained in the logs. If you read the logs, the results are actually submitted, but the UI never updates.

It's reasonable for this to happen when we're updating the UI from a background thread.

It also seems that the race condition is more likely when using the Xcode debugger.

In such situations, the page functionality breaks down. Share variables across the various views.

This seems rather bad. Can you elaborate on which variables are shared and why?

2487 reported by @sloncocs is more related to #2511 where the upload button is partially or fully covered. This I have investigated in details.

Yeah, those are two different issues. One seems a UI layout issue while the other seems a UI updating issue.

hellais commented 7 months ago

Has this been fixed?

aanorbel commented 1 month ago

this issue has been fixed.