I cannot seem to load tables holding (ref) tables via marshal, because 
'load'/'to' segfault.

Here's a small example:
    
    
    import marshal
    import tables
    
    type
      Works = ref object
        member: TableRef[string, string]
      Broken = ref object
        member: TableRef[string, TableRef[string, string]]
    
    var
      tmp: string
      works = new Works
      broken = new Broken
    
    echo "works"
    
    works.member = newTable[string, string]()
    tmp = $$works
    discard to[Works]tmp
    
    echo "broken"
    broken.member = newTable[string, TableRef[string, string]]()
    tmp = $$broken
    # the next line segfaults: SIGSEGV: Illegal storage access. (Attempt to 
read from nil?)
    discard to[Broken]tmp
    
    
    Run

Reply via email to