Issue with hggroup and zlim

John W. Eaton jwe at bevo.che.wisc.edu
Thu Aug 28 13:58:04 CDT 2008


On 28-Aug-2008, dbateman wrote:

| John W. Eaton wrote:
| > 
| > Looking at __add_datasource__.m, I see
| > 
| >   i = 1;
| >   newargs = {};
| >   while (i < numel (varargin))
| >     arg = varargin{i++};
| >     if (ischar (arg) && length (arg > 1) && strcmpi (arg(2:end),
| > "datasource"))
| >       arg = tolower (arg);
| >       val = varargin{i++};
| >       if (ischar (val)) 
| > 	set (h, arg, val);
| >       else
| > 	error ("%s: expecting data source to be a string", fcn);
| >       endif
| >     else
| >       newargs{end + 1} = arg;
| >     endif
| >   endwhile
| > 
| > Should the test in this loop be <= instead of < ?  If so, then newargs
| > will contain the parent argument and the calls to __line__ in plot3
| > will need to be modified.  For example, I would propose this change:
| > 
| 
| No as property/value occur in pairs.

I'm confused.  Does __add_datasource__ require that varargin is a list
of property value pairs?  If yes, then why not write the loop as

  for i = 1:2:numel (varargin)
    key = varargin{i};
    val = varargin{i+1}
    if (length (key > 1) && strcmpi (key(2:end), "datasource"))
      if (ischar (val)) 
        set (h, key, val);
      else
        error ("%s: expecting data source to be a string", fcn);
      endif
    else
      newargs(end+1:end+2) = {key, val};
    endif
  endwhile
    
?

| However varargin{i++} should read
| varargin{++i} or i should be initialized to 0.

I don't see how that can be "or".  Do you mean "and", and that i++
should be switched to ++i in both cases?

| As for the change in plot3.m
| this is incorrect as the explicit reparenting to the hggroup is needed. Your
| second reparenting will just override that.

OK.

What about the call to __add_line_series__?  Should the first argument
be hline instead of h?

If I make the attached changes, I see this:

  octave:1> z = [0:0.05:5]; hold on; hg = hggroup();
  octave:2> h =  plot3 (z, exp(2i*pi*z),'parent',hg);
  octave:3> h =  plot3 (z, exp(2i*pi*z),'parent',hg);
  Segmentation fault

so the first call works, but the second fails.  It appears to be an
infinite recursion:

  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 0x7ff7097956f0 (LWP 6479)]
  0x00007ff7089ef780 in std::_Rb_tree<graphics_handle, std::pair<graphics_handle const, graphics_object>, std::_Select1st<std::pair<graphics_handle const, graphics_object> >, std::less<graphics_handle>, std::allocator<std::pair<graphics_handle const, graphics_object> > >::_M_lower_bound (this=Cannot access memory at address 0x7fff1115fff8
  )
      at /usr/include/c++/4.3/bits/stl_tree.h:954
  954			   const _Key& __k)
  Current language:  auto; currently c++
  (gdb) where
  #0  0x00007ff7089ef780 in std::_Rb_tree<graphics_handle, std::pair<graphics_handle const, graphics_object>, std::_Select1st<std::pair<graphics_handle const, graphics_object> >, std::less<graphics_handle>, std::allocator<std::pair<graphics_handle const, graphics_object> > >::_M_lower_bound (this=Cannot access memory at address 0x7fff1115fff8
  )
      at /usr/include/c++/4.3/bits/stl_tree.h:954
  #1  0x00007ff7089ef829 in std::_Rb_tree<graphics_handle, std::pair<graphics_handle const, graphics_object>, std::_Select1st<std::pair<graphics_handle const, graphics_object> >, std::less<graphics_handle>, std::allocator<std::pair<graphics_handle const, graphics_object> > >::find (this=0x11361a0, __k=@0x7fff11160150)
      at /usr/include/c++/4.3/bits/stl_tree.h:1392
  #2  0x00007ff7089ef8a7 in std::map<graphics_handle, graphics_object, std::less<graphics_handle>, std::allocator<std::pair<graphics_handle const, graphics_object> > >::find (this=0x11361a0, __x=@0x7fff11160150)
      at /usr/include/c++/4.3/bits/stl_map.h:615
  #3  0x00007ff7089f0474 in gh_manager::do_get_object (this=0x11361a0, 
      h=@0x7fff11160150) at ./graphics.h:8751
  #4  0x00007ff7089f0510 in gh_manager::get_object (h=@0x7fff11160150)
      at ./graphics.h:8575
  #5  0x00007ff708a6b78b in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1712
  #6  0x00007ff708b25329 in base_graphics_object::get_backend (this=0x1aad7b0)
      at ./graphics.h:2138
  #7  0x00007ff708b02509 in graphics_object::get_backend (this=0x7fff111601f0)
      at ./graphics.h:2303
  #8  0x00007ff708a6b7d9 in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1715
  #9  0x00007ff708b25329 in base_graphics_object::get_backend (this=0x1aad7b0)
      at ./graphics.h:2138
  #10 0x00007ff708b02509 in graphics_object::get_backend (this=0x7fff111602a0)
      at ./graphics.h:2303
  #11 0x00007ff708a6b7d9 in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1715
  #12 0x00007ff708b25329 in base_graphics_object::get_backend (this=0x1aad7b0)
      at ./graphics.h:2138
  #13 0x00007ff708b02509 in graphics_object::get_backend (this=0x7fff11160350)
      at ./graphics.h:2303
  #14 0x00007ff708a6b7d9 in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1715
  #15 0x00007ff708b25329 in base_graphics_object::get_backend (this=0x1aad7b0)
      at ./graphics.h:2138
  #16 0x00007ff708b02509 in graphics_object::get_backend (this=0x7fff11160400)
      at ./graphics.h:2303
  #17 0x00007ff708a6b7d9 in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1715
  #18 0x00007ff708b25329 in base_graphics_object::get_backend (this=0x1aad7b0)
      at ./graphics.h:2138
  #19 0x00007ff708b02509 in graphics_object::get_backend (this=0x7fff111604b0)
      at ./graphics.h:2303
  #20 0x00007ff708a6b7d9 in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1715
  #21 0x00007ff708b25329 in base_graphics_object::get_backend (this=0x1aad7b0)
      at ./graphics.h:2138
  #22 0x00007ff708b02509 in graphics_object::get_backend (this=0x7fff11160560)
      at ./graphics.h:2303
  #23 0x00007ff708a6b7d9 in base_properties::get_backend (this=0x1aad7c0)
      at /home/jwe/src/octave/src/graphics.cc:1715

I have no clues at this point.

jwe

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080828/38fc35e2/attachment.ksh 


More information about the Bug-octave mailing list