Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
24 user(s) are online (23 user(s) are browsing Forum)

Members: 1
Guests: 23

aha, more...

Browsing this Thread:   1 Anonymous Users





Run an app: shell vs wanderer

Joined:
2009/5/15 13:18
From Naples, Italy
Group:
Member
Posts: 415
Offline
I ask this here because i'm having strange behaviour (it's not the first time) i write something.
Is it normal that a program crashes if run from the shell and works fine if run from wanderer?
Thx!

Posted on: 2012/12/30 13:56
_________________
Somethin'nothin'o'u have: a working MPS1550 (Commodore Dot Matrix Color Printer) :p:p:p &
1 "amiga computer of the year 1986" sticker with an original 1987 coffee stain upon it!!!
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2008/1/7 12:41
From Poland
Group:
Member
Posts: 2304
Offline
First difference is that in both methods stack assigned to the program is different. When running from Wanderer stack is set on icon, when running from shell, stack is taken from environment configuration.

Posted on: 2012/12/30 13:59
_________________
Krzysztof

"There is no such thing as software for free. If it is not the user who covers the cost of software creation with money, it is the developer who covers this cost with his own free time."

www.aros3d.org
www.twitter.com/ddeadwood
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2009/5/15 13:18
From Naples, Italy
Group:
Member
Posts: 415
Offline
thx! i'll start from this!

Posted on: 2012/12/30 14:23
_________________
Somethin'nothin'o'u have: a working MPS1550 (Commodore Dot Matrix Color Printer) :p:p:p &
1 "amiga computer of the year 1986" sticker with an original 1987 coffee stain upon it!!!
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2012/1/16 5:57
Group:
Member
Posts: 260
Offline
Quote:

deadwood wrote:
First difference is that in both methods stack assigned to the program is different. When running from Wanderer stack is set on icon, when running from shell, stack is taken from environment configuration.


I've checked if there's a difference in stack availability when starting from icon or from CLI (on a recent nightly build). In both cases it is 40960 bytes. In Icaros the stack available is 1024000 bytes.

Weird thing, I've tried changing the default stack either using the STACK command in the ToolTypes tab of my application's icon or from CLI, but in both cases it seems it has no effect; what am I doing wrong?

The check is done executing FindTask() as specified here:
http://en.wikibooks.org/wiki/Aros/Dev ... r/Docs/Examples/StackSwap

The avail flush command crashes the nightly build.

thanks

Posted on: 2012/12/30 18:07
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2008/1/7 12:41
From Poland
Group:
Member
Posts: 2304
Offline
I'm not sure if STACK tooltype is handled. Using Info on icon, on first tab you will have separate field for stack.

Try running your application and then invoke tasklist from shell. This command also shows stack allocated to each process/task.

Posted on: 2012/12/31 0:08
_________________
Krzysztof

"There is no such thing as software for free. If it is not the user who covers the cost of software creation with money, it is the developer who covers this cost with his own free time."

www.aros3d.org
www.twitter.com/ddeadwood
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2008/1/7 12:41
From Poland
Group:
Member
Posts: 2304
Offline
If I do the following:

Create shell

> Stack 512000
> TaskList

Than in output I see TaskList process with 512000 stack.

Posted on: 2012/12/31 0:10
_________________
Krzysztof

"There is no such thing as software for free. If it is not the user who covers the cost of software creation with money, it is the developer who covers this cost with his own free time."

www.aros3d.org
www.twitter.com/ddeadwood
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2011/9/25 1:23
From Hungary
Group:
Member
Posts: 1297
Offline
If you want a consistent stack size in shell and wanderer, without messing with the stack command or the icon, you can use my header. Just define a global variable named __stack (a'la LibNIX), and include the header. If the stack size is smaller then the one you defined it'll allocate memory for it. A couple of shell commands which need large stack do this.

Attach file:


h incstack.h Size: 1.30 KB; Hits: 54

Posted on: 2012/12/31 3:57
_________________
My AROS&MorphOS ports
Arguments that explain everything... explain nothing.
Transfer the post to other applications Transfer


Re: Run an app: shell vs wanderer

Joined:
2012/1/16 5:57
Group:
Member
Posts: 260
Offline
@deadwood: you're right, the right way to set the stack size is from that specific field in the icon. Too obvious to even notice that

Also, I've noticed that stack size increments are automatically rounded in steps of four bytes (e.g. 40960, 40964, 40968, ...); I feel that it makes sense, but I don't quite understand why. Is it because if I could allocate 40961 instead of 40960 the remaining 3 bytes would be useless?

Thanks for clarifying this.

@BSzili: thanks, that'll come in handy. I've also stumbled upon your posts in the other thread about temporary stack allocation, your suggestions helped me too!

Posted on: 2013/1/1 9:49
Transfer the post to other applications Transfer






You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
3631
2 nikolaos
nikolaos
3451
3 phoenixkonsole
phoenixkonsole
2959
4 magorium
magorium
2851
5 deadwood
deadwood
2304
6 mazze
mazze
2055
7 clusteruk
clusteruk
2052
8 ncafferkey
ncafferkey
2047
9 damocles
damocles
1787
10 Kalamatee
Kalamatee
1709
© 2004-2013 AROS Exec