Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
218 user(s) are online (128 user(s) are browsing Forums)

Members: 1
Guests: 217

skynet, more...

Headlines

Forum Index


Board index » All Posts (Georg)




Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


As said IMO it's very likely problem of some uninitialized variable in this shader compiling stuff. Maybe somewhat hidden (compiler may not warn about it) if for exampled caused as side effect of unimplemented/unhandled functionality/attributes/whatever.

The thing with the call of the magic functions (printf(), Delay(1)) that make things work, is, that the calling of this functions will cause modification of things on the stack so they will influence how uninitialized variables look like when they end up being used in other code (shader compilation) which is exectuted after that = ~"in the future".

Funny experiment: If

Delay(1);

works, but Delay(0) doesn't it probably is possible to make the working thing not-work again by calling both:

Delay(1);
Delay(0);

Go to top


Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


My guess now is that it's most likely some unimplemented functionality which causes some uninitialized variable to stay uninitialized and therefore causing random behaviour (which can be influenced by adding removing "magic" calls)

Like maybe in SDL_shaders_gl.c:

GLint status;

...

ctx->glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status);

If this GL_OBJECT_COMPILE_STATUS_ARB param/flag/whatever is not implemented in the GL libraries or whereever ...

Go to top


Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


IIRC in AROS I once had a funny situation in a some test program which opened a window and would quit when you press some key. In the shell you typed in the command, pressed RETURN key, the window opened quickly and the RETURN key release happened after that and so the event went to the window/test program which then quit immediately.

Go to top


Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


Btw, what does "not work" mean? Does it crash? Does it quit?

Go to top


Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


