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 - 1 through 15 (of 38 total)
  • Author
    Posts
  • #4300

    arpie
    Participant

    Hello,

    It looks like open-al and jack are having trouble but (if you’ll excuse the pun) I don’t know jack.

    I am trying to use monkey2 and Ted2 under Archlinux in Gnome (that means Pulseaudio is running and afaik that doesn’t play nice with jack?)

    Why does Ted2 require jack support, anyway?  Surely open-al can directly use Pulseaudio?  Anyway, I’ll stop speculating and paste some error messages…

    I have just cloned the monkey2 git repo and ran ./rebuildall.sh then tried to run the Monkey2 (Linux) binary.  It does nothing (no errors, nothing, even on command line).  I then tried running bin/ted2_linux/ted2 and get the following output :

    So I installed and ran ‘qjackctl’ which allowed me to start a jack server.  With a running jack server, I tried again :

    Any suggestions greatly appreciated !

    Russell

    #4303

    Simon Armstrong
    Participant

    I think monkey2 on Linux uses OpenAL configured as it finds it so you probably want to start with some plain openal tests.

    According to this page OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so:

    #4304

    arpie
    Participant

    Thanks a lot Simon, that made the jack errors go away.  I am now left with :

    I have no idea what is causing that memory access violation.

    Any other ideas?  How can I go about running Ted2 with some extra debugging output turned on?

    Russell

    #4305

    arpie
    Participant

    Curiouser and curiouser…

    I have managed to do a debug build of ted2 (by setting -config=debug in /scripts/rebuildted2.sh) and, well, it runs perfectly.

    The release version crashes immediately (no window, nothing) but the debug build runs and is perfectly useable.  Here’s some console output :

    I can live with using the debug build for now but it would be nice to have it working as it should with the release build.  Any suggestions what to try next?

    Regards,

    Russell

    #4307

    Simon Armstrong
    Participant

    It looks like there are two issues there for maybe Mark to take a look at.

    1. audio.monkey2 calls alcOpenDevice but there is no matching CloseDevice to be found

    2. the zenity system monkey2 uses for requesters may have issues, the thread here suggests an environment variable can fix it

    #4311

    arpie
    Participant

    I guess both those things would be good to get fixed but neither seem linked to the ‘memory address violation’ that causes a crash with the release build, but which doesn’t occur with a debug build.  Gtk is notorious for dumping warnings to the console even though the UI behaves normally so you shouldn’t pay much attention to those gtk messages.  Also, the alc_cleanup error occurs when ted2 exits so is not a major issue.  It’s the ‘memory access violation’ that needs the attention of somebody cleverer than me.

    #4315

    Simon Armstrong
    Participant

    The zenity issue has been a deal breaker for others causing complete crash.

    Your crash probably needs a release with debug symbols style build so gdb can be used to backtrace the cause.

    #4316

    Mark Sibly
    Keymaster

    I think monkey2 on Linux uses OpenAL configured

    mx2 uses the distro version of openal on linux.

    I have no idea what is causing that memory access violation.

    Works fine here, but I just tried to valgrind it and it crashed valgrind with an internal error. It did get as far as opening a window and printing SDL_GOT_FOCUS. Is this where it crashes for you?

    Next thing I’d suggest trying is adding symbols to release mode via the -g flag  (in bin/env_linux.txt), eg:

    You’ll need to rebuild all modules and ted2 after changing this file.

    You should then be able to debug it with gdb:

    If that fixes it, you’re boned.

    If not and you still can’t see where the problem is, try removing ‘-DNDEBUG’ and/or reducing ‘-O’ level until it’s the same as debug, ie: 0.

    #4317

    Simon Armstrong
    Participant

    If valgrind doesn’t reveal the issue Address Sanitizer might.

    We have been using it at work and typically involves using recent gcc (or clang) and -fsanitize=address flag for both compile and link.

    It will slow down your program 2x (not as bad as valgrind) but manages to trap most bad memory operations.

    #4320

    Mark Sibly
    Keymaster

    Ok, gave address sanitizer a go, using “-g -fsanitize=address” for compile/link.

    Ted2 starts and runs fine with this, but locks up HARD for about a minute at exit before print ing’killed’ and fnally ending.

    Should the sanitizer thing be showing some output?

    #4327

    dawlane
    Participant

    @Mark: You will only see output if there are errors with -fsanitize. If, anything. I would be looking at why Jack is a requirement. That to me would seem to be the problem.

    You have to be a hard core Linux user to be able to set the Arch Linux distribution up correctly.

    #4330

    Simon Armstrong
    Participant

    A few thoughts (sorry not set up to actually help atm).

    1. I’m not sure sanitize will work on a vm, the way I understand it, it severely abuses the PMMU to do it’s thing
    2. I’m not sure a monkey2 app can be trusted to close down corrctly on linux without cleaning up the audio context and closing the device correctly
    3. the killed scenario and valgrind issues sounds to me like there is something amiss… (will look into it on my work machine on monday)
    4. both valgrind and asan may not be compatible / usable with monkey2 fibers
    #4343

    arpie
    Participant

    @Mark: many thanks for taking a look at this, I know your time is precious and I suspect you probably don’t have many other Archlinux users using Monkey!

    I had a play yesterday with adding copious amounts of Print() statements to the source files (I’ve never been keen on debuggers) and narrowed down the issue to the Style class of mojo, specifically if I comment out the line :

    in function Init() of class Style, then I no longer get a crash.

    Admittedly, I just get a blank window so there is more to it, but the memory issue seems to be related to the use of the _icons:Image[] field.  I’m rusty on how to initialise arrays in monkey… is the field declaration sufficient to allocate memory for an empty array?  Or does it need a _icons = New Array() or some such somewhere?

    As for Jack, that was a red herring.  Since configuring OpenAl to use PulseAudio, this no longer seems to be relevant.  I have never needed or used jack so my installation is almost certainly borked.  I’ve never needed OpenAl until now, either.

    I will try the -g flag now and see what it turns up.

    #4344

    arpie
    Participant

    So I tried the -g flag as instructed by Mark.  It crashed close to where I suspected the problem to be but I’m now baffled.  Does this mean anything to you guys?  Like I said earlier, debuggers and me don’t get on.

    I tracked down line 167 of the cpp source file but can’t see any reason why that line would cause an issue… then again it has been a long time since I wrote much c++.

    #4345

    Mark Sibly
    Keymaster

    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.

    Had a quick look at the code and it seems OK, so this may just be a symptom, not the cause. And if code *was* trying to read from an empty array, all hell should break loose on all platforms!

Viewing 15 posts - 1 through 15 (of 38 total)

You must be logged in to reply to this topic.