possible bug in concatenating character arrays

The following recipe gives a segmentation fault. ************************************************************************ In [1]: import numarray.strings as numstr In [2]: foo = numstr.array("acgttatcgt", shape=(3,3)) In [3]: foo[0] + foo[1] Segmentation fault ************************************************************************* It works if instead one does: ************************************************************************* In [4]: a = foo[0] In [5]: b = foo[1] In [6]: a Out[6]: CharArray(['a', 'c', 'g']) In [7]: b Out[7]: CharArray(['t', 't', 'a']) In [8]: a + b Out[8]: CharArray(['at', 'ct', 'ga']) *************************************************************************** In the case of numerical arrays, either method works. In [9]: bar = numarray.array(range(9), shape=(3,3)) In [10]: bar Out[10]: array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) In [11]: a = bar[0] In [12]: b = bar[1] In [13]: a + b Out[13]: array([3, 5, 7]) In [14]: bar[0] + bar[1] Out[14]: array([3, 5, 7]) ************************************************************ If this is a bug (I'd appreciate confirmation of this), should I report to the bug tracking system? Please cc me, I'm not subscribed. Faheem.

On Sun, 5 Sep 2004 01:45:42 +0000 (UTC), Faheem Mitha <faheem@email.unc.edu> wrote:
The following recipe gives a segmentation fault.
I should have mentioned this is with Numarray 1.0 with Debian Sarge and Python 2.3. ii python2.3-numarray 1.0-2 An array processing package modelled after Python-Numeric Faheem.x

On Sun, 5 Sep 2004 01:45:42 +0000 (UTC), Faheem Mitha <faheem@email.unc.edu> wrote:
The following recipe gives a segmentation fault.
************************************************************************ In [1]: import numarray.strings as numstr
In [2]: foo = numstr.array("acgttatcgt", shape=(3,3))
In [3]: foo[0] + foo[1] Segmentation fault *************************************************************************
Another thing that works is: In [4]: import copy In [5]: copy.copy(foo[0]) + copy.copy(foo[1]) Out[5]: CharArray(['at', 'ct', 'ga']) Faheem.

Hi Faheem, I was able to reproduce the problem using numarray-1.0 and Python-2.3.4 on Fedora Core 2. As Nadav said, the problem also appears to be fixed in numarray-1.1 and I was able to confirm that as well. I'll look into the hows and whys some more tomorrow. Regards, Todd On Sat, 2004-09-04 at 21:45, Faheem Mitha wrote:
The following recipe gives a segmentation fault.
************************************************************************ In [1]: import numarray.strings as numstr
In [2]: foo = numstr.array("acgttatcgt", shape=(3,3))
In [3]: foo[0] + foo[1] Segmentation fault *************************************************************************
It works if instead one does:
************************************************************************* In [4]: a = foo[0]
In [5]: b = foo[1]
In [6]: a Out[6]: CharArray(['a', 'c', 'g'])
In [7]: b Out[7]: CharArray(['t', 't', 'a'])
In [8]: a + b Out[8]: CharArray(['at', 'ct', 'ga']) ***************************************************************************
In the case of numerical arrays, either method works.
In [9]: bar = numarray.array(range(9), shape=(3,3))
In [10]: bar Out[10]: array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])
In [11]: a = bar[0]
In [12]: b = bar[1]
In [13]: a + b Out[13]: array([3, 5, 7])
In [14]: bar[0] + bar[1] Out[14]: array([3, 5, 7])
************************************************************
If this is a bug (I'd appreciate confirmation of this), should I report to the bug tracking system? Please cc me, I'm not subscribed.
Faheem.
------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion --

On Sun, 5 Sep 2004, Todd Miller wrote:
Hi Faheem,
I was able to reproduce the problem using numarray-1.0 and Python-2.3.4 on Fedora Core 2. As Nadav said, the problem also appears to be fixed in numarray-1.1 and I was able to confirm that as well. I'll look into the hows and whys some more tomorrow.
That would be great. Any idea when 1.1 is likely to be out? Faheem.
participants (2)
-
Faheem Mitha
-
Todd Miller