enigma-dev / enigma-dev

The Extensible Non-Interpreted Game Maker Augmentation.
http://enigma-dev.org
342 stars 117 forks source link

LGM crashes on startup #944

Closed gandalf3 closed 7 years ago

gandalf3 commented 9 years ago

I installed LGM + enigma from my AUR package here. It used to work fine, but now LGM crashes right after starting (the splash goes away and a window briefly appears):

Java Version: 10700 (1.7.0_79)
Loading lib files in /opt/enigma-dev-git/lateralgm.jar
01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl 
05_score.lgl 06_extra.lgl 07_draw.lgl 
Calling `make eTCpath=""`
> make -j 3 -C CompilerSource 
> make[1]: Entering directory '/opt/enigma-dev-git/CompilerSource'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory '/opt/enigma-dev-git/CompilerSource'
0
Process terminated
Initializing Enigma: 
Failed to create make directory at /home/gandalf3/.enigma/
Make directory is: "/home/gandalf3/.enigma/"
Linking up to IDE
Implementing JDI basics
UnimplementedUnimplemented

Choosing language: C++
Reading GCC builtins
Read key `defines` as `cpp -dM -x c++ -E $blank`
Parsed `cpp` `-dM -x c++ -E "/home/gandalf3/.enigma/enigma_blank.txt"`: redirect=yes
TRUE

*********** EXECUTE 
`/usr/bin/cpp`
`-dM`
`-x`
`c++`
`-E`
`/home/gandalf3/.enigma/enigma_blank.txt`

Call succeeded
Read key `searchdirs` as `gcc -E -x c++ -v $blank`
Parsed `gcc` `-E -x c++ -v "/home/gandalf3/.enigma/enigma_blank.txt"`: redirect=yes
TRUE

*********** EXECUTE 
`/usr/bin/gcc`
`-E`
`-x`
`c++`
`-v`
`/home/gandalf3/.enigma/enigma_blank.txt`

Call succeeded
Searching for directories between "#include <...> search starts here:" and "End of search list."
Toolchain returned 9 search directories:
Creating parse context
Parsing settings...
TOINT: 0
TOINT: 0
TOINT: 1
TOINT: 0
TOINT: 0
TOINT: 0
Setting up IDE editables... 
java: symbol lookup error: /opt/enigma-dev-git/libcompileEGMf.so: undefined symbol: _Z2fcPKc

I've tried running it with java 8, but the same thing happens.

TheExDeus commented 9 years ago

Where is the LGM downloaded from? Does the AUR only gets the ENIGMA? Where is the ENIGMA got from? If ENIGMA is not downloaded from the GIT, then it is possible that the LGM (which might be downloaded with the install.py) won't be compatible.

gandalf3 commented 9 years ago

The package script pulls enigma from git, then runs the included install.py to get LGM.

TheExDeus commented 9 years ago

Well that is weird then. Can you try deleting libcompileEGMf.so:, go to enigma-dev-git and call "make"? It is possible that the .so is compiled with something incompatible with Java JNA. Is Java 64bit or 32bit? It should be 32bit. Did you install the dependencies like shown here: http://enigma-dev.org/docs/Wiki/Install:Linux ? And did it work before? Because it is hard to tell what has changed. ENIGMA size there hasn't been a commit in the master repo since 6th april. LGM hasn't had any commits even longer.

gandalf3 commented 9 years ago

When I last tested it as working was before april.. It looks like the script gets all the dependencies as far as I can tell. Have they changed recently?

Java is 64 bit. Is 32 bit java a newish requirement? I'll try using 32 bit java and report back. Thanks for your help :)

TheExDeus commented 9 years ago

They shouldn't have really changed recently. LGM hasn't been changed since January and ENIGMA doesn't have any changes that would break anything since January as well.

LGM (or more precisely the plugin) only supports 32bit Java, and that has always been a requirement. But you can use both, just look here http://enigma-dev.org/docs/Wiki/Install:Parallel_Java and http://enigma-dev.org/docs/Wiki/Troubleshoot. I'm not sure this is a Java issue though. Can you try recompiling the .so? Try deleting libcompileEGMf.so:, go to enigma-dev-git and call "make".

gandalf3 commented 9 years ago

The package script calls make when it is run, as the .so doesn't exist when cloned from the git repo. Manually recompiling the .so after running the script doesn't affect the crash.

gandalf3 commented 9 years ago

I tried using an arbitrary old version (0836b09baa06d0df49c47118e10e00b48da55c92), and it worked without crashing. I'll see if I can find what commit introduced the crash.

TheExDeus commented 9 years ago

Bizarre. It would greatly help if you could figure out which commit did it, because I sadly cannot replicate it. Some of the commits which could do it are 6d3b018 or 1ad56ef, as they touch the parser (i.e. the .so file). Not many commits do that.

gandalf3 commented 9 years ago

