ofLoadURLAsync on ARMv7 - Segmentation fault

I’m running a near-empty project based on the ofLoadURLAsync example of the documentation on oF 0.8.3 (also tried 0.8.2) on Debian / ARMv7.
The moment ofLoadURLAsync() is ran, a series of these ofThread verbose messages are shown, before the app ends with a Segmentation fault (139)

[verbose] ofThread: - name: Thread 1 - External thread waiting for ofThread mutex to be unlocked
[verbose] ofThread: - name: Thread 1 - External thread locked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - External thread unlocked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - External thread waiting for ofThread mutex to be unlocked
[verbose] ofThread: - name: Thread 1 - External thread locked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - External thread unlocked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - Started Thread.
[verbose] ofThread: - ofURLFileLoader: threadedFunction(): starting thread
[verbose] ofThread: - name: Thread 1 - ofThread waiting for its own mutex to be unlocked. 
[verbose] ofThread: - name: Thread 1 - ofThread locked its own mutex.
[verbose] ofThread: - ofURLFileLoader: threadedFunction(): querying request myRequest
[verbose] ofThread: - name: Thread 1 - ofThread unlocked its own mutex.
[verbose] ofThread: - name: Thread 1 - External thread waiting for ofThread mutex to be unlocked
[verbose] ofThread: - name: Thread 1 - External thread locked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - External thread unlocked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - External thread waiting for ofThread mutex to be unlocked
[verbose] ofThread: - name: Thread 1 - External thread locked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - External thread unlocked the ofThread mutex.
Segmentation fault

Any suggestions how to tackle this one? The same code runs fine on mac.
Thanks!

This could likely be related to issue #2823 which requires a newer version of Poco to resolve - @bakercp’s in-progress PR to update Poco can be found at #3116.

This solves it. Thanks!

Just to confirm @tofoo did you solve it by pulling in the changes from PR #3116? It would be good to have another data point that confirms the Armv7 poco binaries I built are working. Also, what hardware platform are you running on? I compiled those on an UDOO Quad.

Platform is A20-OLinuXino-MICRO on Debian. I ran

./apothecary update poco

and this stopped the Segmentation fault from occurring. So great.
One minor note (not sure this is normal or not) but the Thread keeps running, even after data is successfully returned from the server. This populates verbose so fast it becomes hard to use for debugging.

1 Like

I just noticed that when there is no internet connection, ofURLFileLoader completely clogs the processor and disk usage to 100% use. Any ideas @bakercp or others? We have 10 interactive interventions running at people’s houses, and their internet connection is sometimes a bit flakey. Since they report having to restart the intervention after an internet hiccup, I guess that when the armv7 keeps running for several hours at max processor, this causes crashes - not sure if it’s oF, or some Debian/hardware fault on the Olimex A20.

mmh, yeah that sounds like a bug in OF, the url loader keeps trying until the queue is empty, when there’s no internet connection the queue will never empty and so it tries forever using the cpu at 100%, i’ll do something to at least throttle the thread when some connection fails several times

Thanks @arturo
For now I’ll use something like this

void ofApp::urlResponse(ofHttpResponse & response){
        if(response.status == -1) {
            ofRemoveAllURLRequests();
        }
}

strangely, the following has some unexpected behaviour:

void ofApp::urlResponse(ofHttpResponse & response){
        if(response.status == -1) {
            cout << "attempting to remove request: " << response.request.getID() << endl;
            ofRemoveURLRequest(response.request.getID());
        }
}

it outputs (when an URL is loaded without internet connection):

attempting to remove request: 1
[ error ] ofURLFileLoader: remove(): request 1 not found

I was experiencing segmentation faults in Raspberry Pi 2 while performing ofLoadURL calls. Updating Poco as instructed in the thread above resolved the issue.

Thanks!