octave-maintainers
[Top][All Lists]
Advanced

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

Re: Thread-safety issues in QtHandles


From: John W. Eaton
Subject: Re: Thread-safety issues in QtHandles
Date: Wed, 2 Nov 2011 19:42:43 -0400

On  2-Nov-2011, Michael Goffioul wrote:

| I've completed a first run of changes. The draft patch is in
| attachment (please note: "draft" as in not finalized). It's quite big,
| but it's actually a bunch of repetitive changes. However, when I run
| the test suite, I get a crash at the end in the cleanup_and_exit
| function. I narrowed down the problem to: run tests in
| scripts/sparse/bicg.m, then call "clear -f".
| 
| I'm pretty sure this is due to the way octave_base_value* (or derived
| classes) are stored in the symbol table and/or the parse tree. My
| impression is that more than one octave_value objects are built using
| the same internal octave_base_value* pointer. This results in multiple
| shared_ptr objects pointing to the same memory location, hence
| multiple delete calls. However, that part of the code is quite complex
| (and new to me) and I couldn't pinpoint the cause of the problem. It
| only happens when using the test function; if I copy the test code
| from bicg.m into a script and run it, it works fine.
| 
| Any hint would be appreciated.

That's not a new problem, it's just showing up here for the first
time.  So it is probably not the fault of your changes.

See for example

  https://savannah.gnu.org/bugs/?33981

The right way to define a function in a test is to use a %!function
block, not to embed a function definition in the test.  Just change
the lines in bicg.m to be

%!function y = afun (x, t, a)
%!  switch t
%!   case "notransp"
%!     y = a * x;
%!   case "transp"
%!     y = a' * x;
%!  endswitch
%!endfunction

Does that also avoid the problem for you?

Also, do these changes help with the problems you were seeing earlier
with the Qt code?

jwe


reply via email to

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