csound / csound

Main repository for Csound
https://csound.com
GNU Lesser General Public License v2.1
1.23k stars 193 forks source link

some tests fail on BigEndian #1650

Closed umlaeute closed 1 year ago

umlaeute commented 1 year ago

i'm just forwarding this bug-report from Debian, where some tests fail on the BigEndian s390x architecture. the full bug-report can be found on https://bugs.debian.org/1009185

the failing tests are:

our current "fix" for this problem is to simply disable these tests on BigEndian hosts :smirk:

also note that the bug-report is about Csound-6.17.0 and I have not (yet) confirmed whether it still applies to Csound-6.18.0 (but I think nothing has changed on that front)

vlazzarini commented 1 year ago

Thanks for the report. @kunstmusik @jpffitch I wonder if it's to do with hashing or SSTRCOD These examples seem to handle strings from score to orchestra in one way or another. Any endianess assumption there?

jpffitch commented 1 year ago

I took a look but did nor see anything obvious. I am suspicious of this code in Engine/rdscore.c

 {
   union {
     MYFLT d;
     int32 i;
   } ch;
   ch.d = p; n = ch.i&0xffff;
   while (n-- > 0) {
     ss += strlen(ss)+1;
   }
 }
 return ss;

in particular the taking of the 16n bits from ch.i as cheat union is unclear which half word i meant. Without a bigendian computer to look closely. it ought to have ch.i as an array of two int32fr clarity.

Still that is just unpicking a string from the collection of strings and I cannot see why that should affect so many tests.

at last a need for an old MAC or SGI

;i looked closely at Engine/namedin.c but could not see anything relevant

kunstmusik commented 1 year ago

We might be able to use Docker with s390x emulation to test. If it was just an endian issue I would have expected issues to show up on other platforms/architectures.

On Wed, Nov 2, 2022 at 12:43 PM John ffitch @.***> wrote:

I took a look but did nor see anything obvious. I am suspicious of this code in Engine/rdscore.c

{ union { MYFLT d; int32 i; } ch; ch.d = p; n = ch.i&0xffff; while (n-- > 0) { ss += strlen(ss)+1; } } return ss;

in particular the taking of the 16n bits from ch.i as cheat union is unclear which half word i meant. Without a bigendian computer to look closely. it ought to have ch.i as an array of two int32fr clarity.

Still that is just unpicking a string from the collection of strings and I cannot see why that should affect so many tests.

at last a need for an old MAC or SGI

;i looked closely at Engine/namedin.c but could not see anything relevant

— Reply to this email directly, view it on GitHub https://github.com/csound/csound/issues/1650#issuecomment-1300873724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMA67UVZNOBAQST7DYJRTWGKK45ANCNFSM6AAAAAARUZ6O2M . You are receiving this because you were mentioned.Message ID: @.***>

umlaeute commented 1 year ago

We might be able to use Docker with s390x emulation to test.

i don't think so. Docker does not emulate (but you can run Docker on an s390x host if you have the hardware :-)). you would need an emulator like qemu for this.

anyhow, i can run tests on s390x and ppc64.

If it was just an endian issue I would have expected issues to show up

ah well, BigEndian machines are on the decline. so i guess nobody runs (current) Csound on them right now...

in any case, I get the same errors on ppc64 (another BigEndian architecture):

csound  -nd tests/commandline//test23.csd 2> csound_test_output.txt
[FAIL] - Test 23: named instrument (test23.csd)
    Return Code: 5  Expected: 0
--
csound  -nd tests/commandline//test33.csd 2> csound_test_output.txt
[FAIL] - Test 33: using named instrument from score (testing score strings) (test33.csd)
    Return Code: 1  Expected: 0
--
csound  -nd tests/commandline//test36.csd 2> csound_test_output.txt
[FAIL] - Test 36: opcode with all input args optional (passign) (test36.csd)
    Return Code: 139    Expected: 0
--
csound  -nd tests/commandline//test_array_operations.csd 2> csound_test_output.txt
[FAIL] - Test 78: test multiple operations on multiple array types (test_array_operations.csd)
    Return Code: 15 Expected: 0
--
csound -Wd -n tests/regression//bugn.csd 2> csound_test_output.txt
[FAIL] - Test 9: named instruments (bugn.csd)
    Return Code: 2  Expected: 0
--
csound -Wd -n tests/regression//bugs.csd 2> csound_test_output.txt
[FAIL] - Test 10: multipe strings in score (bugs.csd)
    Return Code: 1  Expected: 0
vlazzarini commented 1 year ago

I think it could well be the union code.

The s390 failing tests involved either named instruments (picking a string from the score) or picking a string from a p-field.

Now there seems to be another test failing (array test).

kunstmusik commented 1 year ago

I run amd64 machines on M1 mac via emulation (very slow!). I saw this article mention s390x emulation:

https://docs.gitlab.com/omnibus/development/s390x.html

but I haven't looked into it further.

Thanks for confirming ppc64 failed too.

On Wed, Nov 2, 2022 at 6:28 PM umläute @.***> wrote:

We might be able to use Docker with s390x emulation to test.

i don't think so. Docker does not emulate (but you can run Docker on an s390x host if you have the hardware :-)). you would need an emulator like qemu for this.

anyhow, i can run tests on s390x and ppc64.

If it was just an endian issue I would have expected issues to show up

a well, BigEndian machines are on the decline. in any case, I get the same errors on ppc64 (another BigEndian architecture):

csound -nd tests/commandline//test23.csd 2> csound_test_output.txt [FAIL] - Test 23: named instrument (test23.csd) Return Code: 5 Expected: 0

csound -nd tests/commandline//test33.csd 2> csound_test_output.txt [FAIL] - Test 33: using named instrument from score (testing score strings) (test33.csd) Return Code: 1 Expected: 0

csound -nd tests/commandline//test36.csd 2> csound_test_output.txt [FAIL] - Test 36: opcode with all input args optional (passign) (test36.csd) Return Code: 139 Expected: 0

csound -nd tests/commandline//test_array_operations.csd 2> csound_test_output.txt [FAIL] - Test 78: test multiple operations on multiple array types (test_array_operations.csd) Return Code: 15 Expected: 0

csound -Wd -n tests/regression//bugn.csd 2> csound_test_output.txt [FAIL] - Test 9: named instruments (bugn.csd) Return Code: 2 Expected: 0