To me this does not look or "smell" like race condition or timing related at all. Add an always failing runtime checked (to make sure it can't be optimized away) check around printf call that usually makes the thing work and see what happens. If it still works even if the actual printf() call never gets executed then you know it's not timing/race condition problem.

- printf("blablabla")
+ if ((int)SysBase == 0x1234) printf("blablabla");

Go to top


Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


Quote:

I just add before another function in the whole source, like:

static SDL_bool Omega1200(void)
{
IDOS->Delay(1);    
}



If the function never gets called it may be optimized away.

Quote:

What is more fun, if i use small printf() like prinf("a"); then it also didn't fix issue, but more "a" i put, then it works.


The compiler may have optimized printf() into a putchar().

Go to top


Re: Why call to or any "empty" functions can cause different results of the code in which you insert it?
Just popping in
Just popping in


It may also just be that your magic function (Delay() or printf()) triggers some linker autoinit stuff which is otherwise not happening.

What happens if you put the Delay() or printf() in some place in the .c file which never gets called. Or inside some check which never is true (but make sure it's not something the compiler optimizes away completely). Like "if (SysBase->SysFlags == 0xABCD)"

Go to top


Re: Getting Napalm to run on AmigaOS 4.1.2?
Just popping in
Just popping in


@kas1e

That loading screen does not really look messed up, but the areas where there is text have the background behind darkened which would happen in cases like where someone had had a 32 bit truecolor screen, read the pixels into a 16 bit truecolor buffer and write it back to 32 bit screen.

The asm source you linked contains lots of data (dc.l, dw.c) which is code. For example LAB_0323 is code which calls timer.device/GetSysTime() and stores timeval.tv_secs at 14c(a4).


Go to top


Re: Timberwolf working AGAIN !
Just popping in
Just popping in


Maybe it would not crash on exit (or crash less) if timing code in amigaos_thread.c/amigaos_cvar.c wasn't broken. As it looks at the moment what can for example happen is that a timerrequest is pending (unreplied) while it shuts down (CloseDevice). Because of the usual broken timing code which among other things assumes timersig received == timerequest was replied. This is not always so, because a previously aborted timerequest may have left the signal set, because WaitIO() does not always cause the signal to be cleared.


Go to top


Re: Qt 6 progress
Just popping in
Just popping in


I looked a bit through sources files named "*amiga*".

Timing code is buggy.

After AbortIO() you still need to call WaitIO() otherwise request does not get removed from reply port. Also you should not call AbortIO() on a request which was never SendIO()ed.

When receiving timer signal this does not necessarily mean that the request has completed. Check if request has arrived back at reply port. For example with GetMsg() which does the "remove from reply port", too, which is also missing here.

In "if (include_timers && caughtSignals | 1 << d->timerPort->mp_SigBit)" the | should be an &.


Not related to timer stuff, but if there's things like intuimessages where more than one message can end up at the MsgPort at the same time, then when receving the signal you must loop over and handle all messages on the msgport otherwise you create ~"laggy/delayed" response to events. The task's received-signal-mask gets the signal bit cleared after the Wait() call. It does *not* reflect the is_msgport_empty_or_not state.

Go to top


Re: Qt 6 progress
Just popping in
Just popping in


I don't know much about this shared objects in AOS4, but shouldn't they show up in exe as "undefined". In Linux

objdump -T `which kate` | grep -i staticmeta | grep -i lineedit

shows:

0000000000000000 DO *UND* 0000000000000000 Qt_5 _ZN9QLineEdit16staticMetaObjectE
0000000000000000 DO *UND* 0000000000000000 _ZN9KLineEdit16staticMetaObjectE

Maybe check with some other AOS4 programs which use shared objects, to see how the shared symbols in the exe appear there.

Go to top


Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Just popping in


@kas1e

if (mode == GL_QUADS) {
        
mode GL_TRIANGLES;
        
int ilen = (count*3)/2;
        if (
iindices) {
            
gl4es_scratch(ilen*sizeof(GLuint));
            
GLuint *tmp = (GLuint*)glstate->scratch;
            for (
int i=0j=0i+3<counti+=4j+=6) {
                
tmp[j+0] = iindices[i+0];
                
tmp[j+1] = iindices[i+1];
                
tmp[j+2] = iindices[i+2];

                
tmp[j+3] = iindices[i+0];
                
tmp[j+4] = iindices[i+2];
                
tmp[j+5] = iindices[i+3];
            }
            
iindices tmp;
        } else {
            
gl4es_scratch(ilen*sizeof(GLushort));
            
GLushort *tmp = (GLushort*)glstate->scratch;
            for (
int i=0j=0i+3<counti+=4j+=6) {
                
tmp[j+0] = sindices[i+0];
                
tmp[j+1] = sindices[i+1];
                
tmp[j+2] = sindices[i+2];

                
tmp[j+3] = sindices[i+0];
                
tmp[j+4] = sindices[i+2];
                
tmp[j+5] = sindices[i+3];
            }
            
sindices tmp;
        }
        
count ilen;
    }


Assuming example: count=1 == should convert one quad to two triangles, right? (I don't know GL).

But at end of that code block it says "count = ilen" but ilen=count*3/2 which would be 1 in this example. 3/2=1.




Go to top


Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Just popping in


@kas1e

What happens if in OpenGLRender.cpp you make COpenGLRender::ActivateHeightFog() function do nothing ("return" at start of function)?


Go to top


Re: How detect and fix heap trashing ?
Just popping in
Just popping in


@kas1e

Quote:

Through as i understand we just avoid accessing to trashed memory, while some parts of memory still trashed and leaks still there ?


It avoids blitting outside left bounds (and thus trashing memory there) because that's what debug output shows it did (negative coords). So the change causes the bitmap to be allocated bigger (wider) and the blits to be offset to the right so that final blit X position of each glyph (char in string) is always >= 0.

Theoretically (weird fonts/languages/accents?) it could still blit outside right/bottom/top side. So to be 100 % safe you would need to check all sides. ~

[..]

int top_most 0;
int right_most 0;
int bottom_most 0;

[..]

int blitx2 blitx blitw 1;
int blity2 blity blith 1;

if (
blitx left_mostleft_most blitx;
if (
blity top_mosttop_most blity;
if (
blitx2 right_mostright_most blitx2;
if (
blity2 bottom_mostbottom_most blity2;

[..]

= (right_most left_most) + 1;
= (bottom_most top_Most) + 1;

[..]

my_draw_bitmap([..] blitx left_mostblity bottom_most [..]);



Go to top


Re: How detect and fix heap trashing ?
Just popping in
Just popping in


@kas1e

Crash is more likely second line ("if( (*menu)->parent_entry->show_subsetting )") with parent_entry likely being uninitialized.

Add a line to menu_new() which sets menu->parent_entry to 0. Or change the malloc in there to calloc.


Go to top


Re: How detect and fix heap trashing ?
Just popping in
Just popping in


@kas1e

Quick fix (assumes only blitx can be out of bounds (on left side)). Undo previous stuff (kprintf), first:

[..]

int left_most 0;

[..]

for(
i=0;i<2;i++)
{
 if(
i==1)
 {
   
-= left_most;
   
   [..]
 }
 
 [..]
 
 for( 
0; [..] ) {
 
 [..]
 
int blitx pen_x face->glyph->bitmap_left;
int blity pen_y font_height*face->ascender/(face->ascender-face->descender) - face->glyph->bitmap_top;
int blitw face->glyph->bitmap.width;
int blith face->glyph->bitmap.rows;

if (
blitx left_mostleft_most blitx;

if (
!= 0)
{
  
my_draw_bitmap( (char *)face->glyph->bitmap.bufferblitwblithblitx left_mostblity, *data w);
                                                                    ^^^^^^^^^^^^^^^^^
 [..]
}
else
{
 [..]
}

[..]


Go to top


Re: How detect and fix heap trashing ?
Just popping in
Just popping in


Try

int blitx pen_x face->glyph->bitmap_left;
int blity pen_y font_height*face->ascender/(face->ascender-face->descender) - face->glyph->bitmap_top;
int blitw face->glyph->bitmap.width;
int blith face->glyph->bitmap.rows;

if ((
blitw <= w) && (blith <= h) &&
    (
blitx >= 0) && (blity >= 0) &&
    (
blitx blitw <= w) && (blity blith <= h))
{
  
my_draw_bitmap( (char *)face->glyph->bitmap.bufferblitwblithblitxblity, *data w);
}
else
{
  
kprintf("=== ignoring my_draw_bitmap which would trash: %d,%d %dx%d (bm %dx%d)\n"blitxblityblitwblithwh,);
}


Go to top


Re: How detect and fix heap trashing ?
Just popping in
Just popping in


@kas1e

getStringPixmapFT()/my_draw_bitmap() likely trashes mem when blitting into chunky buffer (data) -> font glyph info/"coords" (bitmap_left) maybe can have values the code does not expect (like negative ones). Because of kerning or whatever. my_draw_bitmap() isn't clipping anything.





Go to top


Re: Is there a way to avoid blocking of everything else, when hold the LMB over icon on WB ?
Just popping in
Just popping in


It happens because of the way icon dragging (moving the icons sprite like (actually bobs) over the screen) is done by Workbench. It locks all the layers on the screen so that it can draw directly into screen bitmap and the locks prevent other apps from rendering at the same time to prevent gfx trashes.

Theoretically icon dragging could be handled differently by Workbench by doing it like in other OSes where they put the icons in a irregular shaped window (or alpha shaped window with compositing enabled) and move that around. This needs a lot more cpu/gfx power so on things like Classic Amigas would be unusable slow.

Or Workbench could optionally simply not do the LockLayers()/UnlockLayers() calls and user would have to live with small gfx trashes every once and then. There are tricks to repair some of the gfx trashes after dragging is done. Partly automatically, partly by user.


Go to top


Re: A question for Polaris users
Just popping in
Just popping in


@Hans

Disable gfx card interrupts in reset handler to prevent the situation during soft boot where there could be interrupts coming in but gfx driver is not yet running and can't handle it to ACK the interrupts, so system hangs in interrupt "state"?




Go to top



TopTop
« 1 2 (3) 4 5 »




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project