Kara-Moon Forum
March 29, 2024, 03:39:17 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Can't use MMA anymore (Xubuntu)  (Read 6728 times)
Piteur
Jr. Member
*
Posts: 13



« on: April 22, 2020, 10:15:24 PM »

Hi!

I'm completely new with MMA. I installed version 20.02 one month ago on my Xubuntu system; I tested it very quickly: writing a small file listing chords etc, generating the corresponding MIDI file, listening to it with Midi Editor.

I tried to reuse MMA today, but without success, even by submitting the old file previously used.

I have no idea what's wrong.

Description :

Last test with a very small file (name: essai00) containing this:

 Tempo 120
 Groove Rhumba
 1 F
 2 F
 3 C7
 4 F
 5 F
 6 F
 7 C7
 8 F
 9 Gm
 10 F
 11 C7
 12 F
 13 Gm
 14 F
 15 C7
 16 F /

In the terminal, I write, being of course in the folder containing the file:

   
Code:
mma essai00

Then, in the terminal, I read a very very long list of that (I only give you the end) :

  File "/usr/share/mma/MMA/parse.py", line 91, in parseFile
     parse(f)
   File "/usr/share/mma/MMA/parse.py", line 161, in parse
     simpleFuncs[action](l[1:])
   File "/usr/share/mma/MMA/parse.py", line 576, in include
     parseFile(fn)
   File "/usr/share/mma/MMA/parse.py", line 89, in parseFile
     f = MMA.file.ReadFile(n)
   File "/usr/share/mma/MMA/file.py", line 249, in __init__
     fdata.append(dataStore(lcount, l, label))
 RuntimeError: maximum recursion depth exceeded while calling a Python object


No MIDI file is generated.

Am I forgetting something?

I feel like an idiot and I apologize for that. And forgive me for asking such a basic question...  Undecided

Can you give me some help, please?

Thank you very much.  Smiley
Logged

Xubuntu 18.04 LTS
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #1 on: April 22, 2020, 11:12:22 PM »

No, you are not an idiot. If it doesn't work, it doesn't work and I thank you for reporting it.

Let's figure out the problem...

1. What version of python are you using? From a terminal the command:

  python --version

will tell us that.  Not that this helps you, but I just tried it with both python3 and 2 and your file works fine.

2. Can you rebuild your database. Please try:

   mma -g

and if that doesn't solve the problem:

   mma -G

you may need to be root for the -G.

You're sure you are processing the file you think you are? Try this:

3. mma essai00.mma

MMA should be finding the correct file, but ... it's worth a thought.

4. Copy the CONTENTS of the file to a new file with a unique filename (maybe something like mynewfile.mma) and try that.

5. Run MMA in various debug modes and see how far it is getting in your file. I'd start off using -e and -r. Then use -d ... anything show up?

Hope all this is getting closer the problem.
Logged

My online life: http://www.mellowood.ca
Piteur
Jr. Member
*
Posts: 13



« Reply #2 on: April 23, 2020, 11:29:24 AM »

Thank you for your answer, so quick!

I'll try to follow it up as best as I can.

No, you are not an idiot. If it doesn't work, it doesn't work and I thank you for reporting it.

Whew!

Let's figure out the problem...

1. What version of python are you using? From a terminal the command:

  python --version

will tell us that.  Not that this helps you, but I just tried it with both python3 and 2 and your file works fine.


piteur@MATERIEL-LX:~$ python --version
Python 2.7.17


2. Can you rebuild your database. Please try:

   mma -g

It doesn't work: I have the same display of the long list of errors mentioned above (last line: RuntimeError: maximum recursion depth exceeded).

and if that doesn't solve the problem:

   mma -G

you may need to be root for the -G.

Same effect!


You're sure you are processing the file you think you are? Try this:

3. mma essai00.mma

MMA should be finding the correct file, but ... it's worth a thought.

Done! Same effect!


4. Copy the CONTENTS of the file to a new file with a unique filename (maybe something like mynewfile.mma) and try that.

Done : file mynewfile.mma ; same effect!


5. Run MMA in various debug modes and see how far it is getting in your file. I'd start off using -e and -r. Then use -d ... anything show up?

I'm sorry, I didn't quite understand. I tried that:

mma -e  mynewfile.mma —> same effect
mma -r mynewfile.mma —> same effect
mma -d  mynewfile.mma —> same effect

Hope all this is getting closer the problem.

I'm very sorry, I'm afraid not.  Huh

Don't you think, finally, that we should look for something on the side of Python (I've noticed many updates lately, concerning parts of Python); no doubt you know a way to test the integrity of Python…

With my sincere thanks,  Smiley
Logged

Xubuntu 18.04 LTS
Piteur
Jr. Member
*
Posts: 13



« Reply #3 on: April 23, 2020, 12:15:29 PM »

Just one more thing (I didn't understand how to edit my last post, sorry):

piteur@MATERIEL-LX:~$ apt-cache policy python
python:
  Installé : 2.7.15~rc1-1

  Candidat : 2.7.15~rc1-1
 Table de version :
 *** 2.7.15~rc1-1 500
        500 http://fr.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
piteur@MATERIEL-LX:~$ apt-cache policy python3
python3:
  Installé : 3.6.7-1~18.04

  Candidat : 3.6.7-1~18.04
 Table de version :
 *** 3.6.7-1~18.04 500
        500 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.6.5-3 500
        500 http://fr.archive.ubuntu.com/ubuntu bionic/main amd64 Packages


Logged

Xubuntu 18.04 LTS
sciurius
Sr. Member
****
Posts: 443



« Reply #4 on: April 23, 2020, 02:23:57 PM »

Do you have a ~/.mmac file? If so, remove it and try again.
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #5 on: April 23, 2020, 04:31:23 PM »

Any of the rc file candidates might be an issue: mmarc (in current dir), /usr/etc/local/mmarc or /etc/mmarc.

Checking rc files is a good call since this is done before entering the -g/-G parts.

Next suggestion? Maybe resinstall mma after ensuring the current program code is purged.
Logged

My online life: http://www.mellowood.ca
Piteur
Jr. Member
*
Posts: 13



« Reply #6 on: April 24, 2020, 10:22:20 AM »

Do you have a ~/.mmac file? If so, remove it and try again.

.mmac file? I don't, according to Catfish.

Any of the rc file candidates might be an issue: mmarc (in current dir), /usr/etc/local/mmarc or /etc/mmarc.
I found /usr/local/etc/mmarc

I deleted it. So, big change. Look:

piteur@MATERIEL-LX:~/Documents/MIDI FILES$ mma ESSAI_00.mma
Warning: <Line 2> <File:ESSAI_00.mma> There appears to be an error in the
    database.   Directory '/home/bob/src/bv/mma/lib/stdlib' cannot be found.
    Please try to execute the command 'mma -G' as root.
Warning: <Line 2> <File:ESSAI_00.mma> There appears to be an error in the
    database.   Directory '/home/bob/src/bv/mma/lib/casio' cannot be found.
    Please try to execute the command 'mma -G' as root.
Warning: <Line 2> <File:ESSAI_00.mma> There appears to be an error in the
    database.   Directory '/home/bob/src/bv/mma/lib/pflib' cannot be found.
    Please try to execute the command 'mma -G' as root.
Warning: <Line 2> <File:ESSAI_00.mma> There appears to be an error in the
    database.   Directory '/home/bob/src/bv/mma/lib/kara' cannot be found.
    Please try to execute the command 'mma -G' as root.
Warning: <Line 2> <File:ESSAI_00.mma> There appears to be an error in the
    database.   Directory '/home/bob/src/bv/mma/lib/alexis' cannot be found.
    Please try to execute the command 'mma -G' as root.
Warning: <Line 2> <File:ESSAI_00.mma> There appears to be an error in the
    database.   Directory '/home/bob/src/bv/mma/lib/yamaha' cannot be found.
    Please try to execute the command 'mma -G' as root.
Error: <Line 2> <File:ESSAI_00.mma> Unable to locate library file
    '/home/bob/src/bv/mma/lib/stdlib/rhumba.mma'

So, I've done:
sudo mma -G

And mma ESSAI_00.mma results again in a file ESSAI_00.mid !!! (correct midi file, after checking)

Next suggestion? Maybe resinstall mma after ensuring the current program code is purged.

Given what I've just reported, I suppose there's no point in doing:
sudo apt-get purge mma

Thanks a lot!
« Last Edit: April 24, 2020, 10:26:09 AM by Piteur » Logged

Xubuntu 18.04 LTS
sciurius
Sr. Member
****
Posts: 443



« Reply #7 on: April 24, 2020, 11:52:07 AM »

Someone should contact the packager. An initial "mma -G" (as root) must be part (last step) of the install.
Logged
Piteur
Jr. Member
*
Posts: 13



« Reply #8 on: April 24, 2020, 12:08:11 PM »

Someone should contact the packager. An initial "mma -G" (as root) must be part (last step) of the install.

Funny! Why didn't I need it a month ago, when I first installed mmaTongue (Fortunately by the way; otherwise I wouldn't have gone any further !!!)
Logged

Xubuntu 18.04 LTS
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #9 on: April 24, 2020, 04:38:19 PM »

If you still have it, I would love to see the contents of the mmarc file you deleted was.
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #10 on: April 25, 2020, 01:44:15 AM »

I should add that I suspect that somehow someone or something modified /usr/local/etc/mmarc to make it into an endless loop. My simple proof is the simple file test.mma:

Code:
Include test.mma

And it generates the same error as the OP initially reported. Perhaps we should have a max-include test somewhere?
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #11 on: April 26, 2020, 08:02:25 AM »

If that would open the possibility to show what files are included and die gracefully, yes that would be nice.

OTOH mma -o test.mma already clearly shows the includes flying by.
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #12 on: April 26, 2020, 04:09:29 PM »

Python limits recursion to about 1000 iterations. So, for the OP, there were just shy of this open() calls.

I think we should limit the number of open files to about 50. And, if an attempt is made to open more than that an error message including the last file name will be printed. Any other comments on this?
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #13 on: April 26, 2020, 06:18:43 PM »

I think the attached patch will solve the recursion problem. If just tracks the number of levels in parseFile().

* patch.txt (1.24 KB - downloaded 177 times.)
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #14 on: April 26, 2020, 06:28:12 PM »

The parseStack counter looks okay (I assume you've tested it).

But the second part of the patch, adding includeCount and not using it?
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.056 seconds with 19 queries.