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

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

[Octave-bug-tracker] [bug #63388] Octave may crash with uitable containi


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #63388] Octave may crash with uitable containing true/false data
Date: Mon, 21 Nov 2022 06:59:02 -0500 (EST)

Follow-up Comment #11, bug #63388 (project octave):

Trying to isolate the bug, I found that the cause of the crash is not passing
the boolean by itself, but a combination of that with other things.

This test for me does *not* cause the crash. If you run it, you will see a
checkbox blinking on and off as the code specifies.

function []=mytest3(varargin); 

  opt_id=figure('name', 'Crash uitable', 'position', [300   200   600   800] ,
'tag', 'main_figure' );

  init_parameters=cellfun(@num2str,num2cell(rand(2,2)), 'UniformOutput',
false);

  h.table= uitable (opt_id, 'unit', 'normalized',   'Position', [ 0.15 0.15
0.70 0.70 ], ...
  'Data', init_parameters, 'ColumnName', {'Parameters', 'Values'}, 'units',
'normalized', ...
  'ColumnWidth', {200 200}, 'ColumnEditable',true, 'tag', 'uitable_crash' );

  for ii=1:20
    parameters=opt_pso_parameters1;
    parameters=struct2cell(parameters)
    set(findobj(0, 'tag', 'uitable_crash'), 'data', [parameters(1,:)'
parameters(2,:)']);
    [parameters(1,:)' parameters(2,:)'];
    pause(0.25)
    
    parameters=opt_pso_parameters2;
    parameters=struct2cell(parameters)
    set(findobj(0, 'tag', 'uitable_crash'), 'data', [parameters(1,:)'
parameters(2,:)']);
    [parameters(1,:)' parameters(2,:)'];
    pause(0.25)
  end 
endfunction

function parameters=opt_pso_parameters1(varargin); 
  ii=0; 
  ii=ii+1;parameters(ii).name='method';          
parameters(ii).value='global_opt';
  ii=ii+1;parameters(ii).name='guessWeight';      parameters(ii).value= 0.5;
  ii=ii+1;parameters(ii).name='flagVectorize' ;   parameters(ii).value=
false;
  ii=ii+1;parameters(ii).name='plotFun' ;         parameters(ii).value= '';
endfunction

function parameters=opt_pso_parameters2(varargin); 
  ii=0; 
  ii=ii+1;parameters(ii).name='method';          
parameters(ii).value='global_opt';
  ii=ii+1;parameters(ii).name='guessWeight';      parameters(ii).value= 0.5;
  ii=ii+1;parameters(ii).name='flagVectorize' ;   parameters(ii).value= true;
  ii=ii+1;parameters(ii).name='plotFun' ;         parameters(ii).value= '';
endfunction


Also if none of the parameter values have boolean, that works OK too (comment
out the calls to PSO in the original test and call only the other
subfunctions).

Changing size of parameters (only 3 in some, 4 in others) is also not a
factor. I could add dummy fourth parameters to the smaller sets and the crash
happened if booleans were mixed, and didn't happen if booleans weren't mixed.

Somehow having some of the parameters have booleans and the others not have
booleans causes a crash.

I'm not sure yet if the bug is inside Qt or if we are somehow passing bad data
to Qt. Next I'm adding cout statements to the set function in graphics.cc
(near line 13000) to trace what happens.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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