Looks like it probably is an issue in the package script after all, as it works with latest master if clone and compile manually. I can't see any difference between what I'm doing and the package script though..

Okay, this makes no sense at all. Now it's not crashing anymore, but I didn't change anything.. ... And now it's crashing sometimes. I'll have to investigate more.

TheExDeus commented 9 years ago

That sounds like a plugin/LGM issue, because it is very unstable. The whole thing breaks at random points in time. I hope that by the end of this month at least one of the Java dev's will be back. egofree was talking about looking into LGM at some point.

EnigmaBot commented 9 years ago

(Posted by egofree on the ENIGMA forums)

TheExdeus: I am busy til end of July, and then i will work on LateralGM.

NeoTheFox commented 9 years ago
Call succeeded
Searching for directories between "#include <...> search starts here:" and "End of search list."
Toolchain returned 9 search directories:
Creating parse context
Parsing settings...
TOINT: 0
TOINT: 0
TOINT: 1
TOINT: 0
TOINT: 0
TOINT: 0
Setting up IDE editables... 
java: symbol lookup error: /opt/enigma-dev-git/libcompileEGMf.so: undefined symbol: _Z2fcPKc

Still happens for AUR package

faissaloo commented 9 years ago

Are you making sure to cd to the folder that lgm is in before starting it?

NeoTheFox commented 9 years ago

This is not related to directory, since the error is clearly in the .so file. It can locate it, it just something wrong with this file.

gandalf3 commented 9 years ago

@faissaloo Yes, I included a small startup script which cd's to the directory containing lgm before running it.

TheExDeus commented 9 years ago

faissaloo can run ENIGMA under Linux apparently, so it is maybe something to do with the AUR package being out of date? Something is wrong, but as I don't have Linux I cannot test. One of these days I will have to install it in dual boot. I tried ENIGMA in VM and it didn't work because the virtual driver didn't support OpenGL.

faissaloo commented 9 years ago

Can't you just try building it from source instead of using the AUR?

blurymind commented 9 years ago

i get the same error. renders the software useless

TheExDeus commented 9 years ago

blurymind: How did you do run it? Because we sadly cannot fix a problem we cannot replicate. The undefined symbol one in 99% of cases means something is out of date, but it seems we cannot be sure if the user updated.

RobertBColton commented 8 years ago

Just to double check, was this with a 64 bit Java? Just to make sure people are aware, the JNA we have in the default package is 32 bit. It should be easy to make 64 bit work on Linux but I never could finish it for Windows.

gandalf3 commented 8 years ago

Tested using 32bit java, and now lateralgm no longer crashes. However I get an error about being unable to find libcompileEGMf.so:

java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])

libcompileEGMf.so is in the install directory (/opt/enigma-dev-git/libcompileEGMf.so). I tried adding /opt/enigma-dev-git/ to the $PATH, however that didn't do anything.

RobertBColton commented 8 years ago

Try deleting libcompileEGMf.so and run again, that way it will rebuild itself. The problem is that it might still be 64 bit which would make it incompatible with JNA. ENIGMA's launching part will detect that and rebuild it. Also, is your GCC 64 bit?

blurymind commented 8 years ago

I installed 32 bit java and I get this error now: Setting up IDE editables... java: symbol lookup error: /opt/enigma-dev-git/libcompileEGMf.so: undefined symbol: _Z2fcPKc

After that it crashes

RobertBColton commented 8 years ago

@blurymind Do the same thing I just suggested, delete libcompileEGMf.so and try again, it will rebuild it as 32 bit then, or should.

blurymind commented 8 years ago

I did and still get the same old error. Here is the output:

[tai@tai enigma-dev-git]$ make make -j 3 -C CompilerSource make[1]: Entering directory '/opt/enigma-dev-git/CompilerSource' g++ -shared -o ../libcompileEGMf.so .eobjs/./parser/object_storage.o .eobjs/./parser/collect_variables.o .eobjs/./parser/parser.o .eobjs/./parser/parser_components.o .eobjs/./syntax/checkfile.o .eobjs/./syntax/syntax.o .eobjs/./general/darray.o .eobjs/./general/bettersystem.o .eobjs/./general/macro_integration.o .eobjs/./general/string.o .eobjs/./backend/ideprint.o .eobjs/./backend/JavaCallbacks.o .eobjs/./compiler/compile.o .eobjs/./compiler/compile_common.o .eobjs/./compiler/pcs/pcs.o .eobjs/./compiler/components/handle_templates.o .eobjs/./compiler/components/write_event_code.o .eobjs/./compiler/components/module_write_backgrounds.o .eobjs/./compiler/components/write_object_data.o .eobjs/./compiler/components/module_write_sprites.o .eobjs/./compiler/components/parse_and_link.o .eobjs/./compiler/components/write_font_info.o .eobjs/./compiler/components/write_defragged_events.o .eobjs/./compiler/components/write_shader_data.o .eobjs/./compiler/components/module_write_paths.o .eobjs/./compiler/components/module_write_sounds.o .eobjs/./compiler/components/module_write_fonts.o .eobjs/./compiler/components/write_object_access.o .eobjs/./compiler/components/parse_secondary.o .eobjs/./compiler/components/write_globals.o .eobjs/./compiler/components/write_room_data.o .eobjs/./compiler/reshandlers/refont.o .eobjs/./compiler/reshandlers/rectpack.o .eobjs/./compiler/output_locals.o .eobjs/./compiler/event_reader/event_parser.o .eobjs/./compiler/jdi_utility.o .eobjs/./main.o .eobjs/./frontend.o .eobjs/./languages/language_adapter.o .eobjs/./languages/lang_CPP.o .eobjs/./settings-parse/eyaml.o .eobjs/./settings-parse/crawler.o .eobjs/./settings-parse/parse_ide_settings.o .eobjs/./settings.o .eobjs/./filesystem/file_find.o .eobjs/./gcc_interface/gcc_backend.o .eobjs/./JDI/test/debug_lexer.o .eobjs/./JDI/src/API/jdi.o .eobjs/./JDI/src/API/AST_Export.o .eobjs/./JDI/src/API/lexer_interface.o .eobjs/./JDI/src/API/error_reporting.o .eobjs/./JDI/src/API/user_tokens.o .eobjs/./JDI/src/API/AST.o .eobjs/./JDI/src/API/context.o .eobjs/./JDI/src/General/llreader.o .eobjs/./JDI/src/General/debug_macros.o .eobjs/./JDI/src/General/svg_simple.o .eobjs/./JDI/src/General/parse_basics.o .eobjs/./JDI/src/System/macros.o .eobjs/./JDI/src/System/lex_cpp.o .eobjs/./JDI/src/System/token.o .eobjs/./JDI/src/System/lex_buffer.o .eobjs/./JDI/src/System/symbols.o .eobjs/./JDI/src/System/builtins.o .eobjs/./JDI/src/Storage/value_funcs.o .eobjs/./JDI/src/Storage/references.o .eobjs/./JDI/src/Storage/value.o .eobjs/./JDI/src/Storage/definition.o .eobjs/./JDI/src/Storage/full_type.o .eobjs/./JDI/src/Parser/readers/read_expression.o .eobjs/./JDI/src/Parser/readers/read_next_token.o .eobjs/./JDI/src/Parser/readers/read_operatorkw_name.o .eobjs/./JDI/src/Parser/readers/read_type.o .eobjs/./JDI/src/Parser/readers/read_template_parameters.o .eobjs/./JDI/src/Parser/readers/read_qualified_definition.o .eobjs/./JDI/src/Parser/parse_context.o .eobjs/./JDI/src/Parser/handlers/handle_templates.o .eobjs/./JDI/src/Parser/handlers/handle_namespace.o .eobjs/./JDI/src/Parser/handlers/handle_class.o .eobjs/./JDI/src/Parser/handlers/handle_hypothetical.o .eobjs/./JDI/src/Parser/handlers/handle_enum.o .eobjs/./JDI/src/Parser/handlers/handle_declarators.o .eobjs/./JDI/src/Parser/handlers/handle_union.o .eobjs/./JDI/src/Parser/handlers/handle_scope.o .eobjs/./JDI/src/Parser/handlers/handle_function_impl.o .eobjs/./JDI/src/Parser/base.o .eobjs/./makedir.o make[1]: Leaving directory '/opt/enigma-dev-git/CompilerSource' [tai@tai enigma-dev-git]$ lateralgm Java Version: 10800 (1.8.0_65) Loading lib files in /opt/enigma-dev-git/lateralgm.jar 01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl 05_score.lgl 06_extra.lgl 07_draw.lgl Calling make eTCpath=""

make -j 3 -C CompilerSource make[1]: Entering directory '/opt/enigma-dev-git/CompilerSource' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/opt/enigma-dev-git/CompilerSource' 0 Process terminated Initializing Enigma: Failed to create make directory at /home/tai/.enigma/ Make directory is: "/home/tai/.enigma/" Linking up to IDE Implementing JDI basics UnimplementedUnimplemented

Choosing language: C++ Reading GCC builtins Read key defines as cpp -dM -x c++ -E $blank Parsed cpp -dM -x c++ -E "/home/tai/.enigma/enigma_blank.txt": redirect=yes TRUE

*** EXECUTE /usr/bin/cpp -dM -x c++ -E /home/tai/.enigma/enigma_blank.txt

Call succeeded Read key searchdirs as gcc -E -x c++ -v $blank Parsed gcc -E -x c++ -v "/home/tai/.enigma/enigma_blank.txt": redirect=yes TRUE

