stack size

2003-07-08 Thread mnicolet
May be this question is not strictly suited to this list, but I see lots of
people contributing from lots of different platforms.
The question regards to stack space management under different platforms, or
execution models.
Under my preferred platform ( QNX 4.25 ) stack space is allocated at process
creation, and remains fixed until process death. Thas is so because the data
segment layout leaves the heap on top, so it can grow easily. So, one must
guess how much stack would be needed, and give the figure to the linker.
The question is: are there some other ( not exotic, of course ) platforms
that allows stack growing on demand ? i.e the stack as one segment by its
own, which can be dynamically re-allocated during process lifetime ?
Thank you

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Re: stack size

2003-07-08 Thread mnicolet
- Original Message -
From: Matthieu Herrb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 3:52 AM
Subject: Re: stack size


 mnicolet wrote (in a message from Tuesday 8)
   May be this question is not strictly suited to this list, but I see
lots of
   people contributing from lots of different platforms.
   The question regards to stack space management under different
platforms, or
   execution models.

 On Unix-like systems (and I guess in modern MS Window too) the virtual
 memory system allows to allocate a large stack for each process. Real
 memory is used only as stack grows and as virtual addresses need to
 have real memory pages vired to them.

 There still is a physical fixed stack size limit, but it's generally
 set quite high.

 I don't know any system without shared memory that would behave this
 way. In VxWorks you specify the stack size at task creation and it's
 allocating memory from the global pool.

I forget to mention: QNX does use virtual memory, ( reliyng on the processor
for actual memory management ) but no disk paging.
So it behaves like VxWorks, i.e, early and _true_ stack allocation.

 Matthieu

Thank you.
You answered me what I was expecting: no system allows for a true or full
dynamic stack size.
Another wording: on every system one could reach some stack limit, and
therefore one migth care about this figure.
So, my true question comes into scene.
The people who ported XFree86 to QNX 4.x setted the stack size hint to the
Watcom linker to 4 Mb ( yes, 4 Mb ) for the server.
I am wondering why a so high figure. I tried to grep the sources searching
for some form of alloca usage ( the native one or a home brew, Postgresql
style ) without success. In fact, all what is malloc and free related is
coded using macros, which even appear redefined for some modules.
But what I cannot figure simply is the possible recursions, and/or giant
local objects.
Is there a true need for such stack size ?
marcelo

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re:: Re: stack size

2003-07-08 Thread mnicolet
Thank you. You pointed me back to documentation.
QNX 4.x does not page to disk. A philosophical question for a RTOS.
The only available memory is RAM. That´s why I care about everything.
But it offers two main process image layouts.
One that ´sandwiches´ the stack between the BSS and the heap, so the stack
memory must be allocated at process startup.
And another that leaves the stack at the low end of the data segment, so
even if hinted, the stack only grows as required. What you pointed me to. By
the way, the idea behind is that managing the stack in its own segment could
be prohibitive for a system without disk paging.
The question was I took the QNX options verbatim from the people who made
the porting, and
ended with a X server which at it´s very start was ´using´ more than 4 Mb of
data !!!
The right answer is to change compile and linking options, so even with a
generous limit, the stack would be dynamically allocated as required.
Than you again
- Original Message -
From: Tim Roberts [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 1:34 PM
Subject: Re: Re: stack size


 On Tue, 08 Jul 2003 10:13:06 -0300, mnicolet wrote:
 
 Thank you.
 You answered me what I was expecting: no system allows for a true or full
 dynamic stack size.

 If that's your interpretation, then I'm not sure what you mean by a full
 dynamic stack size.  All the operating systems he mentioned reserve
address
 space for a gigantic stack, but they only allocate physical memory as it
is
 needed.  Special tricks with guard pages are used to determine when a
new
 page of physical memory needs to be added to the stack.

 Another wording: on every system one could reach some stack limit, and
 therefore one migth care about this figure.

 Yes, of course.  Memory is not infinite, even on a 4GB system.

 So, my true question comes into scene.
 The people who ported XFree86 to QNX 4.x setted the stack size hint to
the
 Watcom linker to 4 Mb ( yes, 4 Mb ) for the server.
 I am wondering why a so high figure.

 I am wondering (1) why this figure seems high to you, and (2) why you are
 worried about it?  The stack doesn't actually use 4MB of physical memory.
It
 only uses the memory that is required.

 X11 is a thoroughly modular and layered server.  It nests extremely
deeply --
 much more deeply than a typical application.  I'm not saying 4MB is
 absolutely necessary, but if cutting it to 1MB causes even a single crash,
 what's the point?

 Is there a true need for such stack size ?

 Who cares?

 --
 - Tim Roberts, [EMAIL PROTECTED]
   Providenza  Boekelheide, Inc.


 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://XFree86.Org/mailman/listinfo/devel

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: twm makes uninitialized memory access after malloc()

2003-07-06 Thread mnicolet
Some time ago, I posted a question regarding twm crash.
I was not able to reproduce it after, but I don´t played more than a few
minutes.
Later, some one told me that twm is inherently weak, and pointed me to fvwm.
My concern was mainly because I am new to X Windows, and I was fearing
regarding my build of XFree86 4.2.0 ( even if all went ok with make World
after two or three minor hacks ).
I build and intend to use it on a QNX 4.25 platform which has some
departures from a standard *NIX: lack of UNIX sockets ( only INET ) and lack
of shared libraries. Also, because other questions I build the whole thing
using register calling convention.
So, the crash of twm troubled me. But it must be noted that the crash
happened after some time of
execution, not at the very start.
Regards
M Nicolet
- Original Message -
From: Egbert Eich [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 04, 2003 9:50 AM
Subject: twm makes uninitialized memory access after malloc()


 We have a report in Bugzilla (#464), concerning twm. This test can
 only be made on NetBSD:

 ===
 if you set /etc/malloc.conf to AJ (fill malloc'ed region with random
value),
 twm crashes occasionary.  i'm yet to find out a concrete way to repeat the
 symptom, however, it seems that twm (or some library) is touching
 malloc'ed memory region without initialization.
 ===

 Could somebody with NetBSD please try to reproduce this?
 I'd at least need a debugger backtrace to get a clue where the
 problem may be.

 Egbert.
 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://XFree86.Org/mailman/listinfo/devel

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: twm stop run

2003-06-09 Thread mnicolet
Hello Frank
Thank you for your answer to the twm question. I am considering fvwm, but I
was urged to test
fltk. And that urgency was because before of fltk, I tried FOX, with all
tests SIGSEGVing at the
very start. So, I was doubting regarding my compilation environment for X.
I was trying to contact you or another qnx port team member to ask some
basic questions.
If you don´t take this as abuse, now that I know your mailbox, I would like
to ask those again,
and directing this mail to you and not the list, because I think this is
very specific to QNX 4.x.
I tried first the binary distribution from the jcmichot page, but that
failed to run, ( later I learned why
: it was trying to open a unix socket for local connections ), then I
compiled XFree86 4.2 from source, under these restrictions:
1) I don´t have libcrypt, only login, and only in 3r ( login3r.lib ).
2) I have only TCP/IP 4.23 and 4.25 run times, so, no Unix sockets.
Then, I adapted QNX4.cf to this environment, eliminating UNIXCONN and
changing compiling options to -5r.
Also, I needed to ´touch´ some sources and makefiles ( If you consider these
interesting, I can post you the changes - in fact, one is to my judge, very
important ). All went ok, and, as you could see
from my posting to the list, I have a functional X environment. But some
questions arise
1 - the most intriguing: why the so big stack ( if you remember, QNX4.cf
forces XFree86 linking to
 -N4096000 ). I tried to figure out if some modules are using alloca, but
the allocation coding is so
deep wrapped with macros ( also redefined ) that it proves a useless or
unsure path. So, I am asking to the people who knows. The main question is
that under the QNX 4 execution model, the stack
is allocated as hinted, even if the process don´t need all the space. After
a while, the data segment continues to grow - some 1 Mb more, I guess. This
is ok, because obviously, some data is allocated from heap. But I am asking
me if the stack remains largely unused.
2 - from the binary distribution, I see some clients ( xqsh, by example )
whose sources are not in the
source tree from xfree.org. Is there a way to get those specific QNX clients
sources ? Of course, the main question is keyboard management, I guess.
3 - Some more general xfree distribution question: I noted that cpp is not
in the source tree. Thankfully, I had it from the binary previously
installed. How could I obtain the source ?

Thank you in advance
Regards
Marcelo Nicolet
- Original Message -
From: Frank Liu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 09, 2003 1:59 AM
Subject: Re: twm stop run


 possibly a twm bug, I would suggest trying another window manager
 like fvwm.



___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


twm stop run

2003-06-08 Thread mnicolet
Hello
I am a newbie to X.
I compiled from source the 4.2 version, on QNX 4.25, using TCP/IP 4.23
suite, with Watcom 10.6.
All works fine, except when I was testing fltk 1.1.4rc1. Running one of the
tests,
( specifically, the ´tile´ test/demo for those who know the toolkit )
suddenly all twm decorations gone, leaving all windows intact.
Also, a previous test window appeared. Of course, a ps run showed that twm
was not running.
I could shutdown all the thing normally, because my last xterm was in the
foreground.
Later, I tried to reproduce the behaviour, with no success. Also, I
redirected twm´s stdout and stderr to files trying to catch some error
message.
What I don´t know if this may be a twm ´glitch´ ( flaw ? ) or a fltk one.
Could someone help me regarding
a) How to catch twm errors/warnings ( is there a specific log option ? )
b) Has twm some known weaknesses ?
c) migth the twm failure be caused by a XFree86 misbehaviour due to my
specific platfform/compile combination ? which one (s) ?
d) has the fltk toolkit some known flaws ?


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


