octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56828] urlread/urlwrite/webread functions are


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #56828] urlread/urlwrite/webread functions are not interruptible with Ctrl+C
Date: Sun, 1 Sep 2019 12:55:10 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36

Follow-up Comment #2, bug #56828 (project octave):

Confirmed too.  As you observed in comment #1, this problem seems to be
related to the actual change of the macro
"BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE" to do effectively nothing at the
moment.

https://hg.savannah.gnu.org/hgweb/octave/file/60bb69799591/liboctave/util/quit.h#l196
https://hg.savannah.gnu.org/hgweb/octave/file/60bb69799591/liboctave/util/url-transfer.cc#l376

I grepped for all occurrences of this macro, and it is indeed only used for
urltransfer and some parse factorization functions.  Thus the damage is
limited, but also visible for the sparse functions, which are also not
stoppable, when inside the foreign code.


$ ./octave-4.2.2 --no-gui
GNU Octave, version 4.2.2
[...]
octave:1> [Q, R] = qr (sprand (10000, 10000, 1/10));
^C^CPress Control-C again to abort.

octave:1> exit

$ ./octave-4.4.1 
GNU Octave, version 4.4.1
[...]
octave:1> [Q, R] = qr (sprand (10000, 10000, 1/10));
^C^C^C
^C
octave:1>


Each ^C represents an attempt to stop the function.  On the other hand, the
following simplified C program can be stopped at any time by ctrl+c.


#include <curl/curl.h>

int main () {
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode res;
    curl_easy_setopt(curl, CURLOPT_URL,
     
"http://slowwly.robertomurray.co.uk/delay/10000/url/http://www.gnu.org/";);
    res = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
  return 0;
}


Thus as you observed, Octave must be able to permit the external library to
detect ctrl+c again.  I need to get familiar with how Octave handles it
signals in this situation.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56828>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]