[Swift-devel] Problem with array fields in structures

Michael Wilde wilde at mcs.anl.gov
Mon Mar 22 07:52:23 CDT 2010


I suspect there is a bug in returning a structure from an app() when the structure contains an array.

Swift throws an exception "Mapper consistency check failed for s..vector[]/1. A HandleOpenException was thrown during consistency checking for s..vector[]/1
Caused by: Handle open: file[] s..vector[]/1

The following script distills it down from what I was seeing in a production script.

- Mike

pads1$ cat struct.swift
type file;

type struct {
  file scalar;
  file vector[];
}

struct s<ext; exec="struct.map">;

app (struct sa) a () { appa; }

s = a();

pads1$ cat struct.map
#! /bin/sh
echo scalar "f1"
echo vector[0] "f2"
pads1$ ./struct.map
scalar f1
vector[0] f2
pads1$ 
pads1$ swift struct.swift
Swift svn swift-r3264 (swift modified locally) cog-r2730 (cog modified locally)

RunID: 20100322-0746-7dygk1xa
Progress:
Execution failed:
        java.lang.RuntimeException: Mapper consistency check failed for s..vector[]/1. A HandleOpenException was thrown during consistency checking for s..vector[]/1
Caused by:
        Handle open: file[] s..vector[]/1
pads1$ cat struct.xml
<program xmlns="http://ci.uchicago.edu/swift/2009/02/swiftscript"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xs="http://www.w3.org/2001/XMLSchema">
  
  <types>
        <type>
                <typename>file</typename>
                <typealias>string</typealias>
                <typestructure></typestructure>
        </type>
        <type>
                <typename>struct</typename>
                <typealias></typealias>
                <typestructure>
                            <member>
                                        <membername>scalar</membername>
                                        <membertype>file</membertype>
                                </member>
                            <member>
                                        <membername>vector</membername>
                                        <membertype>file[]</membertype>
                                </member>
                </typestructure>
        </type>   
  </types>  
  <procedure name="a" src="line 10">

      <output 
    name="sa" type="struct"

     xsi:nil="true" />
    <binding>
      <application src="line 10">
        <executable>appa</executable>
      </application>
    </binding>
  </procedure>
  <variable name="s" type="struct" isGlobal="false">
    <mapping descriptor="ext">
      <param name="exec"><stringConstant>struct.map</stringConstant></param>
    </mapping>
  </variable>
  <call proc="a" src="line 12">
    <output><variableReference>s</variableReference></output>
  </call>
</program>
pads1$ 






-- 
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory




More information about the Swift-devel mailing list