*** EXECUTE /usr/bin/gcc -E -x c++ -v /home/tai/.enigma/enigma_blank.txt

Call succeeded Searching for directories between "#include <...> search starts here:" and "End of search list." Toolchain returned 9 search directories: Creating parse context Parsing settings... TOINT: 0 TOINT: 0 TOINT: 1 TOINT: 0 TOINT: 0 TOINT: 0 Setting up IDE editables... java: symbol lookup error: /opt/enigma-dev-git/libcompileEGMf.so: undefined symbol: _Z2fcPKc

TheExDeus commented 8 years ago

Type gcc -v and java -version and post it here.

blurymind commented 8 years ago

[tai@tai ~]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /build/gcc-multilib/src/gcc-5.2.0/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --with-default-libstdcxx-abi=gcc4-compatible Thread model: posix gcc version 5.2.0 (GCC)

[tai@tai ~]$ java -version openjdk version "1.8.0_65" OpenJDK Runtime Environment (build 1.8.0_65-b17) OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)

But I also have 32bit java installed. When Installed it with yaout I got: :: archlinux-java32: 32-bit JRE ('java32-8-jre/jre') set as default Java environment.

I even set it and tried running lateralgm: [tai@tai ~]$ whereis java32 java32: /usr/bin/java32 [tai@tai ~]$ export JAVACMD=/usr/bin/java-32/bin/java [tai@tai ~]$ lateralgm .... java: symbol lookup error: /opt/enigma-dev-git/libcompileEGMf.so: undefined symbol: _Z2fcPKc

RobertBColton commented 8 years ago

@blurymind Did you launch the JVM in a special way? "OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)" It is still saying the 64 bit JVM is being used. I believe the flag is -d32 to run the 32 bit JVM explicitly, you can also type the full path to the java program as an alternative.

gandalf3 commented 8 years ago

@blurymind I installed bin32-jre from the AUR and ran java32 -jar lateralgm.jar in order to use it. When I ran it this way, lateralgm did not crash.

@RobertBColton I tried deleting libcompileEGMf.so, but got the same error. Full output:

% java32 -jar lateralgm.jar
Java Version: 10800 (1.8.0_66)
Loading lib files in /opt/enigma-dev-git/lateralgm.jar
01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl 
 05_score.lgl 06_extra.lgl 07_draw.lgl 
Calling `make eTCpath=""`
> make -j 3 -C CompilerSource 
> make[1]: Entering directory '/opt/enigma-dev-git/CompilerSource'
> g++ -shared -o ../libcompileEGMf.so .eobjs/./syntax/checkfile.o .eobjs/./syntax/syntax.o .eobjs/./settings-parse/crawler.o .eobjs/./settings-parse/eyaml.o .eobjs/./settings-parse/parse_ide_settings.o .eobjs/./parser/collect_variables.o .eobjs/./parser/object_storage.o .eobjs/./parser/parser.o .eobjs/./parser/parser_components.o .eobjs/./languages/lang_CPP.o .eobjs/./languages/language_adapter.o .eobjs/./general/bettersystem.o .eobjs/./general/darray.o .eobjs/./general/macro_integration.o .eobjs/./general/string.o .eobjs/./gcc_interface/gcc_backend.o .eobjs/./filesystem/file_find.o .eobjs/./compiler/reshandlers/rectpack.o .eobjs/./compiler/reshandlers/refont.o .eobjs/./compiler/pcs/pcs.o .eobjs/./compiler/event_reader/event_parser.o .eobjs/./compiler/components/handle_templates.o .eobjs/./compiler/components/module_write_backgrounds.o .eobjs/./compiler/components/module_write_fonts.o .eobjs/./compiler/components/module_write_paths.o .eobjs/./compiler/components/module_write_sounds.o .eobjs/./compiler/components/module_write_sprites.o .eobjs/./compiler/components/parse_and_link.o .eobjs/./compiler/components/parse_secondary.o .eobjs/./compiler/components/write_defragged_events.o .eobjs/./compiler/components/write_event_code.o .eobjs/./compiler/components/write_font_info.o .eobjs/./compiler/components/write_globals.o .eobjs/./compiler/components/write_object_access.o .eobjs/./compiler/components/write_object_data.o .eobjs/./compiler/components/write_room_data.o .eobjs/./compiler/components/write_shader_data.o .eobjs/./compiler/compile.o .eobjs/./compiler/compile_common.o .eobjs/./compiler/jdi_utility.o .eobjs/./compiler/output_locals.o .eobjs/./backend/JavaCallbacks.o .eobjs/./backend/ideprint.o .eobjs/./JDI/test/debug_lexer.o .eobjs/./JDI/src/System/builtins.o .eobjs/./JDI/src/System/lex_buffer.o .eobjs/./JDI/src/System/lex_cpp.o .eobjs/./JDI/src/System/macros.o .eobjs/./JDI/src/System/symbols.o .eobjs/./JDI/src/System/token.o .eobjs/./JDI/src/Storage/definition.o .eobjs/./JDI/src/Storage/full_type.o .eobjs/./JDI/src/Storage/references.o .eobjs/./JDI/src/Storage/value.o .eobjs/./JDI/src/Storage/value_funcs.o .eobjs/./JDI/src/Parser/readers/read_expression.o .eobjs/./JDI/src/Parser/readers/read_next_token.o .eobjs/./JDI/src/Parser/readers/read_operatorkw_name.o .eobjs/./JDI/src/Parser/readers/read_qualified_definition.o .eobjs/./JDI/src/Parser/readers/read_template_parameters.o .eobjs/./JDI/src/Parser/readers/read_type.o .eobjs/./JDI/src/Parser/handlers/handle_class.o .eobjs/./JDI/src/Parser/handlers/handle_declarators.o .eobjs/./JDI/src/Parser/handlers/handle_enum.o .eobjs/./JDI/src/Parser/handlers/handle_function_impl.o .eobjs/./JDI/src/Parser/handlers/handle_hypothetical.o .eobjs/./JDI/src/Parser/handlers/handle_namespace.o .eobjs/./JDI/src/Parser/handlers/handle_scope.o .eobjs/./JDI/src/Parser/handlers/handle_templates.o .eobjs/./JDI/src/Parser/handlers/handle_union.o .eobjs/./JDI/src/Parser/base.o .eobjs/./JDI/src/Parser/parse_context.o .eobjs/./JDI/src/General/debug_macros.o .eobjs/./JDI/src/General/llreader.o .eobjs/./JDI/src/General/parse_basics.o .eobjs/./JDI/src/General/svg_simple.o .eobjs/./JDI/src/API/AST.o .eobjs/./JDI/src/API/AST_Export.o .eobjs/./JDI/src/API/context.o .eobjs/./JDI/src/API/error_reporting.o .eobjs/./JDI/src/API/jdi.o .eobjs/./JDI/src/API/lexer_interface.o .eobjs/./JDI/src/API/user_tokens.o .eobjs/./frontend.o .eobjs/./main.o .eobjs/./makedir.o .eobjs/./settings.o 
> /usr/bin/ld: cannot open output file ../libcompileEGMf.so: Permission denied
> collect2: error: ld returned 1 exit status
> Makefile:55: recipe for target '../libcompileEGMf.so' failed
> make[1]: Leaving directory '/opt/enigma-dev-git/CompilerSource'
> make[1]: *** [../libcompileEGMf.so] Error 1
> make: *** [ENIGMA] Error 2
> Makefile:6: recipe for target 'ENIGMA' failed
2
Process terminated
Thread-4: 
java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:412)
        at com.sun.jna.Native.loadLibrary(Native.java:391)
        at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247)
        at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)
java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:412)
        at com.sun.jna.Native.loadLibrary(Native.java:391)
        at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247)
        at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)
RobertBColton commented 8 years ago

Oh this seems to be pretty straighfoward then. "> /usr/bin/ld: cannot open output file ../libcompileEGMf.so: Permission denied" Can you try to start it with sudo/root privileges?

gandalf3 commented 8 years ago

Oh, silly me..

It appears to be able to build and write the file now, but still can't find it:

Java Version: 10800 (1.8.0_66)
Loading lib files in /opt/enigma-dev-git/lateralgm.jar
01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl 
 05_score.lgl 06_extra.lgl 07_draw.lgl 
Calling `make eTCpath=""`
> make -j 3 -C CompilerSource 
> make[1]: Entering directory '/opt/enigma-dev-git/CompilerSource'
> g++ -shared -o ../libcompileEGMf.so .eobjs/./syntax/checkfile.o .eobjs/./syntax/syntax.o .eobjs/./settings-parse/crawler.o .eobjs/./settings-parse/eyaml.o .eobjs/./settings-parse/parse_ide_settings.o .eobjs/./parser/collect_variables.o .eobjs/./parser/object_storage.o .eobjs/./parser/parser.o .eobjs/./parser/parser_components.o .eobjs/./languages/lang_CPP.o .eobjs/./languages/language_adapter.o .eobjs/./general/bettersystem.o .eobjs/./general/darray.o .eobjs/./general/macro_integration.o .eobjs/./general/string.o .eobjs/./gcc_interface/gcc_backend.o .eobjs/./filesystem/file_find.o .eobjs/./compiler/reshandlers/rectpack.o .eobjs/./compiler/reshandlers/refont.o .eobjs/./compiler/pcs/pcs.o .eobjs/./compiler/event_reader/event_parser.o .eobjs/./compiler/components/handle_templates.o .eobjs/./compiler/components/module_write_backgrounds.o .eobjs/./compiler/components/module_write_fonts.o .eobjs/./compiler/components/module_write_paths.o .eobjs/./compiler/components/module_write_sounds.o .eobjs/./compiler/components/module_write_sprites.o .eobjs/./compiler/components/parse_and_link.o .eobjs/./compiler/components/parse_secondary.o .eobjs/./compiler/components/write_defragged_events.o .eobjs/./compiler/components/write_event_code.o .eobjs/./compiler/components/write_font_info.o .eobjs/./compiler/components/write_globals.o .eobjs/./compiler/components/write_object_access.o .eobjs/./compiler/components/write_object_data.o .eobjs/./compiler/components/write_room_data.o .eobjs/./compiler/components/write_shader_data.o .eobjs/./compiler/compile.o .eobjs/./compiler/compile_common.o .eobjs/./compiler/jdi_utility.o .eobjs/./compiler/output_locals.o .eobjs/./backend/JavaCallbacks.o .eobjs/./backend/ideprint.o .eobjs/./JDI/test/debug_lexer.o .eobjs/./JDI/src/System/builtins.o .eobjs/./JDI/src/System/lex_buffer.o .eobjs/./JDI/src/System/lex_cpp.o .eobjs/./JDI/src/System/macros.o .eobjs/./JDI/src/System/symbols.o .eobjs/./JDI/src/System/token.o .eobjs/./JDI/src/Storage/definition.o .eobjs/./JDI/src/Storage/full_type.o .eobjs/./JDI/src/Storage/references.o .eobjs/./JDI/src/Storage/value.o .eobjs/./JDI/src/Storage/value_funcs.o .eobjs/./JDI/src/Parser/readers/read_expression.o .eobjs/./JDI/src/Parser/readers/read_next_token.o .eobjs/./JDI/src/Parser/readers/read_operatorkw_name.o .eobjs/./JDI/src/Parser/readers/read_qualified_definition.o .eobjs/./JDI/src/Parser/readers/read_template_parameters.o .eobjs/./JDI/src/Parser/readers/read_type.o .eobjs/./JDI/src/Parser/handlers/handle_class.o .eobjs/./JDI/src/Parser/handlers/handle_declarators.o .eobjs/./JDI/src/Parser/handlers/handle_enum.o .eobjs/./JDI/src/Parser/handlers/handle_function_impl.o .eobjs/./JDI/src/Parser/handlers/handle_hypothetical.o .eobjs/./JDI/src/Parser/handlers/handle_namespace.o .eobjs/./JDI/src/Parser/handlers/handle_scope.o .eobjs/./JDI/src/Parser/handlers/handle_templates.o .eobjs/./JDI/src/Parser/handlers/handle_union.o .eobjs/./JDI/src/Parser/base.o .eobjs/./JDI/src/Parser/parse_context.o .eobjs/./JDI/src/General/debug_macros.o .eobjs/./JDI/src/General/llreader.o .eobjs/./JDI/src/General/parse_basics.o .eobjs/./JDI/src/General/svg_simple.o .eobjs/./JDI/src/API/AST.o .eobjs/./JDI/src/API/AST_Export.o .eobjs/./JDI/src/API/context.o .eobjs/./JDI/src/API/error_reporting.o .eobjs/./JDI/src/API/jdi.o .eobjs/./JDI/src/API/lexer_interface.o .eobjs/./JDI/src/API/user_tokens.o .eobjs/./frontend.o .eobjs/./main.o .eobjs/./makedir.o .eobjs/./settings.o 
> make[1]: Leaving directory '/opt/enigma-dev-git/CompilerSource'
0
Process terminated
Thread-4: 
java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:412)
        at com.sun.jna.Native.loadLibrary(Native.java:391)
        at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247)
        at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)
java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:412)
        at com.sun.jna.Native.loadLibrary(Native.java:391)
        at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247)
        at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)
RobertBColton commented 8 years ago

Try the steps in this order now.

Sorry if this seems repetitive, but you didn't specify there if you deleted the file before trying sudo, it might still be the old binary.

gandalf3 commented 8 years ago

I did delete the old binary before running with 32 bit java in my above post. If I don't delete, make says "nothing to be done"

Deleting and running with 64 bit java compiles the library and then results in a crash from lateralgm

RobertBColton commented 8 years ago

Ok, can you show me the log when it says there's nothing to be done? Does LGM crash then too?

Also, where is the dll at in the directory structure? Is it next to ([file:/opt/enigma-dev-git/plugins/enigma.jar]) ?

gandalf3 commented 8 years ago

LGM only crashes when attempting to use 64 bit java (thanks for clarifying that :). The problem finding libcompileEGMf.so seems separate; I guess LGM only gets to that point when running on 32 bit java.

If I delete the .so, run LGM with 32bit java once to compile, see the error about not finding libcompileEGMf.so then run it again, I get the same error:

% java32 -jar lateralgm.jar
Java Version: 10800 (1.8.0_66)
Loading lib files in /opt/enigma-dev-git/lateralgm.jar
01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl 
 05_score.lgl 06_extra.lgl 07_draw.lgl 
Calling `make eTCpath=""`
> make -j 3 -C CompilerSource 
> make[1]: Entering directory '/opt/enigma-dev-git/CompilerSource'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory '/opt/enigma-dev-git/CompilerSource'
0
Process terminated
Thread-4: 
java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:412)
        at com.sun.jna.Native.loadLibrary(Native.java:391)
        at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247)
        at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)
java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:412)
        at com.sun.jna.Native.loadLibrary(Native.java:391)
        at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247)
        at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240)
        at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)

libcompileEGMf.so is/gets placed in /opt/enigma-dev-git/libcompileEGMf.so. I get the same error if I move it to /opt/enigma-dev-git/plugins/libcompileEGMf.so (next to enigma.jar).

Where is this file expected to be?

RobertBColton commented 8 years ago

Ok allow me to explain a bit how it works. LateralGM is Java, ENIGMA is C++. When you go to compile, LGM has to pass the resources and other compile info to ENIGMA's compiler, which means we need Java code to call C++. The way to do this is through JNI (Java Native Interface) or JNA (Java Native Acccess). LGM originally used JNI, but modern LGM uses JNA because much less work is required and it's also less buggy. The first time you run LGM it finds the ENIGMA plugin, the ENIGMA plugin contacts ENIGMA to run make and build compileEGMf, which is the dll that has this interface where LGM's plugin can tell ENIGMA what to do and when to compile.

Subsequent runs of LGM when it loads the plugin, will look for it in the same directory as the enigma plugin and up to 3 directories above it, according to the code (the line in your error log). Look at the calls to addSearchPath, those paths are used by JNA to find the DLL it is loading. https://github.com/enigma-dev/lgmplugin/blob/9bfe9c0788c9ea13bcd304c41739932be231ba0b/org/enigma/EnigmaRunner.java#L247

Now the reason JNA can fail and throw this error message is either when it is literally not there, or the dll and the JVM differ in architecture, ie one is 32 bit and the other is 64 bit, JNA does not support that. http://stackoverflow.com/questions/14286647/trying-to-use-dll-from-java-jna-unable-to-load-library-exception See this stackoverflow verifies the things that I am saying. I don't mean to sound condescending if you know all of this already. It just may help to clarify what the issue is. This is also how we achieve LateralGM being able to run by itself, if you just drag and drop the lateralgm.jar to your desktop for example, it will run fine and not load the ENIGMA plugin, it will work fine in both a 64 bit and 32 bit JVM because it does not make any use of native code by itself, you just won't be able to compile games. It is also theoretically possible to add a GameMaker plugin to LGM in a similar way, but nobody has ever attempted this. We have however attempted to replace LGM with a command line interface, which just means you can compile games from the command line using a program that interfaces with the same dll were talking about here, compileEGMf.

Now then, perhaps with the 64 bit Java, we can run the whole thing in gdb and find out what the symbol _Z2fcPKc was in the dll/so/library. So, deleting the compileEGMf and running with the 64 bit version again (make sure with sudo), can you follow this stackoverflow post and then http://www.pastebin.com the dump of the dll? We will see exactly what is in the dll.

@TheExDeus Were any of the makefiles changed recently? It seems as though this can be caused by a change in the linking order. http://stackoverflow.com/questions/9558909/jni-symbol-lookup-error-in-shared-library-on-linux

gandalf3 commented 8 years ago

@RobertBColton Thanks for the detailed explanation :)

You are correct, the compiled libcompilEGMf.so always appears to be 64 bit, and is indeed not found by lateralgm when run in a 32bit java environment.

Not being too familiar with gdb I'm not sure how to run java in it (and I'm not sure which SO post you were referring to in that last paragraph)

RobertBColton commented 8 years ago

Great, now we're in a much better position to solve the problem since it has been clearly defined.

So then, what GCC do you have? I would say launch the 64 bit version that doesn't crash, and go to game settings->ENIGMA setttings and tell me what options for compiler you have. If there are more than one, try setting it to a different one and building, and let me know if it crashes/what happens. By default, ENIGMA picks the compiler you have available on your system, and these are configured with the following two files: https://github.com/enigma-dev/enigma-dev/blob/master/Compilers/Linux/gcc.ey https://github.com/enigma-dev/enigma-dev/blob/master/Compilers/Linux/gcc32.ey

Which should be in the same place in your local copy.

Also, do you have other compiles installed, such as Clang? There's a lot of config files in here, and it's possible that it is defaulting to a compiler that isn't properly configured, Clang's ey file may have incorrect linking or order, etc. https://github.com/enigma-dev/enigma-dev/tree/master/Compilers/Linux

Do you have any of theses other compilers installed?

TheExDeus commented 8 years ago

The CompilerSource makefile was changed in Jan20 by you to add C++11 support. In my changes, that haven't been merged yet, I added -m32 so it always compiles Compiler in 32bits. That was required because I started using 64bit compiler. It seems it could be a similar problem.

I suggest opening \enigma-dev\CompilerSource\makefile , go to line 32 and change it from this: CXXFLAGS += -std=c++11 -Wall -g -I./JDI/src to this: CXXFLAGS += -std=c++11 -m32 -Wall -g -I./JDI/src

In my branch I have done massive amount of changes that also include some in the compiler and the .ey files. Maybe some of them will fix the issues or create new ones. Like I haven't upgraded the Linux.ey's yet as I can't test them. But this is an issue I should be able to test via VM.

RobertBColton commented 8 years ago

Yeah but woah Harri hold on, we do still want the ability to build 64 bit games. So are you saying we don't know for sure if the engine is able to do 64 bit builds yet?

TheExDeus commented 8 years ago

On my ENIGMA I can build both 32bit and 64bit. ENIGMA engine builds on both. I don't know about the Compiler though. And as we need 32bit Java I forced 32bit .dll. Of course maybe we can ask to build both and then choose depending on Java?

RobertBColton commented 8 years ago

Yes absolutely, the part I am not understanding is why we need a 32 bit Java and that it is forced. I know we need one on Windows though, but that's only because we don't package and ship all the binaries in a 64 bit release yet. I was always under the impression as was everyone else that using 64 bit Java on Linux should be completely fine.

gandalf3 commented 8 years ago

Even with -m32 set it seems libcompileEGMf.so ends up 64bit (I did remove the old version before recompiling)

gandalf3 commented 8 years ago

Here's a screenshot of the available compilers in settings >ENIGMA:

examp926

Setting it to something else doesn't seem to help, as it reverts to the default value (GCC) whenever I restart lateralgm.

I do have clang installed.

TheExDeus commented 8 years ago

That is truly weird. I think you need 32bit on Linux too, but now I am not even sure. Any 64bit GCC compiler should be able to compile into 32bit's though, so I don't know why it doesn't work. I don't think changing those settings will help, as there problem is before that (launching LGM with ENIGMA). Also, the setting will reset on every restart, because it is saved per project in EGM file. So if you use the ENIGMA format it will save.

JoshDreamland commented 8 years ago

GCC builds 64bit on Linux by default, so a 64bit libcompileEGMf.so is what you want, unless you've specifically installed a 32bit JVM (no need to do this). What issue are you having, now? Just the one from the first post? It seems to be caused by a linker error that was deferred because the library is shared. ENIGMA is trying to find a function called fc, but can't. Perhaps someone deleted the function because it was no longer used on Windows.

blurymind commented 8 years ago

bugenigma

Operating System: Linux Version: 4.1.12-1-MANJARO Architecture: i386

Java Vendor: Oracle Corporation Version: 1.8.0_66

Available processors (cores): 2 Free memory (bytes): 50863552 Maximum memory (bytes): 922746880 Total memory available to JVM (bytes): 78643200

File system root: / Total space (bytes): 22673158144 Free space (bytes): 10267881472 Usable space (bytes): 10019397632

Stack trace:

java.lang.UnsatisfiedLinkError: Unable to load library 'compileEGMf': Native library (linux-x86/libcompileEGMf.so) not found in resource path ([file:/opt/enigma-dev-git/plugins/enigma.jar]) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398) at com.sun.jna.Library$Handler.(Library.java:147) at com.sun.jna.Native.loadLibrary(Native.java:412) at com.sun.jna.Native.loadLibrary(Native.java:391) at org.enigma.EnigmaRunner.attemptLib(EnigmaRunner.java:247) at org.enigma.EnigmaRunner.access$1(EnigmaRunner.java:240) at org.enigma.EnigmaRunner$3.run(EnigmaRunner.java:178)

JoshDreamland commented 8 years ago

Your problem seems to suggest that the .so is actually missing. Can you see it in that directory? You may have a build error, and it may be related to the link error gandalf3 is getting.

blurymind commented 8 years ago

I have libcompileEGMf.so in the root directory of enigma (/opt/enigma-dev-git/). There is no folder called linux-x86 there. =/

Any suggestions on how to fix this? Enigma seems to be utterly broken at the moment. At least for arch/manjaro 64 users.

JoshDreamland commented 8 years ago

That's bizarre... as far as I know, it shouldn't be looking in a folder called "linux-x86." If creating that folder and copying the library into it fixed the problem, though, at least I would have something to work with. Can you try that? Failing that, I'm not sure why it's not finding your library, especially since your entire platform is 32-bit. It isn't out of the question that someone changed the place it's looking in some attempt to disambiguate architectures, but I'm not sure why they would do so without updating the makefile to choose the correct output directory....