* Urgent Problem: Sybase Threads on OSF1 Alpha
@ 1998-05-12 4:00 c.eltawil
1998-05-13 4:00 ` Don Melano
1998-05-15 4:00 ` Brian Ceccarelli
0 siblings, 2 replies; 4+ messages in thread
From: c.eltawil @ 1998-05-12 4:00 UTC (permalink / raw)
Hi,
We have an application that was written with Sybase threads.
After porting it to a DEC Alpha machine, there seems to be a problem,
here it is:
2 different threads are calling the same function
some variables declared local as automatic in that function are corrupted
(doesn't thread has a stack of its own)
Anybody has ever experirnced this or has any insights.
thanks in advance
BTW: that problem does not appear on other platforms (HP, Sun, IBM).
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Urgent Problem: Sybase Threads on OSF1 Alpha
1998-05-12 4:00 Urgent Problem: Sybase Threads on OSF1 Alpha c.eltawil
@ 1998-05-13 4:00 ` Don Melano
1998-05-15 4:00 ` Brian Ceccarelli
1 sibling, 0 replies; 4+ messages in thread
From: Don Melano @ 1998-05-13 4:00 UTC (permalink / raw)
c.eltawil@architel.com wrote:
>
> Hi,
> We have an application that was written with Sybase threads.
> After porting it to a DEC Alpha machine, there seems to be a problem,
> here it is:
>
> 2 different threads are calling the same function
> some variables declared local as automatic in that function are corrupted
> (doesn't thread has a stack of its own)
>
> Anybody has ever experirnced this or has any insights.
>
> thanks in advance
>
> BTW: that problem does not appear on other platforms (HP, Sun, IBM).
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
According to Kernighan & Ritchie "The C Programming Language":
"automatic variables come and go with function invocation, they do not
retain their values from one call to the next, and must be explicity
set upon each entry. If they are not set, they will contain garbage."
Also note according to David Butenhof's book "Programming with POSIX
Threads" that all threads within a process share the same address space
and that any variable declared as "static" or "extern", or in the
"process heap", may be read and written by all threads within the
process.
Hope this helps.
--
Don Melano
Computer Sciences Corp.
Advanced Technology Divison
Edwards Air Force Base, Flight Test Center, CA.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Urgent Problem: Sybase Threads on OSF1 Alpha
1998-05-12 4:00 Urgent Problem: Sybase Threads on OSF1 Alpha c.eltawil
1998-05-13 4:00 ` Don Melano
@ 1998-05-15 4:00 ` Brian Ceccarelli
1998-05-19 4:00 ` Michael Zarlenga
1 sibling, 1 reply; 4+ messages in thread
From: Brian Ceccarelli @ 1998-05-15 4:00 UTC (permalink / raw)
c.eltawil@architel.com wrote:
>
> Hi,
> We have an application that was written with Sybase threads.
> After porting it to a DEC Alpha machine, there seems to be a problem,
> here it is:
>
> 2 different threads are calling the same function
> some variables declared local as automatic in that function are corrupted
> (doesn't thread has a stack of its own)
>
> Anybody has ever experirnced this or has any insights.
Local automatic variables are indeed on the stack and are
unique to your function. Perhaps you have a memory leak
elsewhere in your code. These variables may be getting
stepped on by something totally unrelated. This problem
may only appear on the DEC Alpha because its compiler
may put things in memory differently in such a way to
expose your problem.
If this is an Open Server application, you may experiment
by messing with the SRV_S_STACKSIZE via srv_prop(). Strange
things start to happen when the stack size limit is
approached.
If this is a straight Open Client app, my guess is that
you do indeed have a memory-stomping problem coming
from who-knows-where.
In either case, I'd hate to be in your shoes right now! :)
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Urgent Problem: Sybase Threads on OSF1 Alpha
1998-05-15 4:00 ` Brian Ceccarelli
@ 1998-05-19 4:00 ` Michael Zarlenga
0 siblings, 0 replies; 4+ messages in thread
From: Michael Zarlenga @ 1998-05-19 4:00 UTC (permalink / raw)
: > We have an application that was written with Sybase threads.
: > After porting it to a DEC Alpha machine, there seems to be a problem,
: > here it is:
: >
: > 2 different threads are calling the same function
: > some variables declared local as automatic in that function are corrupted
: > (doesn't thread has a stack of its own)
Yes, each Sybase thread has its own stack.
Did you get any error messages or warnings abut your stack
becoming corrupted? The default stack is approx 35K and if
you have a couple of thread-safe routines that handle large
structures or strings, you may corrupt your own stack. You
can increase this with srv_props(). I create my Open Servers
with twice the default stacksize (69632 bytes)
Before you bump the stacksize... install error and message
handlers if you haven't yet. Look CLOSELY at their output
for any hints regarding this problem.
By the way, do any of your functions walk the stack to grab
arguments? Just what do you mean by some automatic variables
are "corrupted?" What exactly is wrong with them?
--
-- Mike Zarlenga
finger zarlenga@conan.ids.net for PGP public key
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-05-19 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-12 4:00 Urgent Problem: Sybase Threads on OSF1 Alpha c.eltawil
1998-05-13 4:00 ` Don Melano
1998-05-15 4:00 ` Brian Ceccarelli
1998-05-19 4:00 ` Michael Zarlenga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox