Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
91 user(s) are online (42 user(s) are browsing Forums)

Members: 1
Guests: 90

amije, more...

Headlines

 
  Register To Post  

« 1 ... 15 16 17 (18) 19 20 21 ... 72 »
Re: Odyssey 1.23 progress
Just popping in
Just popping in


See User information
@kas1e

Quote:
Quote:
Why are you causing DSI exceptions (handled by the kernel, but all exceptions are very slow) by using
SysBase = *((struct ExecBase **) 4);


I don't have any DSIs there for those ones (and i am on debug kernel with munge). Or you mean they invisibly ?


This is exactly what Jörg wrote. Peeking at address 4 is in fact causing a DSI exception, but this is handled silently by the kernel. The point is that exceptions cause a major performance penalty, even if they don't become visible.

Peeking at address 4 must be supported, because this was documented to be valid since day zero of Amiga history. But there are lots of other ways to get a valid ExecBase address which don't require this kind of a big wooden hammer and hence don't cause any further performance penalty.

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@Thore
Ok, got it.

Through in whole odysseys code it uses 1 time, in that bcsharedtimermorphos.cpp , and i not see SysBase uses later directly in any place.


Go to top
Re: Odyssey 1.23 progress
Just popping in
Just popping in


See User information
@kas1e

A one-time-appearance of it within the whole code doesn´t necessarily mean that it is called only that one time.

Please, just replace it with anything suitable and go on making Odyssey work

Go to top
Re: Odyssey 1.23 progress
Just can't stay away
Just can't stay away


See User information
Searching in google I got:

http://code.google.com/p/os4sdl/sourc ... aos4/SDL_os4timer.c2?r=30

http://code.google.com/p/os4sdl/sourc ... gaos4/SDL_os4timer.c?r=30
<pre>..
void __os4timer_startup(void)
{
struct ExecBase *sysbase = (struct ExecBase*) IExec->Data.LibBase;
// struct ExecBase *sysbase = (struct ExecBase *)4L;
// IExec=sysbase->MainInterface;
..</pre>
So maybe replacing/#ifdef with such code will solve it.

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@whose
Quote:

Please, just replace it with anything suitable


Please, better to understand why we need to replace it at all and not remove it :)

After talking with Thore in mail, suitable there is not have it at all as startup code already deal with. I also do search on all the os4codes i have, and on wiki/os4coding/hp forum, and no one assign Sysbase directly at all, everyone just have "extern struct ExecBase *SysBase;" and leave it to system to decide what is it.

So, my suitable replace is just:

static void TimerFunc(void)
{
    
#ifndef __amigaos4__ 
    
struct ExecBase *SysBase;
    
#endif
    
struct Task *CurrentTask;
    
struct TimerHandle *Handle;
    
struct MsgPort TimerMP;
    
ULONG TimerSignal;
    
struct timerequest TimerIO;

    
#ifndef __amigaos4__
    
SysBase = *((struct ExecBase **) 4);
    
#endif

    
CurrentTask FindTask(NULL);

    
Handle = (struct TimerHandle *) CurrentTask->tc_UserData;

 ... 
blblalb




Edited by kas1e on 2014/2/27 11:58:01
Edited by kas1e on 2014/2/27 11:58:15
Go to top
Re: Odyssey 1.23 progress
Just popping in
Just popping in


See User information
@kas1e

Yes, this is suitable and the (IMHO) best solution.

We needed to replace it, because SysBase = *((struct ExecBase **) 4); does a zeropage access (from "user space"), which shouldn´t have been done at all...

Removing is impossible, because sometimes you need an anchor to access OS functions. On other systems this is done e.g. using an interrupt.

I don´t know why it is used in this part of code, but I don´t think that it´s done just for fun

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@kas1e

“extern” does not make sense, this is what you use when, you want to tell the compiler that we have variable, but sense its a global, we can't declare it here. But its declared else where.

So drop the "extern", it does not make sense inside TimerFunc()

When you have more then one .o file, you can get linking error, saying the variable is declared more then once, this when you use “extern”.

besides, processes created by CreateNewProc, should call functions and it this agreements.

Int32 rc = _start(STRPTR args, int32 Length, APTR Execbase);

so go looking for Execbase on address 4 should be unnecessary.

CreateTask does not have a Execbase as argument but, instead it can be provided by AT_Param1 or AT_Param2 tags in tag list.

Or do what Jabirulo is saying.

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@Whose
Quote:

Removing is impossible, because sometimes you need an anchor to access OS functions. On other systems this is done e.g. using an interrupt.


Removing from os ? From odyssey we can remove it (i assume) because startup code already deal with SysBase, its always on the need it value, and no needs to set it at all for us.

Quote:

I don´t know why it is used in this part of code, but I don´t think that it´s done just for fun


Like i know it :) All i know that SysBase automatically initialized by the startup code, and there no needs for us to have that "SysBase = anything".

What i mean is that even if Fab put it here for reason, for us it not need it as startup code deal with it already.

@LveForIt

Yeah, already removed it all and already tested all is fine.

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@kas1e

Quote:

What i mean is that even if Fab put it here for reason, for us it not need it as startup code deal with it already.


Since it's not explicity referenced, the only reason must be allow exec.library calls, but that seems odd as if this is in the main code you allready have it set up (even in Morphos I would guess) perhaps it's just got coppied over from another project by accident?

If this were in a loadable module of somekind with no startup code then it would need to be followed by code obtaining IExec from it, but doesn't appear to be the case.




Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@kas1e

One way you can manage the process is by a counter.

Count up when process start, count down when process ends, so at end of program you can see if count is 0 or not, and you know if process has stoped, then maybe you should do a IDOS->Delay(5), to make shore they are really stooped.

while (process_count >)
{
   
IDOS -> Delay(1);
}
IDOS -> Delay(3);

/* Close libs */

/* Exit program */


And use a MUTEX to protect the counter, if you need to make it atomic.


Edited by LiveForIt on 2014/2/27 12:26:45
Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@LiveForIt

Facepalms!

while(process_count > 0)
{
IExec->Wait(SIGF_CHILD);
}



Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@broadblues

Well your the experts, I'm only do what I know works.

Go to top
Re: Odyssey 1.23 progress
Just popping in
Just popping in


See User information
@LiveForIt

Quote:
“extern” does not make sense, this is what you use when, you want to tell the compiler that we have variable, but sense its a global, we can't declare it here. But its declared else where.

So drop the "extern", it does not make sense inside TimerFunc()


Hmm... if it´s the SysBase defined by the startup code, the "extern" makes perfect sense here. SysBase is defined "elsewhere", and it should not be a local (automatic) variable of TimerFunc(). That´s what "extern" means here.

But what about this code running outside the main code´s scope?

I think that´s the reason for the "SysBase = *((struct ExecBase **) 4);" thingie. SysBase is declared inside the function (as a local, and here the "extern" indeed doesn´t make any sense. "static" would be the better choice, maybe) and must therefore be initialized with something that makes sense...

But if this is a function running within the main code´s scope only, it´s total nonsense to declare SysBase over and over. Bad coding practice

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@whose

So what happens then does a local variable become global?
Way declare it as local variable, when its already global.

No it does not make sense, I never seen it used like that.

Maybe you should have read the next line I wrote not just the two first lines.

Go to top
Re: Odyssey 1.23 progress
Just popping in
Just popping in


See User information
@LiveForIt

Sometimes it depends on the source code organization. If the files containing the whole code are organized in static modules, (global) variables like SysBase might not be visible within a certain file if they are not declared "extern".

If you don´t want to mix machine dependend code with "portable" code, it´s best practice not to mess up the "portable" code with machine dependend globals.

Locals must be initialized local, if you don´t declare them "extern" (and define the variable containing the needed value elsewhere). If the "local" variable is declared "extern", this does indeed mean that it´s a global. That´s what SysBase is in most cases. A global. For OS4, it´s a variable defined by the startup code.

Here (in this function TimerFunc() ) it is a question of context, if "extern" makes sense or if the local declaration of SysBase is meant for "clean" code.

If the function is running within the scope of the startup module, "extern" makes perfect sense (and it would lead most certainly to a crash, if you discard the "extern" qualifier). But in this case the initialization is unnecessary. SysBase is initialized already (by the startup module).

If it´s running outside this scope, the correct value of SysBase should be provided by parameter and could be used directly then.

Back in 68k times it was quite usual to initialize a local SysBase by "SysBase = *((struct ExecBase **) 4); " (although most today´s compiler´s startup code provides for SysBase), but with the advent of zeropage protection, this is bad practice.

For me, this function´s code looks a bit messy. On the one hand, global SysBase is used (MOS and OS4 port), on the other hand, "bootstrap" initialization of SysBase is used (obviously, meant for 68k systems). The scope is quite unclear here...

Edit: If the code compiles without the "extern" AND without the initialization, there must be a global SysBase already somewhere within the source file. But then it should throw at least a warning about redefinition... weird.


Edited by whose on 2014/2/27 13:33:17
Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@Andy
Quote:

using ranger should anable kas1e to chack if all Odysey processes has closed after program quit.

Via ranger all i can see, is that on first run it creates (as usuall, and same for 1.16) those process:

Quote:

[owb] javascritpcore::blockfree
[owb] icondatabase
[owb] timer


When i exit, all of them exit too. All seems fine.

Then i run second instance from shell : dsi, ignoring of which run those processes again fine and browser works. Just after i ignore DSI i have on serial:

Quote:

Task 0x65E793E0 (Shell Process) bad access @ 0x63B94608, pc = 0x018200A8, lr = 0x0182012C,


Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
From that info you ought to be able to see in ranger which app that task belongs too.

Does the DSI not give any kind of stack trace? Maybe you posted allready and I missed it.

Have you tried running this from gdb? I know it has it's limitations but it might still catch something...


Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@Andy
Quote:

From that info you ought to be able to see in ranger which app that task belongs too.


http://kas1e.mikendezign.com/temp/ranger.jpg

Quote:

Does the DSI not give any kind of stack trace? Maybe you posted allready and I missed it.


Dump of context at 0xEFC10BA0 
Trap type
DSI exception 
Machine State 
(raw): 0x0200F030 
Machine State 
(verbose): [ExtInt on] [User] [FPU on] [IAT on] [DAT on
Instruction pointerin module kernel+0x0002009C (0x0182009C
Crashed processowb (0x6335EA50
DSI verbose error descriptionAccess not found in hash or BAT (page fault
Access was a load operation 
 0
65ABF604 64475950 020C2BEC 65ABF600 60534B60 60534B60 00000108 60534B70 
 8
000000D3 020C2BEC 00000100 021D69A6 FFFFFFF7 64915BE0 00000000 65FF26C0 
16
7D4C9040 00000000 63368090 64475C08 02290000 02290000 00000000 00000001 
24
62ADF7D0 62ADF7D0 00000000 020A0000 7EC96FBC 60534B60 65ABF600 020C2BEC 
CR
22842B84   XER60008F50  CTR: 018200B0  LR: 0182012
DSISR
40000000  DAR65ABF608 

FP0 
FFF8000082024000 3FF0000000000000 3FEFFFEB000DC7F7 41D4C3A5BC5E0CF2 
FP4 
0000000000000000 4048E66660000000 405FF33340000000 41E0000000000000 
FP8 
0000000000000000 BF60182436517A27 3ED0306CD997DDE4 BF701ACDBB94A830 
FP12
3FF0000000000000 4052000000000000 0000000000000000 0000000000000000 
FP16
0000000000000000 0000000000000000 0000000000000000 0000000000000000 
FP20
0000000000000000 0000000000000000 0000000000000000 0000000000000000 
FP24
0000000000000000 0000000000000000 0000000000000000 0000000000000000 
FP28
0000000000000000 0000000000000000 0000000000000000 0000000000000000 
FPSCR
82024000 

V0 
00000000000000000000000000000000 00000000000000000000000000000000 
V2 
FE0113ECFE0124DBFE013FC0FE013FC0 FE0113ECFE0124DBFE013FC0FE013FC0 
V4 
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 01000100010001000100010001000100 
V6 
00000000000000000000000000000000 00000000000000000000000000000000 
V8 
00000000000000000000000000000000 00000000000000000000000000000000 
V10
01010101010101010101010101010101 00000000000000000000000000000000 
V12
00000000000000000000000000000000 00000000000000000000000000000000 
V14
: 001002120414061608180A1A0C1C0E1E 01000100010001000100010001000100 
V16
FF000000FF000000FF000000FF000000 FF49140FFF8B251CFFEE4030FFEE4030 
V18
00000000000000000000000000000000 00000000000000000000000000000000 
V20
00000000000000000000000000000000 00000000000000000000000000000000 
V22
00000000000000000000000000000000 00000000000000000000000000000000 
V24
00000000000000000000000000000000 00000000000000000000000000000000 
V26
00000000000000000000000000000000 00000000000000000000000000000000 
V28
00000000000000000000000000000000 00000000000000000000000000000000 
V30
00000000000000000000000000000000 00000000000000000000000000000000 
VSCR
00000000 VRSAVE00000000 

Kernel command line
serial munge 

Registers pointing to code

r2 native kernel module kernel+0x008c2bec 
r9 
native kernel module kernel+0x008c2bec 
r11
native kernel module kernel+0x009d69a6 
r13
_ZGVZN7WebCore22InspectorDebuggerAgent21sourceMapURLForScriptERKNS_19ScriptDebugListener6ScriptEE29sourceMapHTTPHeaderDeprecated()+0x0 (section 22 0x54F4)
r16main()+0x0 (section 1 0x101C
r23module owb at 0x00000001 (section 0 0xFFFFFFDC
r27native kernel module kernel+0x008a0000 
r28
_ZN3WTF23threadSpecificKeyCreateEPPNS_18ThreadSpecificNodeEPFvPvE()+0xac (section 1 0x17CEF98
r31native kernel module kernel+0x008c2bec 
ip 
native kernel module kernel+0x0002009c 
lr 
native kernel module kernel+0x0002012c 
ctr
native kernel module kernel+0x000200b0 

Stack trace

(
0x64475950native kernel module kernel+0x0002009c 
(0x64475980native kernel module kernel+0x0002012c 
(0x644759A0_ZN3WTF19initializeThreadingEv()+0x3a4 (section 1 0x17A9F30
(
0x64475A10_ZN3JSC19initializeThreadingEv()+0x64 (section 1 0x150B12C
(
0x64475A20_ZL12handleOM_NEWP6IClassPmP5opSet()+0x134 (section 1 0x95F8
(
0x64475AE0_ZL8dispatchP6IClassPmP4_Msg()+0x438 (section 1 0xF554
(
0x64475B20native kernel module intuition.library.kmod+0x0001824c 
(0x64475B80native kernel module intuition.library.kmod+0x00018470 
(0x64475C00native kernel module intuition.library.kmod+0x0000839c 
(0x64475C30native kernel module intuition.library.kmod+0x00008130 
(0x64475CA0_Z18create_applicationPc()+0xd4 (section 1 0x628
(
0x64475CD0main()+0x144 (section 1 0x1160
(
0x64475D00native kernel module newlib.library.kmod+0x000020a4 
(0x64475D70native kernel module newlib.library.kmod+0x00002d0c 
(0x64475F10native kernel module newlib.library.kmod+0x00002ee8 
(0x64475F50_start()+0x170 (section 1 0x16C
(
0x64475F90native kernel module dos.library.kmod+0x00025208 
(0x64475FC0native kernel module kernel+0x0006acdc 
(0x64475FD0native kernel module kernel+0x0006ad5c 

Disassembly of crash site

 0182008
C7FE00008   trap 
 
01820090: 4BFFFEB4   b                 0x181FF44 
 
01820094: 38030004   addi              r0,r3,
 
01820098: 90040000   stw               r0,0(r4
>0182009
C81230008   lwz               r9,8(r3
 018200
A090890000   stw               r4,0(r9
 018200
A491240004   stw               r9,4(r4
 018200
A890830008   stw               r4,8(r3
 018200
AC4E800020   blr 
 
018200B07C0802A6   mflr              r0 
Stack pointer 
(0x64475950is inside bounds 
Redzone is OK 
(4)



Also do check this way: i just run odyssey from shell, exit, close that shell window, spawn new one, run odyssey : all works (but that expected, as it kind of new instance).

Running second time in new tab : works too.
Running third time in another tab: works too.

"endcli" in all tabs after i run second or third instance works fine, i can exit from them, etc (so no locked or whatever).

Only problem is exactly in the same shell window run/exit/run again.

Quote:

Have you tried running this from gdb? I know it has it's limitations but it might still catch something...


Well , as it will be inside of gdb, it will spawn for every new run new process and there will be no crash :) (as it didn't crashes for as in all places, only direct run from the same shell window in the same tab). Or you mean attach to gdb when its already crashed ? Tried as well, backtrace / bt just show some mess. Or if you mean to do so because dind't see crashlog : nope, our reaper catch it fine, i even post it before and recopy it in that post again.

Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@whose

Quote:

Edit: If the code compiles without the "extern" AND without the initialization, there must be a global SysBase already somewhere within the source file. But then it should throw at least a warning about redefinition... weird.


It'll quite happily compile without error that way under OS4 as the SysBase variable is not access directly ( functuion calls are using IExec) (if -wall is in use it might throw up an warning about it being unused)


Go to top
Re: Odyssey 1.23 progress
Home away from home
Home away from home


See User information
@Fab
Quote:

Probably your threading backend has an issue with the startup/end message handling. It might only appear now in 1,23 because more threads are involved (garbage collector thread, localstorage thread and, all the mediaplayer threads and so on...).


But it just happens when i only run odyssey , do nothing (so only about: page), quit, and run it again. At thise moment imho only few threads involved (those which was in 1.16 as well) ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 ... 15 16 17 (18) 19 20 21 ... 72 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project