Project

General

Profile

Bug #13612 ยป segf_test_improved.rb

Better example for reproducible error - rovf (Ronald Fischer), 05/30/2017 02:04 PM

 
1
class EXPERT
2
    
3
    FIND_CHAIN_FOR_POS_FILTER_PIPELINE = 
4
      [ 
5
        :no_filter,
6
        :filter_by_etkz_e,
7
        :filter_chain_in_chain,
8
      ].each
9
    
10
    def find_chain_for_pos(sw_lines_for_module)
11

    
12
      br = '4711'
13

    
14
      FIND_CHAIN_FOR_POS_FILTER_PIPELINE.rewind        
15

    
16
      begin
17
        
18
        while true
19

    
20
          puts "before"          
21
          filter_method_symb = FIND_CHAIN_FOR_POS_FILTER_PIPELINE.next
22
          puts "after"
23
          
24
          sw_lines_for_module = NVP.send(filter_method_symb, br, sw_lines_for_module) 
25
          
26
          # LOG.trace { "SW Lines left after filter #{filter_method_symb}:\n#{SwRec.show_array(sw_lines_for_module)}"}
27
          
28
        end
29
        
30
      rescue StopIteration
31
        
32
        puts "done...."
33
        # LOG.trace "Could not find unique GRPID"
34
        
35
      end
36
      
37
                                                                                          
38
      nil                                                                                             
39
      
40
    end
41
end
42

    
43
class Cnt
44
  def initalize(n)
45
    @c=n
46
  end
47
  def decr
48
    @c -= 1
49
  end
50
  def to_s
51
    @c.to_s
52
  end
53
end
54

    
55
module NVP
56
  extend self
57
  def no_filter(b,a)
58
    [[a.size, b.nil?]] * (a.size)
59
  end
60
  def filter_by_etkz_e(x,y)
61
    no_filter(x,y)
62
  end
63
  def filter_chain_in_chain(x,y)
64
    filter_by_etkz_e(x,y)
65
  end
66
  def mu?(cn)
67
    cn.decr > 0
68
  end
69
end
70

    
71
newc = (ARGV[0]||1).to_i
72

    
73
c = EXPERT.new
74

    
75
newc.times do |cnt| 
76
  # puts "#{cnt} out of #{newc}"
77
  puts cnt
78
  c.find_chain_for_pos(%w(a b c d e))  
79
end