qnx 4.x porting

2003-05-30 Thread mnicolet
Hello
This mail is mainly for the people that made the QNX4 porting, but may be
someone may help.

I am a newbie to X. I downloaded and successfully installed XFree86 R6,
Version 4.2.0 on
QNX 4.25, using Watcom 10.6 Patch B from QSSL. I managed to run it even on
TCP/IP 4.23 ( no unix sockets ) by ´telling´ the server not to use UNIXCONN,
but only TCPCONN.
Also, because I don´t have crypt, nor login3s.lib ( only the 3r version ) I
changed the related option to wcc, by using -5r, and changing the -l option
to that library.

My question regards about the ´giant´ stack size for the Xserver: 4 Mb is a
lot ! and I am intrigued why this enormous stack. I tried to dive the
sources for an intensive use of alloca, but to no clear
result.
Could someone ( the QNX porting authors, or someone else ) tell me if I can
confidently reduce the
stack size, and in such a case, which should be a reasonable figure ?
Note, for not QNX/Watcom users: the -xr ( i.e, -5r ) tells the compiler to
generate functions calls using registers where possible, as opposed to -xs,
which directs it to only use the stack for argument passing. With all the
code generated this way, the stack usage is greatly reduced. So, the only
source for a big stack need could come from very large/deep recursive calls,
from large locals, or from alloca usage.
Thank you
Marcelo Nicolet
PS. Incidentally ... when compiling in -xr mode, Watcom reports an error
whenever a function call
does not follows the prototype ( except, of course, it´s declared as
variadic ).
This was the case in lib/X11/omGeneric.c, line 1129, when calling
parse_fontdata( ), which I easily corrected adding a dummy FontDataRec
argument.
PS2. For those potentially interested: Aside the correction mentioned above,
I made another important one ( again, Watcom stuff ) to .../BUSmemcpy.c, and
to a few Makefiles.
The changes are somewhat brute force, so I am not sure how I can contribute
them to the main
source tree.


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel