Ok, so here i am again b*tching about shared objects...and i am right!
I switched scummvm from a static build to shared (wonder why i switched to static...oh yes, because it was cr*p from the beginning)
So far so good, app runs (after struggling with the insane need to gather all the stupid shared objects in one place to make the stupid thing run - this is 2019, come on...)
But, using opengl now is like watching a snail race, where the leader dozes off every second, so 20 points off of Gryffindor.
After that i got adventurous and even switched scummvm to compile it's engines as "plugins" (shared objects in disguise) and what do you know, it runs too...with one engine, yes, with one!!! Adding more engines makes it become more and more sluggish until that dreaded thing will ***crash*** on starting ANY game, what the flying hill???
Another 100 points off of Gryffindor...does anyone still read this? No? OK, Harry Potter is so overrated that i mostly skipped issues 2-6 and the movies sucked a pile of garbage, though it was fun watching a mediocre kid actor grow up to become even worse...or as others put it, let's watch stupid people get rich following orders and getting filmed...fantasy p*rn, that's what it is...
Did i mention i HATE shared objects? Stupid sh*t's not doing what it's supposed to do...just like Potter
Since noone will fix the cr*p shared objects anytime (i wanted to write "soon", but i leave it) i'm going back to static builds and stop providing scummvm binaries once i hit the memory barrier crash(tm by hyperion).
I could really need my stress ball back...too bad i sliced it over that stupid memory barrier bug the other day
// Check whether the node exists and if it's a directory
1. -> struct ExamineData * pExd = IDOS->ExamineObjectTags(EX_StringNameInput,_sPath.c_str(),TAG_END);
if (pExd) {
_nProt = pExd->Protection;
if (EXD_IS_DIRECTORY(pExd)) {
_bIsDirectory = true;
_pFileLock = IDOS->Lock((CONST_STRPTR)_sPath.c_str(), SHARED_LOCK);
_bIsValid = (_pFileLock != 0);
// Add a trailing slash if needed
const char c = _sPath.lastChar();
if (c != '/' && c != ':')
_sPath += '/';
} else {
//_bIsDirectory = false;
_bIsValid = true;
}
IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd);
}
LEAVE();
}
crash when using shared objects, but work perfectly fine when using a static build?
Crash log for task "scummvm"
Generated by GrimReaper 53.19
Crash occured in module scummvm at address 0x7F1E06BC
Type of crash: DSI (Data Storage Interrupt) exception
Alert number: 0x80000003
Does it really has to do with not finding a path/directory? Because that wouldn't be logical since the program accesses said path beforehand and does not crash.
C++ backends/platform/sdl/amigaos/amigaos-main.o
In file included from ./common/scummsys.h:472,
from backends/platform/sdl/amigaos/amigaos-main.cpp:23:
backends/platform/sdl/amigaos/amigaos-main.cpp: In function 'int main(int, char**)':
./common/forbidden.h:57:38: error: 'FORBIDDEN_look_at_common_forbidden_h_for_more_info' was not declared in this scope
#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./common/forbidden.h:57:38: note: in definition of macro 'FORBIDDEN_SYMBOL_REPLACEMENT'
#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backends/platform/sdl/amigaos/amigaos-main.cpp:37:2: note: in expansion of macro 'printf'
printf("IDOS: %p\n", IDOS);
^~~~~~
./common/forbidden.h:57:89: error: expected ';' before 'SYMBOL'
#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
^~~~~~
./common/forbidden.h:62:16: note: in expansion of macro 'FORBIDDEN_SYMBOL_REPLACEMENT'
#define printf FORBIDDEN_SYMBOL_REPLACEMENT
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
backends/platform/sdl/amigaos/amigaos-main.cpp:38:2: note: in expansion of macro 'printf'
printf("Minimum newlib version: %u.%u\n",
^~~~~~
backends/platform/sdl/amigaos/amigaos-main.cpp:35:29: warning: unused variable '__newlib_minversion_ptr' [-Wunused-variable]
extern unsigned const int *__newlib_minversion_ptr;
^~~~~~~~~~~~~~~~~~~~~~~
gmake: *** [backends/platform/sdl/amigaos/amigaos-main.o] Error 1
Since it is C++ code you need to add 'extern "C" { }' around the extern variable definitions. Also you might want to make them outside of the main() function.
If I remember correctly, ScummVM doesn't allow usage of many standard lib functions. So you may need to replace printf with "warning" or whatever can print to console.
but there is no output, it simply crashes without printing anything, probbaly another mistake by me or the part of code i put it in is yet to be called/used?
It prints to the serial so you will have to use sashimi or dumpdebugbuffer to catch the output (or have another computer connected with a null modem cable).
You could also try std::cout to print to the console:
I stole some code from the android part, but it gives me an error Quote:
C++ backends/graphics/openglsdl/openglsdl-graphics.o backends/graphics/openglsdl/openglsdl-graphics.cpp: In member function 'virtual void OpenGLSdlGraphicsManager::updateScreen()': backends/graphics/openglsdl/openglsdl-graphics.cpp:546:46: error: a function-definition is not allowed here before '{' token static const char *getGlErrStr(GLenum error) { ^ backends/graphics/openglsdl/openglsdl-graphics.cpp:568:65: error: a function-definition is not allowed here before '{' token void checkGlError(const char *expr, const char *file, int line) { ^ gmake: *** [backends/graphics/openglsdl/openglsdl-graphics.o] Error 1
#ifdef __amigaos4__
static const char *getGlErrStr(GLenum error) {
switch (error) {
case GL_INVALID_ENUM:
return "GL_INVALID_ENUM";
case GL_INVALID_VALUE:
return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION:
return "GL_INVALID_OPERATION";
case GL_STACK_OVERFLOW:
return "GL_STACK_OVERFLOW";
case GL_STACK_UNDERFLOW:
return "GL_STACK_UNDERFLOW";
case GL_OUT_OF_MEMORY:
return "GL_OUT_OF_MEMORY";
}
Make sure you define new function(s) outside this updateScreen() function, and only call this checkGlError() with appropriate params within updateScreen(). If it fails, show us the code, please.
I don't get any output, neither console nor serial.
As soon as i start *any* game it immediately crashes edit: This "immediate" is determined by logging the serial which immediately starts printing the crashlog after i hit enter on a game entry, so it does not even try to load code or datat from the game, it bombs right on accessing either the shared objects engine file (which i doubt, since it is already accessed when i hit the "About" dialogue, which lists all built engines and which would NOT list them if they weren't installed, i tried), or the directory/path where the game data is located (which is, of course correctly set in the options, i checked as well)
Crash log for task "scummvm"
Generated by GrimReaper 53.19
Crash occured in module scummvm at address 0x7F1E0708
Type of crash: DSI (Data Storage Interrupt) exception
Alert number: 0x80000003
ScummVM: DebugPrintF was not declared in this scope
edit1: sigh...not to self...#include<inline4/exec.h> edit2: This comes up on serial when i start the launcher, nothing comes up, apart from the crashlog, when starting a game
Quote:
DOS: 1875689840 Minimum lib version:52.20
Does that help?
ResidualVM: i have absolutely no idea how i could read out the used formats, its nunfortunately not as easy as in scummvm. The only stuff i was able to read out is a long number 1308... etc, but i hvae no idea what to make of it, neither do i know if that is the correct thing to debug.
Edited by Raziel on 2019/9/25 18:53:05 Edited by Raziel on 2019/9/25 19:01:52
Include proto/exec.h if you want to call IExec functions, rather. You could now try to add more DebugPrintFs near to the crash site. The last trace had r9 == 0 (NULL), for example, so there is an invalid read attempt.
I guess it's possible to debug them all but it would be genereally faster to discuss with devs who wrote the code.
One idea you could do, is to fork the engine, create a git branch, add your debug patches over and then show us what you have got. You can delete the branch later.
C++ backends/platform/sdl/amigaos/amigaos-main.o backends/platform/sdl/amigaos/amigaos-main.cpp: In function 'int main(int, char**)': backends/platform/sdl/amigaos/amigaos-main.cpp:49:2: error: 'DebugPrintF' was not declared in this scope DebugPrintF("IDOS: %d\n", IDOS); ^~~~~~~~~~~ gmake: *** [backends/platform/sdl/amigaos/amigaos-main.o] Error 1
thus i used inline4/exec.h
ResidualVM: Yeah, i did, the answer was: Quote:
If you're simply enabling error checking for debugging, here is what I would do: (in descending order of convenience) - Use gDEBugger or AMD CodeXL and break on error - Use apitrace or Renderdoc and check the error log - If your OpenGL implementation is new enough or has the right extensions, use the OpenGL debug hooks - If your OpenGL implementation is open source, put a breakpoint on the function that sets the error flag - Finally, if nothing else works, patch the code to wrap all OpenGL calls with a wrapper that calls `glGetError`.
There is a problem with older newlibs if the requested minimum version is >= 52.39** that leads to DOSBase and IDOS not being properly initialised. It does not appear to be the reason for your problem though judging from the above output.
If the crash was in a shared object it could be that it is unable to access the IDOS symbol from the main executable and this is leading to the NULL pointer access, but that does not look to be the case judging from the stack backtrace...
** For static newlib builds this only happens if one of the more recent newlib functions is used. I'm not sure how it works for builds using libc.so.
On my other thread (perl), with the help of broadblues, i discovered i had an outdated libc.so installed (53.28 compared to newlib being 53.30) resulting in problems in my perl installation. This was cured after i reinstalled libc.so from the FE install disc.
I guess a simple new linked executable won't do it? I have to build the whole thing again, because even with the correct libc.so in place and a new linked exe i still get that crash.