csound -Wd -n tests/regression//bugs.csd 2> csound_test_output.txt [FAIL] - Test 10: multipe strings in score (bugs.csd) Return Code: 1 Expected: 0

— Reply to this email directly, view it on GitHub https://github.com/csound/csound/issues/1650#issuecomment-1301429780, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMA633OM2DZYEGJLDRUXDWGLTI5ANCNFSM6AAAAAARUZ6O2M . You are receiving this because you were mentioned.Message ID: @.***>

umlaeute commented 1 year ago

I saw this article mention s390x emulation

ah i see. the docker image just pulls in qemu with s390x... that's of course a viable (albeit slow) way to run the BigEndian tests locally.

jpffitch commented 1 year ago

I do not know whans390x is, and has no idea how to  run an emulater.

I suspect that union is wrong as it picks up 16bits  at the bottom of the first 32bits....

⁣Get TypeApp for Android ​

On 3 Nov 2022, 07:39, at 07:39, "umläute" @.***> wrote:

I saw this article mention s390x emulation

ah i see. the docker image just pulls in qemu with s390x... that's of course a viable (albeit slow) way to run the BigEndian tests locally.

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1301737852 You are receiving this because you were mentioned.

Message ID: @.***>

kunstmusik commented 1 year ago

Certainly seems likely the problem; would be good to find a way to test ourselves but maybe we just have to try a fix and get @umlaeute to retest.

jpffitch commented 1 year ago

I am not sure how to fix. We have a NYFLT variale that is to be iterpreted as a 16bit it. /in te code we have a union of a MYFLY T and an int. in doule case they do not align but also endines rers its ead s were the 16 bts are

My hed cannot clear tis up##]

jpffitch commented 1 year ago

Adding some trace printing might be sufficient to isolate then oroble .

Ok t would also be instructive to see is it works with a single precision float. I will add the printing etc

⁣Get TypeApp for Android ​

On 5 Nov 2022, 16:30, at 16:30, Steven Yi @.***> wrote:

Certainly seems likely the problem; would be good to find a way to test ourselves but maybe we just have to try a fix and get @umlaeute to retest.

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1304581341 You are receiving this because you were mentioned.

Message ID: @.***>

jpffitch commented 1 year ago

anyhow, i can run tests on s390x and ppc64.

If so couldwe try a test? I hve added some additiol tracing to the code I suspect andif tisdoesnot show anything I can try oter tracig.

Tracing in develop branch now

umlaeute commented 1 year ago

this is what i get when i run the failing tests in tests/commandline/:

===================================
tests/commandline/test23.csd
===================================
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test23.csd
instr itest uses instrument number 1
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.001s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.001s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 48000.0, kr = 48000.000, ksmps = 1
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
      B  0.000 - note deleted. instr -2147483648(200) undefined
B  0.000 ..  1.000 T  1.000 TT  1.000 M:      0.0      0.0
      B  1.000 - note deleted. instr -2147483648(200) undefined
B  1.000 ..  2.000 T  2.000 TT  2.000 M:      0.0      0.0
      B  2.000 - note deleted. instr -2147483648(200) undefined
B  2.000 ..  3.000 T  3.000 TT  3.000 M:      0.0      0.0
      B  3.000 - note deleted. instr -2147483648(200) undefined
B  3.000 ..  4.000 T  4.000 TT  4.000 M:      0.0      0.0
      B  4.000 - note deleted. instr -2147483648(200) undefined
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.          overall amps:      0.0      0.0
       overall samples out of range:        0        0
5 errors in performance
Elapsed time at end of performance: real: 0.015s, CPU: 0.014s
no sound written to disk

===================================
tests/commandline/test33.csd
===================================
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test33.csd
instr op2 uses instrument number 1
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 344.531, ksmps = 128
0dBFS level = 1.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
ftable 1:
      B  0.000 - note deleted. instr -2147483648(200) undefined
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.          overall amps:  0.00000  0.00000
       overall samples out of range:        0        0
1 errors in performance
Elapsed time at end of performance: real: 0.001s, CPU: 0.000s
no sound written to disk

===================================
tests/commandline/test36.csd
===================================
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault

===================================
tests/commandline/test_array_operations.csd
===================================
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test_array_operations.csd
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
sr = 44100.0, kr = 1378.125, ksmps = 32
0dBFS level = 32768.0, A4 tuning = 440.0
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
      B  0.000 - note deleted. instr -2147483648(200) undefined
      B  0.010 - note deleted. instr -2147483648(200) undefined
      B  0.020 - note deleted. instr -2147483648(200) undefined
      B  0.030 - note deleted. instr -2147483648(200) undefined
      B  0.040 - note deleted. instr -2147483648(200) undefined
      B  0.050 - note deleted. instr -2147483648(200) undefined
      B  0.060 - note deleted. instr -2147483648(200) undefined
      B  0.070 - note deleted. instr -2147483648(200) undefined
      B  0.080 - note deleted. instr -2147483648(200) undefined
      B  0.090 - note deleted. instr -2147483648(200) undefined
      B  0.100 - note deleted. instr -2147483648(200) undefined
      B  0.110 - note deleted. instr -2147483648(200) undefined
      B  0.120 - note deleted. instr -2147483648(200) undefined
      B  0.130 - note deleted. instr -2147483648(200) undefined
      B  0.140 - note deleted. instr -2147483648(200) undefined
Score finished in csoundPerform().
end of score.          overall amps:      0.0
       overall samples out of range:        0
15 errors in performance

(the csound-plugins package has not been installed, hence the WARNING at the beginning of each test).

this time i ran the tests manually (as opposed to using tests/commandline/test.py), which shows a couple more failing tests:

umlaeute commented 1 year ago

UPDATE

