mx2cc crashing because of print command. Am i doing something stupid or?

About Monkey 2 Forums Monkey 2 Programming Help mx2cc crashing because of print command. Am i doing something stupid or?

This topic contains 9 replies, has 3 voices, and was last updated by  Matthew Smith 3 years, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #944

    wiebow
    Participant

    This code makes mx2cc v0.009 crash. It happens because I added the line:ย print string(e._instance)

     

     

    #945

    wiebow
    Participant

    Oh, this is where mx2cc keeps hanging:

    Running command: ‘/home/wiebo/Monkey2/bin/mx2cc_linux makeapp -run -clean -target=desktop -config=debug bd.monkey2’
    MX2CC V0.009

    ***** Building app ‘/home/wiebo/Monkey2/mystuff/boulderdash/bd.monkey2’ *****

    Parsing…
    Semanting…

     

    #946

    wiebow
    Participant

    More info. When I kill the mx2cc process (it is using 100% CPU) , I get this output:

    FAILURE: Build failed with an exception.

    * Where:
    Build file ‘/home/wiebo/Monkey2/mystuff/boulderdash/build.gradle’ line: 16

    * What went wrong:
    Execution failed for task ‘:build_project_debug’.
    > Build project failed with exit code: 137

    * Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

    BUILD FAILED

    #947

    Mark Sibly
    Keymaster

    Nasty compiler bug!

    Will fix, but String( e._instance ) will fail anyway as you can’t convert an object to a string.

     

     

    #948

    Mark Sibly
    Keymaster

    Also, the Exception class has been removed from the monkey module in the latest update, mainly because it can be done in ‘pure’ monkey so doesn’t need to be in the ‘core’ module.

    I could add this back to ‘std’ but it doesn’t really do much, basically just stores the ‘msg:String’ ctor param in a field.

     

     

     

     

    #971

    wiebow
    Participant

    A bug! OK. I was just playing around, trying to see which variations of a singleton I could create.

    I think I need a new pull from the repository, because here Exception is still documented as being in monkey module.

    #980

    Matthew Smith
    Participant

    Wiebo,

    When your initialising your Singleton your also not storing your initialised instance:

    should be

    So in this instance the object may be Null anyway causing the exception.

    #982

    Mark Sibly
    Keymaster

    > When your initialising your Singleton your also not storing your initialised instance:

    Actually, he is…

     

    #984

    wiebow
    Participant

    The New() method sets the _instance field.

    But don’t look at this code as production code ๐Ÿ™‚ It’s me fooling around and causing crashes.

    Good to see you here, btw, Matthew ๐Ÿ™‚

    #997

    Matthew Smith
    Participant

    Woops! Too much c# for me ATM! Trying to find some time to have a play – work and family a bit busy currently!

    Great to see you too buddy! Hope all well in your part of the world! ๐Ÿ™‚

     

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.