Orange Forum • View topic - 64 Bit OpenSuse bug

64 Bit OpenSuse bug

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

64 Bit OpenSuse bug

Postby iarriaga » Mon Aug 24, 2009 16:32

I have a 64 bits machine, with openSUSE 11.1 and I have a problem when I try to load a dataset from a file. The dataset that I am using is iris.tab. When I execute the following code:


Code: Select all
import orange

fn = '/home/iarriaga/orange/trunk/orange/doc/datasets/iris.tab'
argdict = { "createNewOn" : 0 }
data = orange.ExampleTable(fn, **argdict)

print data.domain
print data.domain.classVar
print data.domain.classVar.varType


I get the following output:

[sepal length, sepal width, petal length, petal width, iris]
EnumVariable 'iris'
140355236265985


The information is loaded in a right way because the output resulting of printing the domain and the classVar is coherent, but the varType throws a wrong output. This is a very big problem because when I am trying to work with the orangeCanvas and load an input from a file I get an error message that says

class is neither discrete nor continuous


I have tested this code in several 64 bits computers that use Suse and openSuse and the output is always wrong. In 32 bits machines this doesn't happen.

Postby iarriaga » Tue Aug 25, 2009 9:18

I have been making more tests. I have checked the varType value in the creation of the Variables in C++ code. These values are correct. I have also been checking the different values that the varType attribute of the Variable class in Python. If the variable is continuous the varType value is one more that if the variable is discrete. For example, printing the variable name and varType of one of the variables of the ExampleTable that results to load iris.tab, I get this:


sepal length
140668768878594
sepal width
140668768878594
petal length
140668768878594
petal width
140668768878594
iris
140668768878593

The values that I get in each execution is different, but the difference between discrete variables and continuous variables value is always one, and the number is always a huge integer.

Postby iarriaga » Tue Aug 25, 2009 11:12

I have solved the problem, but I think that not in an advisable way. I have changed the line 63 of the file vars.hpp. The original line was:

Code: Select all
int  varType; //P(&Variable_Type) variable type   


And my modification produces the following line:

Code: Select all
int  varType; //P variable type   


This mades that the int value passes like an int to the python code and solves the problem, but I don't know if this could affect other parts of the library. I have also removedd the others appeareances of (&Variable_Type) in prevision.

Postby Janez » Tue Aug 25, 2009 22:43

I can't replicate this on 64-bit Windows XP with Visual Studio 2005.

Could you try something for me? Open source/pyxtract/pyxtract.py and find

Code: Select all
void *PT%(wholename)s(void *l) { return Py%(wholename)s_FromLong(*(long *)l); }


Replace (long *) with (int *), and rebuild the original sources, without your modifications. Make sure you remove all *.px files (I think "make clean" should take care of this, but please check that they are really removed.) Does this fix the bug?

Thanks,
Janez

Postby iarriaga » Wed Aug 26, 2009 8:56

Hi Janez,

Your patch works right.

Thanks,

Ignacio.


Return to Bugs



cron