i double checked with the Debian Csound-6.18 package, and ran the same tests there manually as well: the output is virtually identical (apart from saying "Csound version 6.18 (double samples) 2022-11-02" instead of "Csound version 7.0 (double samples) 2022-11-09".

@jpffitch are you sure that the additional tracing is enabled?

vlazzarini commented 1 year ago

thanks, a quick glance seems to indicate that string translation may be involved, the code that @jpffitch is looking at.

jpffitch commented 1 year ago

Question: does s390x use IEEE floating point or something else?

⁣Get TypeApp for Android ​

On 9 Nov 2022, 11:33, at 11:33, "umläute" @.***> wrote:

this is what i get when i run the failing tests in tests/commandline/:

===================================
tests/commandline/test23.csd
===================================
WARNING: Error opening plugin directory
'/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or
directory
UnifiedCSD:  tests/commandline/test23.csd
instr itest uses instrument number 1
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.001s
sorting score ...
  ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.001s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 48000.0, kr = 48000.000, ksmps = 1
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
    B  0.000 - note deleted. instr -2147483648(200) undefined
B  0.000 ..  1.000 T  1.000 TT  1.000 M:      0.0      0.0
    B  1.000 - note deleted. instr -2147483648(200) undefined
B  1.000 ..  2.000 T  2.000 TT  2.000 M:      0.0      0.0
    B  2.000 - note deleted. instr -2147483648(200) undefined
B  2.000 ..  3.000 T  3.000 TT  3.000 M:      0.0      0.0
    B  3.000 - note deleted. instr -2147483648(200) undefined
B  3.000 ..  4.000 T  4.000 TT  4.000 M:      0.0      0.0
    B  4.000 - note deleted. instr -2147483648(200) undefined
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.         overall amps:      0.0      0.0
     overall samples out of range:        0        0
5 errors in performance
Elapsed time at end of performance: real: 0.015s, CPU: 0.014s
no sound written to disk

===================================
tests/commandline/test33.csd
===================================
WARNING: Error opening plugin directory
'/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or
directory
UnifiedCSD:  tests/commandline/test33.csd
instr op2 uses instrument number 1
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
  ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 344.531, ksmps = 128
0dBFS level = 1.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
ftable 1:
    B  0.000 - note deleted. instr -2147483648(200) undefined
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.         overall amps:  0.00000  0.00000
     overall samples out of range:        0        0
1 errors in performance
Elapsed time at end of performance: real: 0.001s, CPU: 0.000s
no sound written to disk

===================================
tests/commandline/test36.csd
===================================
WARNING: Error opening plugin directory
'/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or
directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
  ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault

===================================
tests/commandline/test_array_operations.csd
===================================
WARNING: Error opening plugin directory
'/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or
directory
UnifiedCSD:  tests/commandline/test_array_operations.csd
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
sr = 44100.0, kr = 1378.125, ksmps = 32
0dBFS level = 32768.0, A4 tuning = 440.0
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
    B  0.000 - note deleted. instr -2147483648(200) undefined
    B  0.010 - note deleted. instr -2147483648(200) undefined
    B  0.020 - note deleted. instr -2147483648(200) undefined
    B  0.030 - note deleted. instr -2147483648(200) undefined
    B  0.040 - note deleted. instr -2147483648(200) undefined
    B  0.050 - note deleted. instr -2147483648(200) undefined
    B  0.060 - note deleted. instr -2147483648(200) undefined
    B  0.070 - note deleted. instr -2147483648(200) undefined
    B  0.080 - note deleted. instr -2147483648(200) undefined
    B  0.090 - note deleted. instr -2147483648(200) undefined
    B  0.100 - note deleted. instr -2147483648(200) undefined
    B  0.110 - note deleted. instr -2147483648(200) undefined
    B  0.120 - note deleted. instr -2147483648(200) undefined
    B  0.130 - note deleted. instr -2147483648(200) undefined
    B  0.140 - note deleted. instr -2147483648(200) undefined
Score finished in csoundPerform().
end of score.         overall amps:      0.0
     overall samples out of range:        0
15 errors in performance

(the csound-plugins package has not been installed, hence the WARNING at the beginning of each test).

this time i ran the tests manually (as opposed to using tests/commandline/test.py), which shows a couple more failing tests:

  • tests/commandline/test23.csd
  • tests/commandline/test24.csd
  • tests/commandline/test33.csd
  • tests/commandline/test36.csd
  • tests/commandline/test44.csd
  • tests/commandline/test48.csd
  • tests/commandline/test_array_operations.csd
  • tests/commandline/test_arrays_fns.csd
  • tests/commandline/test_arrays_in_udo.csd
  • tests/commandline/test_arrays_negative_dimension_fail.csd
  • tests/commandline/test_invalid_expression.csd
  • tests/commandline/test_invalid_ternary.csd
  • tests/commandline/test_plusname.csd
  • tests/commandline/test_semantics_undefined_var.csd

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1308615419 You are receiving this because you were mentioned.

Message ID: @.***>

umlaeute commented 1 year ago

Am 9. November 2022 16:08:18 MEZ schrieb John ffitch @.***>:

Question: does s390x use IEEE floating point or something else?

Honestly i have no idea (though I always assumed the former). How would I test that?

umlaeute commented 1 year ago

according to https://stackoverflow.com/questions/31181897/, it should be enough to check for the __STDC_IEC_559__ define, which is indeed set:

$ cpp -dM /dev/null  | egrep "(s390|STDC_IEC_559)"
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
#define __s390__ 1
#define __s390x__ 1

so i take this as: yes, s390x uses IEEE floating point.

jpffitch commented 1 year ago

Thanks That idea will not fly. ⁣Get TypeApp for Android ​

On 10 Nov 2022, 07:30, at 07:30, "umläute" @.***> wrote:

according to https://stackoverflow.com/questions/31181897/, it should be enough to check for the __STDC_IEC_559__ define, which is indeed set:

$ cpp -dM /dev/null  | egrep "(s390|STDC_IEC_559)"
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
#define __s390__ 1
#define __s390x__ 1

so i take this as: yes, s390x uses IEEE floating point.

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1309881265 You are receiving this because you were mentioned.

Message ID: @.***>

jpffitch commented 1 year ago

Could you pull the latest develop branch, make o s390x(or oter bugendian machine) and send me the output for running test36 from tests/commandlie ?

It isno a soluton but I tink wil give menough diagnostic information. There are 3 or 4 places in te code tat need adjusting sigficantly so tis is just aste on te way. i think I understand the causes, and if so have a olan to fix

umlaeute commented 1 year ago

here you go:

$ git describe 
6.17.0-517-g3a28e6391
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd |& tee ../test36.log
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
**** 7ff80000.8
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault
jpffitch commented 1 year ago

ak you. That might be suffient. Wil see if I hveenough info

On Sun, 13 Nov 2022, umläute wrote:

here you go:

$ git describe 6.17.0-517-g3a28e6391 $ obj-s390x-linux-gnu/csound -nd tests/commandline/test36.csd |& tee ../test3 6.log WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugi ns64-7.0': No such file or directory UnifiedCSD: tests/commandline/test36.csd Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s sorting score ... ... done Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s --Csound version 7.0 (double samples) 2022-11-09 [commit: none] libsndfile-1.1.0 displays suppressed sr = 44100.0, kr = 4410.000, ksmps = 10 0dBFS level = 32768.0, A4 tuning = 440.0 orch now loaded audio buffered in 256 sample-frame blocks not writing to sound disk SECTION 1: **** 7ff80000.8 new alloc for instr 1: WARNING: instr 1 uses 3 p-fields but is given 5 instr 1: iv1 = 1.000 instr 1: iv2 = 0.000 instr 1: iv3 = 3.000 instr 1: iv4 = 4.000

csound command: Segmentation fault

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[ABBM2QWFGFJPWMYD4LJB6FDWIFFZLA5CNFSM6AAAAAARUZ6O2OWGG33NNVSW45C7OR 4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSOH73K6.gif] Message ID: @.***>

jpffitch commented 1 year ago

Can you try this again please? More diagnostics but getting closer to getting it right. i tink tereis an error in the littleendia version that only happens incomplex cases.

=John ff

On Sun, 13 Nov 2022, umläute wrote:

here you go:

$ git describe 6.17.0-517-g3a28e6391 $ obj-s390x-linux-gnu/csound -nd tests/commandline/test36.csd |& tee ../test3 6.log WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugi ns64-7.0': No such file or directory UnifiedCSD: tests/commandline/test36.csd Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s sorting score ... ... done Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s --Csound version 7.0 (double samples) 2022-11-09 [commit: none] libsndfile-1.1.0 displays suppressed sr = 44100.0, kr = 4410.000, ksmps = 10 0dBFS level = 32768.0, A4 tuning = 440.0 orch now loaded audio buffered in 256 sample-frame blocks not writing to sound disk SECTION 1: **** 7ff80000.8 new alloc for instr 1: WARNING: instr 1 uses 3 p-fields but is given 5 instr 1: iv1 = 1.000 instr 1: iv2 = 0.000 instr 1: iv3 = 3.000 instr 1: iv4 = 4.000

csound command: Segmentation fault

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[ABBM2QWFGFJPWMYD4LJB6FDWIFFZLA5CNFSM6AAAAAARUZ6O2OWGG33NNVSW45C7OR 4X<<AZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSOH73K6.gif] Message ID: @.***>

umlaeute commented 1 year ago

here you go:

$ git describe
6.17.0-523-g66be27970
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.002s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
**** 7ff80000
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault

(I'm afraid the difference in the output between 3a28e6391 and 66be27970 is small)

umlaeute commented 1 year ago

i think i never posted a backtrace, so:

0x000003fffd9e9cec in ?? () from /lib/s390x-linux-gnu/libc.so.6
(gdb) bt
#0  0x000003fffd9e9cec in ?? () from /lib/s390x-linux-gnu/libc.so.6
#1  0x000003fffd9eb9ae in ?? () from /lib/s390x-linux-gnu/libc.so.6
#2  0x000003fffdc4e9b6 in csoundDefaultMessageCallback (csound=<optimized out>, attr=<optimized out>, format=0x3fffdeb3016 "%s\n", args=0x3ffffffec98) at /home/umlaeute/umlaeute-csound/csound/Top/csound.c:2595
#3  0x000003fffdc4ee04 in csoundMessageS (csound=0x2aa00016eb0, attr=<optimized out>, format=<optimized out>) at /home/umlaeute/umlaeute-csound/csound/Top/csound.c:2677
#4  0x000003fffdcd2c52 in puts_opcode_init (csound=<optimized out>, p=0x2aa001a2978) at /home/umlaeute/umlaeute-csound/csound/OOps/str_ops.c:598
#5  0x000003fffdc63b22 in init_pass (csound=csound@entry=0x2aa00016eb0, ip=ip@entry=0x2aa00192bc0) at /home/umlaeute/umlaeute-csound/csound/Engine/insert.c:119
#6  0x000003fffdc68a3c in insert_event (csound=0x2aa00016eb0, insno=<optimized out>, newevtp=0x2aa0001c678) at /home/umlaeute/umlaeute-csound/csound/Engine/insert.c:484
#7  0x000003fffdc6943e in insert (csound=csound@entry=0x2aa00016eb0, insno=insno@entry=1, newevtp=newevtp@entry=0x2aa0001c678) at /home/umlaeute/umlaeute-csound/csound/Engine/insert.c:307
#8  0x000003fffdc6e2e2 in process_score_event (csound=csound@entry=0x2aa00016eb0, evt=evt@entry=0x2aa0001c678, rtEvt=rtEvt@entry=0) at /home/umlaeute/umlaeute-csound/csound/Engine/musmon.c:859
#9  0x000003fffdc7018e in sensevents (csound=csound@entry=0x2aa00016eb0) at /home/umlaeute/umlaeute-csound/csound/Engine/musmon.c:1068
#10 0x000003fffdc5293a in csoundPerform (csound=csound@entry=0x2aa00016eb0) at /home/umlaeute/umlaeute-csound/csound/Top/csound.c:2344
#11 0x000002aa000016f0 in main (argc=<optimized out>, argv=0x3fffffff458) at /home/umlaeute/umlaeute-csound/csound/Frontends/csound/csound_main.c:327
jpffitch commented 1 year ago

Thanks. As I expected.

The problem is in both big- and little-endian.  The backtrace is in code that I knew needed revision sob the backtrace is useful.

At present I am having problems scheduling time to work on this.  Maybe tonight...

On 16 Nov 2022, 12:30, at 12:30, "umläute" @.***> wrote:

here you go:

$ git describe
6.17.0-523-g66be27970
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd
WARNING: Error opening plugin directory
'/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or
directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
       ... done
Elapsed time at end of score sort: real: 0.002s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
**** 7ff80000
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 5
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault

(I'm afraid the difference in the output between 3a28e6391 and 66be27970 is small)

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1316943206 You are receiving this because you were mentioned.

Message ID: @.***>

jpffitch commented 1 year ago

lese couldyou try tenewversion in guthub. have definireay fixed the major error in little endian machines but am not sure that it isfixed for big endian.

test36 was modified to test the bad cdoe.

There is still a lot of tracing but I wull remove when it(/if?) is working

umlaeute commented 1 year ago

here you go:

$ git describe --always
6.17.0-524-g1bf8a58ec
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
**** 7ff80000 00000000
***  7ff80000 00000000
**** 7ff80000 00000000
***  7ff80001 00000000
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 6
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault
Segmentation fault
umlaeute commented 1 year ago

i re-ran the tests today (seeing that some tracing calls have been removed), and I'm afraid the issue is still not fixed. :cry:

$ git describe
6.17.0-531-gbcc00ceb8
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd        
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.000s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.003s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 6
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault
Segmentation fault
jpffitch commented 1 year ago

Do the other tests run?  I fixed a cause of some errors but I cannot find anything odd in test36.

⁣Get TypeApp for Android ​

On 22 Nov 2022, 07:17, at 07:17, "umläute" @.***> wrote:

i re-ran the tests today (seeing that some tracing calls have been removed), and I'm afraid the issue is still not fixed. :cry:

$ git describe
6.17.0-531-gbcc00ceb8
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd        
WARNING: Error opening plugin directory
'/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or
directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.000s
sorting score ...
       ... done
Elapsed time at end of score sort: real: 0.003s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 6
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault
Segmentation fault

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1323215456 You are receiving this because you were mentioned.

Message ID: @.***>

jpffitch commented 1 year ago

I have added mny new deugging mssaes as I ave no idea where to look for the error (yet). Could you please run test36.csd aCc : Attchmnt: Subject : Re: [csound/csound] some tests fail on BigEndian (Issue #1650) ----- Message Text ----- I have added mny new deugging mssaes as I ave no idea where to look for the error (yet). Could you please run test36.csd again?

Or you could give me details of how to emulate te s390x

With apoloies

==John

umlaeute commented 1 year ago

here you go again:

 git describe
6.17.0-535-g3a53efff8
$ obj-s390x-linux-gnu/csound  -nd tests/commandline/test36.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/test36.csd
Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
***  7ff80000 00000000
***  7ff80001 00000000
new alloc for instr 1:
WARNING: instr 1 uses 3 p-fields but is given 6
*** p1 0x2aa3ee2c6b0
*** p2 0x2aa3ee2c6b8
*** p3 0x2aa3ee2c6c0
*** p4 0x2aa3ee2c6c8
*** p5 0x2aa3ee2c6d0
*** p6 0x2aa3ee2c6d8
instr 1:  iv1 = 1.000
instr 1:  iv2 = 0.000
instr 1:  iv3 = 3.000
instr 1:  iv4 = 4.000

csound command: Segmentation fault
Segmentation fault
umlaeute commented 1 year ago

as for the other tests, something has changed (but seemingly for the worse):

tests/commandline/:

[FAIL] - Test 23: named instrument (test23.csd)
        Return Code: 5  Expected: 0
[FAIL] - Test 33: using named instrument from score (testing score strings) (test33.csd)
        Return Code: 1  Expected: 0
[FAIL] - Test 36: opcode with all input args optional (passign) (test36.csd)
        Return Code: 139        Expected: 0
[FAIL] - Test 84: test multiple operations on multiple array types (test_array_operations.csd)
        Return Code: 15 Expected: 0
[FAIL] - Test 89: test +Name for instr name (test_plusname.csd)
        Return Code: 1  Expected: 0
[FAIL] - Test 98: basic struct test (structs/test_structs.csd)
        Return Code: 1  Expected: 0
[FAIL] - Test 99: read/write to struct member of struct (structs/test_sub_structs.csd)
        Return Code: 1  Expected: 0
[FAIL] - Test 100: arrays of structs (structs/test_struct_arrays.csd)
        Return Code: 1  Expected: 0

and from tests/regression/:

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd 2> csound_test_output.txt
[FAIL] - Test 7:   (bugl.csd)
    Return Code: 4  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugn.csd 2> csound_test_output.txt
[FAIL] - Test 9: named instruments (bugn.csd)
    Return Code: 1  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugs.csd 2> csound_test_output.txt
[FAIL] - Test 10: multipe strings in score (bugs.csd)
    Return Code: 1  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugaa.csd 2> csound_test_output.txt
[FAIL] - Test 19: arate array arithmetic (bugaa.csd)
    Return Code: 1  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugsize.csd 2> csound_test_output.txt
[FAIL] - Test 36: Showing size change in arrays (bugsize.csd)
    Return Code: 1  Expected: 0

================================================================================

Tests Passed: 38
Tests Failed: 5

if you need more detailed output, let me know.

umlaeute commented 1 year ago

Or you could give me details of how to emulate te s390x

i'm afraid, not really (i'm lucky having access to an s390x machine)

So the only option I see is https://docs.gitlab.com/omnibus/development/s390x.html as mentioned by @kunstmusik i was afraid that this would be painfully slow, but after a quick test it seems that it is pretty fast.

  1. install docker On Debian I did something like this:

    sudo apt-get install docker.io

    Make sure that your user is part of the docker group. After that make sure that the group is active (You might have to logout and re-login again; or use newgrp docker for your current shell)

  2. run

    docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    docker run --rm -it --volume /full/path/to/csound-src/:/csound s390x/ubuntu bash

    This will download some 400MB of data. After you've run the second command, you find yourself as root in an s390x isolated container. The /csound folder within the container has the host's /full/path/to/csound-src/ mounted

  3. setup your build environment within the container. it's probably easiest to just install all the packages needed to build the Debian csound package:

    sed -e 's|^# deb-src|deb src|' -i /etc/apt/sources.list
    apt-get update
    apt-get build-dep csound

    (but you certainly know better than me how to setup a build-environment for csound :-))

  4. hack away. the docker container has no GUI, so either run your favourite text-based editor within the container; or just edit the sources in the host environment (since /full/path/to/csound-src/ is bind-mounted into the container, that's probably the most convenient way)

  5. compile within the container and run your tests. the only thing to keep in mind is, that you are running as root inside the container. so anything you create within the container is owned by root (and slightly harder to remove/modify on the host system)

if i had known that running s390x is so easy to setup, I could have spared me the ssh sessions to the real metal...

jpffitch commented 1 year ago

Looks scary!  What does"within the container" mean? By

⁣Get TypeApp for Android ​

On 23 Nov 2022, 11:38, at 11:38, "umläute" @.***> wrote:

Or you could give me details of how to emulate te s390x

i'm afraid, not really (i'm lucky having access to an s390x machine)

So the only option I see is https://docs.gitlab.com/omnibus/development/s390x.html as mentioned by @kunstmusik i was afraid that this would be painfully slow, but after a quick test it seems that it is pretty fast.

  1. install docker On Debian I did something like this:

    sudo apt-get install docker.io

    Make sure that your user is part of the docker group. After that make sure that the group is active (You might have to logout and re-login again; or use newgrp docker for your current shell)

  2. run

    docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    docker run --rm -it --volume /full/path/to/csound-src/:/csound
    s390x/ubuntu bash

    This will download some 400MB of data. After you've run the second command, you find yourself as root in an s390x isolated container. The /csound folder within the container has the host's /full/path/to/csound-src/ mounted

  3. setup your build environment **within the container***. it's probably easiest to just install all the packages needed to build the Debian csound package:

    sed -e 's|^# deb-src|deb src|' -i /etc/apt/sources.list
    apt-get update
    apt-get build-dep csound

    (but you certainly know better than me how to setup a build-environment for csound :-))

  4. hack away. the docker container has no GUI, so either run your favourite text-based editor within the container; or just edit the sources in the host environment (since /full/path/to/csound-src/ is bind-mounted into the container, that's probably the most convenient way)

  5. compile within the container and run your tests. the only thing to keep in mind is, that you are running as root inside the container. so anything you create within the container is owned by root (and slightly harder to remove/modify on the host system)

if i had known that running s390x is so easy to setup, I could have spared me the ssh sessions to the real metal...

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1324921328 You are receiving this because you were mentioned.

Message ID: @.***>

umlaeute commented 1 year ago

What does"within the container" mean?

Docker is a containerization software, that allows you to run isolated "systems", where a system is basically a full OS (but without its own kernel). a similar thing is "Windows Subsystem for Linux". a typically analogy is a "Virtual Machine" (as in qemu, VirtualBox, VMware,...) though this is technically incorrect (as a VM would run it's own kernel).

in any case, you would use it similar to a (headless) VM or some remote machine, where you can connect to via a "terminal" from your host computer (e.g. via ssh)

So "within the container" means, that you log into that "machine" (by typing the docker run ... incantation) and then you can work there (but without your desktop...)

jpffitch commented 1 year ago

Fairly sure I fixed this in github now.  Please try it

⁣Get TypeApp for Android ​

On 23 Nov 2022, 11:04, at 11:04, "umläute" @.***> wrote:

as for the other tests, something has changed (but seemingly for the worse):

tests/commandline/:

[FAIL] - Test 23: named instrument (test23.csd)
       Return Code: 5  Expected: 0
[FAIL] - Test 33: using named instrument from score (testing score
strings) (test33.csd)
       Return Code: 1  Expected: 0
[FAIL] - Test 36: opcode with all input args optional (passign)
(test36.csd)
       Return Code: 139        Expected: 0
[FAIL] - Test 84: test multiple operations on multiple array types
(test_array_operations.csd)
       Return Code: 15 Expected: 0
[FAIL] - Test 89: test +Name for instr name (test_plusname.csd)
       Return Code: 1  Expected: 0
[FAIL] - Test 98: basic struct test (structs/test_structs.csd)
       Return Code: 1  Expected: 0
[FAIL] - Test 99: read/write to struct member of struct
(structs/test_sub_structs.csd)
       Return Code: 1  Expected: 0
[FAIL] - Test 100: arrays of structs (structs/test_struct_arrays.csd)
       Return Code: 1  Expected: 0

and from tests/regression/:

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd 2>
csound_test_output.txt
[FAIL] - Test 7:   (bugl.csd)
  Return Code: 4  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugn.csd 2>
csound_test_output.txt
[FAIL] - Test 9: named instruments (bugn.csd)
  Return Code: 1  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugs.csd 2>
csound_test_output.txt
[FAIL] - Test 10: multipe strings in score (bugs.csd)
  Return Code: 1  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugaa.csd 2>
csound_test_output.txt
[FAIL] - Test 19: arate array arithmetic (bugaa.csd)
  Return Code: 1  Expected: 0

obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugsize.csd 2>
csound_test_output.txt
[FAIL] - Test 36: Showing size change in arrays (bugsize.csd)
  Return Code: 1  Expected: 0

================================================================================

Tests Passed: 38
Tests Failed: 5

if you need more detailed output, let me know.

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1324880397 You are receiving this because you were mentioned.

Message ID: @.***>

umlaeute commented 1 year ago

hooray! no more crashes!

we still get a (smaller) number of failing tests though:

$ tests/commandline/test.py --csound-executable=obj-s390x-linux-gnu/csound --source-dir=tests/commandline/
[...]
Tests Passed: 102
Tests Failed: 3

[FAILED TESTS]

[FAIL] - Test 98: basic struct test (structs/test_structs.csd)
        Return Code: 1  Expected: 0
[FAIL] - Test 99: read/write to struct member of struct (structs/test_sub_structs.csd)
        Return Code: 1  Expected: 0
[FAIL] - Test 100: arrays of structs (structs/test_struct_arrays.csd)
        Return Code: 1  Expected: 0

and

$ tests/regression/test.py --csound-executable=obj-s390x-linux-gnu/csound --source-dir=tests/regression/
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd 2> csound_test_output.txt
[FAIL] - Test 7:   (bugl.csd)
        Return Code: 4  Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugn.csd 2> csound_test_output.txt
[FAIL] - Test 9: named instruments (bugn.csd)
        Return Code: 1  Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugaa.csd 2> csound_test_output.txt
[FAIL] - Test 19: arate array arithmetic (bugaa.csd)
        Return Code: 1  Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugsize.csd 2> csound_test_output.txt
[FAIL] - Test 36: Showing size change in arrays (bugsize.csd)
        Return Code: 1  Expected: 0
[...]
================================================================================

Tests Passed: 39
Tests Failed: 4

but i think we've come a long way!

kunstmusik commented 1 year ago

FYI: I think the 3 tests listed were already failing before these changes; I had not been testing regression here but it could be that those tests may have also been failing before these changes too.

On Wed, Nov 23, 2022 at 11:17 AM umläute @.***> wrote:

hooray! no more crashes!

we still get a (smaller) number of failing tests though:

$ tests/commandline/test.py --csound-executable=obj-s390x-linux-gnu/csound --source-dir=tests/commandline/ [...] Tests Passed: 102 Tests Failed: 3

[FAILED TESTS]

[FAIL] - Test 98: basic struct test (structs/test_structs.csd) Return Code: 1 Expected: 0 [FAIL] - Test 99: read/write to struct member of struct (structs/test_sub_structs.csd) Return Code: 1 Expected: 0 [FAIL] - Test 100: arrays of structs (structs/test_struct_arrays.csd) Return Code: 1 Expected: 0

and

$ tests/regression/test.py --csound-executable=obj-s390x-linux-gnu/csound --source-dir=tests/regression/ [...] obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd 2> csound_test_output.txt [FAIL] - Test 7: (bugl.csd) Return Code: 4 Expected: 0 [...] obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugn.csd 2> csound_test_output.txt [FAIL] - Test 9: named instruments (bugn.csd) Return Code: 1 Expected: 0 [...] obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugaa.csd 2> csound_test_output.txt [FAIL] - Test 19: arate array arithmetic (bugaa.csd) Return Code: 1 Expected: 0 [...] obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugsize.csd 2> csound_test_output.txt [FAIL] - Test 36: Showing size change in arrays (bugsize.csd) Return Code: 1 Expected: 0 [...]

Tests Passed: 39 Tests Failed: 4

but i think we've come a long way!

— Reply to this email directly, view it on GitHub https://github.com/csound/csound/issues/1650#issuecomment-1325329240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMA6ZTSEPASGSJGAJ53BTWJY7THANCNFSM6AAAAAARUZ6O2M . You are receiving this because you were mentioned.Message ID: @.***>

umlaeute commented 1 year ago

iirc, only the 4+2 tests mentioned at the top of this thread where failing (and only on BigEndian). Now we have 3+4 tests failing, which is 1 more failure. but we (well: john that is) have fixed the crasher.

umlaeute commented 1 year ago

though actually, on closer inspection:

$ obj-s390x-linux-gnu/csound tests/commandline/structs/test_structs.csd 
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/structs/test_structs.csd

csound command: Segmentation fault
end of score.              overall amps:      0.0
           overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 0.251s, CPU: 0.001s

and

$ obj-s390x-linux-gnu/csound tests/commandline/structs/test_sub_structs.csd 
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/structs/test_sub_structs.csd

csound command: Segmentation fault
end of score.              overall amps:      0.0
           overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 0.251s, CPU: 0.000s

so there's still segfaults (according to the printout), but the exit code is 1 (rather than 139, which would indicate a segfault caught by the shell)

this one looks a bit scary ("memory allocate failure for -1811939502"):

$ obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/regression//bugl.csd
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.001s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.001s, CPU: 0.001s
--Csound version 7.0 (double samples) 2022-11-09
[commit: none]
libsndfile-1.1.0
displays suppressed
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
ftable 101:
WARNING: Seeding from current time 3514362948

orch now loaded
audio buffered in 256 sample-frame blocks
not writing to sound disk
SECTION 1:
new alloc for instr 1:
ftable 102:
ftable 103:
*** puts_opcode-int Result: 12 7 11 6 2 5 9 10 3 8 4 1
Result: 12 7 11 6 2 5 9 10 3 8 4 1
new alloc for instr 2:
ftable 103:
ftable 104:
*** puts_opcode-int Result: 2 10 5 4 6 11 1 7 8 9 12 3
Result: 2 10 5 4 6 11 1 7 8 9 12 3
ftable 104:
ftable 105:
*** puts_opcode-int Result: 5 3 7 4 6 1 12 11 2 9 10 8
Result: 5 3 7 4 6 1 12 11 2 9 10 8
ftable 105:
ftable 106:
memory allocate failure for -1811939502Early return from csoundPerform().
inactive allocs returned to freespace
end of score.              overall amps:      0.0
           overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 2.373s, CPU: 2.362s
no sound written to disk

the rest is more graceful (unknown opcodes):

$ obj-s390x-linux-gnu/csound tests/commandline/structs/test_struct_arrays.csd            
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/commandline/structs/test_struct_arrays.csd
error:  Unable to find opcode entry for '=' with matching argument types:

Found:
  :MyType; = :MyType;

Candidates:
  S =.S S
  S =.T i
  r =.r i
  IIIIIIIIIIIIIIIIIIIIIIII =.i m
  zzzzzzzzzzzzzzzzzzzzzzzz =.k z
  a =.a a
  a =.l a
  a =.up k
  k =.down ao
  f =.f f
  . =.generic i
  i[] =.I i[]
  i[] =.J k[]
  k[] =.K i[]
  .[] =._ .[]
  .[] =.L .[]
  k[] =.X k
  a[] =.Z a

Line: 17
 from file tests/commandline/structs/test_struct_arrays.csd (1)
Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.001s, CPU: 0.001s

and

$ obj-s390x-linux-gnu/csound -Wd -n tests/regression/bugn.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/regression/bugn.csd
error:  Unable to find opcode with name: alwayson

Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.000s, CPU: 0.000s
no sound written to disk

and

$ obj-s390x-linux-gnu/csound -Wd -n tests/regression/bugaa.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/regression/bugaa.csd
error:  Unable to find opcode entry for '=' with matching argument types:

Found:
  a[] = :a[;

Candidates:
  S =.S S
  S =.T i
  r =.r i
  IIIIIIIIIIIIIIIIIIIIIIII =.i m
  zzzzzzzzzzzzzzzzzzzzzzzz =.k z
  a =.a a
  a =.l a
  a =.up k
  k =.down ao
  f =.f f
  . =.generic i
  i[] =.I i[]
  i[] =.J k[]
  k[] =.K i[]
  .[] =._ .[]
  .[] =.L .[]
  k[] =.X k
  a[] =.Z a

Line: 18
 from file tests/regression/bugaa.csd (1)
Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.000s, CPU: 0.000s
no sound written to disk

and

$ obj-s390x-linux-gnu/csound -Wd -n tests/regression/bugsize.csd
WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory
UnifiedCSD:  tests/regression/bugsize.csd
error:  Unable to find opcode entry for 'sin' with matching argument types:

Found:
  i[] sin i[]

Candidates:
  i sin.i i
  k sin.k k
  a sin.a a

Line: 22
 from file tests/regression/bugsize.csd (1)
Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.001s, CPU: 0.001s
no sound written to disk
jpffitch commented 1 year ago

All the ones i have checked fail on my Linux system x86_64 system.  It looks as if structs are no really implemented.  In many ways the 4 regression tests failing are more worrying

I think we can close the endian issue and I will clean the tracing

⁣Get TypeApp for Android ​

On 23 Nov 2022, 16:18, at 16:18, "umläute" @.***> wrote:

hooray! no more crashes!

we still get a (smaller) number of failing tests though:

$ tests/commandline/test.py
--csound-executable=obj-s390x-linux-gnu/csound
--source-dir=tests/commandline/
[...]
Tests Passed: 102
Tests Failed: 3

[FAILED TESTS]

[FAIL] - Test 98: basic struct test (structs/test_structs.csd)
       Return Code: 1  Expected: 0
[FAIL] - Test 99: read/write to struct member of struct
(structs/test_sub_structs.csd)
       Return Code: 1  Expected: 0
[FAIL] - Test 100: arrays of structs (structs/test_struct_arrays.csd)
       Return Code: 1  Expected: 0

and

$ tests/regression/test.py
--csound-executable=obj-s390x-linux-gnu/csound
--source-dir=tests/regression/
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd 2>
csound_test_output.txt
[FAIL] - Test 7:   (bugl.csd)
       Return Code: 4  Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugn.csd 2>
csound_test_output.txt
[FAIL] - Test 9: named instruments (bugn.csd)
       Return Code: 1  Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugaa.csd 2>
csound_test_output.txt
[FAIL] - Test 19: arate array arithmetic (bugaa.csd)
       Return Code: 1  Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugsize.csd 2>
csound_test_output.txt
[FAIL] - Test 36: Showing size change in arrays (bugsize.csd)
       Return Code: 1  Expected: 0
[...]
================================================================================

Tests Passed: 39
Tests Failed: 4

but i think we've come a long way!

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1325329240 You are receiving this because you were mentioned.

Message ID: @.***>

kunstmusik commented 1 year ago

Structs were certainly implemented years ago; that they don't work now means something happened along the way.

+1 on closing the endian issue.

On Wed, Nov 23, 2022 at 12:28 PM John ffitch @.***> wrote:

All the ones i have checked fail on my Linux system x86_64 system. It looks as if structs are no really implemented. In many ways the 4 regression tests failing are more worrying

I think we can close the endian issue and I will clean the tracing

⁣Get TypeApp for Android ​

On 23 Nov 2022, 16:18, at 16:18, "umläute" @.***> wrote:

hooray! no more crashes!

we still get a (smaller) number of failing tests though:

$ tests/commandline/test.py
--csound-executable=obj-s390x-linux-gnu/csound
--source-dir=tests/commandline/
[...]
Tests Passed: 102
Tests Failed: 3

[FAILED TESTS]

[FAIL] - Test 98: basic struct test (structs/test_structs.csd)
Return Code: 1 Expected: 0
[FAIL] - Test 99: read/write to struct member of struct
(structs/test_sub_structs.csd)
Return Code: 1 Expected: 0
[FAIL] - Test 100: arrays of structs (structs/test_struct_arrays.csd)
Return Code: 1 Expected: 0

and

$ tests/regression/test.py
--csound-executable=obj-s390x-linux-gnu/csound
--source-dir=tests/regression/
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugl.csd 2>
csound_test_output.txt
[FAIL] - Test 7: (bugl.csd)
Return Code: 4 Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugn.csd 2>
csound_test_output.txt
[FAIL] - Test 9: named instruments (bugn.csd)
Return Code: 1 Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugaa.csd 2>
csound_test_output.txt
[FAIL] - Test 19: arate array arithmetic (bugaa.csd)
Return Code: 1 Expected: 0
[...]
obj-s390x-linux-gnu/csound -Wd -n tests/regression//bugsize.csd 2>
csound_test_output.txt
[FAIL] - Test 36: Showing size change in arrays (bugsize.csd)
Return Code: 1 Expected: 0
[...]

================================================================================

Tests Passed: 39
Tests Failed: 4

but i think we've come a long way!

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1325329240 You are receiving this because you were mentioned.

Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/csound/csound/issues/1650#issuecomment-1325426262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMA65AVSF6Y7VOVI7RU73WJZH2DANCNFSM6AAAAAARUZ6O2M . You are receiving this because you were mentioned.Message ID: @.***>

vlazzarini commented 1 year ago

@kunstmusik afaik all tests were passing when I merged 7.0 into develop earlier in the year, so any issues are probably more recent.

We can close this and apply the fixes to csound6 so I can prepare a release.

jpffitch commented 1 year ago

I checked.regression tests all pass in csound6

⁣Get TypeApp for Android ​

On 23 Nov 2022, 19:13, at 19:13, vlazzarini @.***> wrote:

@kunstmusik afaik all tests were passing when I merged 7.0 into develop earlier in the year, so any issues are more recent.

We can close this and apply the fixes to csound6 so I can prepare a release.

-- Reply to this email directly or view it on GitHub: https://github.com/csound/csound/issues/1650#issuecomment-1325544460 You are receiving this because you were mentioned.

Message ID: @.***>

umlaeute commented 1 year ago

indeed! the csound6 branch looks much better than the develop branch.

also, I finally noticed that i forgot to set the OPCODE6DIR64 envvar (as i was running the tests from out-of-tree builds). Setting it, finally makes that fat

WARNING: Error opening plugin directory '/usr/lib/s390x-linux-gnu/csound/plugins64-7.0': No such file or directory

warning go away, and also find more opcodes.

and with that, i can finally report that both tests/regression/ and tests/commandline/ have no failures and all tests succeed :tada: