Ted2 won't run on Gnome (Archlinux)

About Monkey 2 Forums Monkey 2 Programming Help Ted2 won't run on Gnome (Archlinux)

Tagged: , ,

This topic contains 37 replies, has 4 voices, and was last updated by  dawlane 2 years, 6 months ago.

Viewing 15 posts - 16 through 30 (of 38 total)
  • Author
    Posts
  • #4346

    arpie
    Participant

    So I went with my hunch from earlier and added a line to the empty New() method of class Style in mojo/style.monkey2 :

    And reran it through the debugger.  The good news is I now get a window shown on screen (previously I got nothing at all).  The bad news is the window is black and empty and there is a new segfault :

    Any thoughts?  I’m feeling quite out of my depth but willing to try anything to help…

    #4347

    Mark Sibly
    Keymaster

    Can you enter ‘bt’ into gdb after the crash for a backtrace?

    #4348

    arpie
    Participant

    Okay, I’m muddling on, hopefully in a vaguely useful direction.  It seems that the above issue is related to line 170 of mojox/filebrowser.monkey2 and is entirely due to the variable children being null.  If I change line 170 from :

    to

    then the segfault goes away.  But I suspect we need to address the reason why children is null and this is just a fudge.  But, guess what, new segfault…!

    #4349

    arpie
    Participant

    Hello Mark.  Do you want to see a backtrace of each of the segfaults I’ve mentioned so far?  I can see this thread quickly getting messy if I try to retrace my steps with backtraces.  Shall I start with a backtrace of the original segfault before I altered any mojo code?  Are my further experiments any use to you?

    #4350

    arpie
    Participant

    Here is a backtrace of the original segfault, with none of my edits to the mojo code :

    @Mark: I will await further instructions from you before doing anything else!

    #4351

    Mark Sibly
    Keymaster

    Can you try rebuilding all using ‘-O2’ optimizations instead of ‘-O3’? If it still fails, try ‘-O1’.

    Are your OS, compilers etc up to date?

    #4352

    arpie
    Participant

    is the field declaration sufficient to allocate memory for an empty array?

    Yes, a ‘null’ array in mx2 is really just an array of length 0, ditto strings.

    Does that mean that

    is equivalent to

    ?

    #4353

    Mark Sibly
    Keymaster

    Also, can you email me the crashing version of ted2, ie: the ‘bin/ted2_linux/ted2’ file?

    Argh, you probably can’t ‘coz I’m on gmail – can you stick it somewhere I can download it?

    #4354

    arpie
    Participant

    Yes, OS and compilers are bang up to date.  I came across the same issue with Ted2 when I tried a few months back but didn’t have the time to look into it then, and I’ve updated the OS at least twice since then, so that’s unlikely to be the cause.

    Rebuilding with ‘-O2’ produced identical results to ‘-O3’.

    Using ‘-O1’ still segfaults but differently :

    #4355

    Mark Sibly
    Keymaster

    Probably not much more I can do until I can reproduce it.

    That’s the bummer about linux – it’s like supporting 10 OS’s at once!

    is equivalent to

    yep, these are all effectively the same:

    Local t:Int[]
    Local t:Int[]=New Int[0]
    Local t:Int[]=null

    #4357

    arpie
    Participant

    Just to be sure, I tried building with ‘-O0’ and it runs as expected and appears fully functional.  I guess that will have to do as a fix for now.

    I have just uploaded the crashing binary (with build flag -O1) here :

    http://www.arpie.co.uk/monkey/ted2

    If you’d like me to send you a binary with -O3 too, just ask.

    Or anything else I can do that might be helpful, just ask (russell (at) arpie.co.uk).

    It has gone midnight here so I’m off to bed.  Thanks again for looking into this – I know this is the sort of bug that is a pita to track down.

    On a side note, another of Linux’s quirks annoys me every time I do a fresh Monkey install.  All the *.sh files in /scripts, and the binary /bin/mx2cc all require the exec flag setting before I can run them(chmod a+x …).  It’s easy enough to do, but I presume you could do it at your end to save me having to do it every time?  Would you like me to make it a pull request on github (it’s about time I learnt how to)?

    #4358

    Mark Sibly
    Keymaster

    Actually, I think I may have a clue what’s going on here – thanks for exe it should prove helpful.

    #4359

    arpie
    Participant

    You probably suspected as much but all bananas appear show the same behaviour.  That is, all the ones I tried : vpaint, monkeyroids, mojotest, glwindowtest.

    In debug mode they run fine but in release mode they crash immediately with a memory access violation.

    I’m really off to bed now!

    Good luck.

    #4364

    dawlane
    Participant

    Works in debug, but not release. Sound very much like BlitzMax under Linux with the later versions of GCC greater than 4.8.4. If I remember ArchLinux is a rolling release and would be using GCC 6.1.

    @Mark: I would look at installing Manjaro as it’s based off ArchLinux and a hell of a lot simpler to setup, but still a pain when it comes to updates breaking the system.

    If you don’t already know to see what optimisation are enabled by the -Ox switch use (x being the switch number:

    to isolate individual optimisations use

    Due to how mx2cc works, passing the -S option as part off the GCC command line to stop generation at the assembly stage will not work. You have to use objdump on a binary with symbols not stripped.

    On a side note, another of Linux’s quirks annoys me every time I do a fresh Monkey install. All the *.sh files in /scripts, and the binary /bin/mx2cc all require the exec flag setting before I can run them(chmod a+x …).

    If you download it as zip archive; then execute permissions are not saved. The same should be for cloning off of git.

    Me being me. All I did was write a script to do the dirty work.

    if [ -f master.zip ]; then rm -r master.zip; fi
    if [ -d monkey2 ]; then rm -rf monkey2; fi

    wget -q https://github.com/blitz-research/monkey2/archive/master.zip
    unzip master.zip
    mv monkey2-master monkey2
    SCRIPT_DIR=”$( cd “$( dirname “$0″ )” && pwd )”
    ln -s $HOME/monkeyx/MonkeyX $SCRIPT_DIR/monkey2/devtools/MonkeyXFree86c
    cd monkey2/scripts
    chmod +x *
    ./rebuildall.sh

    #4370

    Mark Sibly
    Keymaster

    I managed to reproduce this by installing/building with gcc-6.

    There’s a quick ‘n’ dirty fix up now at github, let me know if it works!

Viewing 15 posts - 16 through 30 (of 38 total)

You must be logged in to reply to this topic.