* Re: Strange pointer addresses causing SEGV
[not found] ` <5pX68.2722$3E5.240464@newsread2.prod.itd.earthlink.net>
@ 2002-02-02 20:14 ` Big H
2002-02-02 22:39 ` Paul Pluzhnikov
0 siblings, 1 reply; 3+ messages in thread
From: Big H @ 2002-02-02 20:14 UTC (permalink / raw)
On Sat, 02 Feb 2002 19:49:21 GMT, "Paul Pluzhnikov"
<ppluzhnikov@earthlink.net> wrote:
>"Big H" <haystacks@bigfoot.com> wrote in message
>news:bnbn5u8ja8v7inn5de524k9fb1v4k6tldg@4ax.com...
>
>> However, I have made some progress and the problem seems to be related
>> to the static functions being called containing a ostrstream. The
>> functions are stored in a collection of pointers to functions.
>>
>
>Now, this sounds interesting, as I have a totally
>different (and non-threaded) program, in which I have
>isolated stack corruption to the exact same ostream
>constructor:
>
>> This was the original:
>>
>> static int
>> f_readData1 ( DbObject* in_object, CORBA::any& out_value )
>> {
>> char buf[MAX_BUF_SIZE];
>>
>> ostrstream ( buf, sizeof(buf) );
>>
>
>In my case changing to:
>
> char buf[MAX_BUF_SIZE+40];
> ostrstream(buf, MAX_BUF_SIZE];
>
>made the corruption go away.
>
>> static int
>> f_readData1 ( DbObject* in_object, CORBA::any& out_value )
>> {
>> auto_ptr<char*> buf ( new char[MAX_BUF_SIZE] );
>> ostrstream ( buf.get(), MAX_BUF_SIZE );
>...
>> This works correctly!!!
>>
>
>It probably doesn't "work correctly", it's just that
>the problem has moved elsewhere (and corrupted memory
>happens to be unimportant). You are compiling with 'cxx',
>aren't you?
Yes, was compiling with cxx v6.1-029. I read release notes for latest
version and that mentioned about problems with streams and thread so i
loaded it. Then spent 6 hours rebuilding the code! using 6.3a compiler
and got exactly the same result - SEGV.
argh......
>
>I am still trying to determine root cause (my program is
>also big, and smaller examples do not demonstrate the problem).
This too is a large program, when running it is in excess of 500mb.
>
>[I do not think this has anything to do with threads,
>Follow-up set to comp.unix.tru64]
>
As far as i can see it seems thread related as this code has been
running on several production systems for several years. This problem
only arises when I'm trying to access the data from a separate thread.
Also, the fact that the address of the arguments seems to be shifted
is strange, as it only does this for the static functions containing
the ostream constructor.
I certainly can't afford for the problem to be moved!
Which version of the compiler were you using?
Cheers,
Big H
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange pointer addresses causing SEGV
2002-02-02 20:14 ` Strange pointer addresses causing SEGV Big H
@ 2002-02-02 22:39 ` Paul Pluzhnikov
2002-02-02 23:14 ` Big H
0 siblings, 1 reply; 3+ messages in thread
From: Paul Pluzhnikov @ 2002-02-02 22:39 UTC (permalink / raw)
"Big H" <haystacks@bigfoot.com> wrote in message
news:gqho5u81e2rk46mnkiskje8qunuefpgim8@4ax.com...
> >You are compiling with 'cxx',
> >aren't you?
>
> Yes, was compiling with cxx v6.1-029. I read release notes for latest
> version and that mentioned about problems with streams and thread so i
> loaded it. Then spent 6 hours rebuilding the code! using 6.3a compiler
> and got exactly the same result - SEGV.
I used "Compaq C++ V6.2-024 for Digital UNIX V4.0E (Rev. 1091)"
initially, then upgraded to
"Compaq C++ V6.3-008 for Digital UNIX V5.0 (Rev. 910)" which I
think is the latest ... The problem shift a little bit between the
two versions, but the clues pointing to ostream() remain.
> Also, the fact that the address of the arguments seems to be shifted
> is strange, as it only does this for the static functions containing
> the ostream constructor.
So run under ladebug, stop in the static function before
ostream is constructed, examine arguments (they should be correct),
step over the ostream constructor, and examine arguments again...
In my case it is actually return address, not arguments, that
gets corrupted. Unfortunately ostream ctor executes a lot of code ...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange pointer addresses causing SEGV
2002-02-02 22:39 ` Paul Pluzhnikov
@ 2002-02-02 23:14 ` Big H
0 siblings, 0 replies; 3+ messages in thread
From: Big H @ 2002-02-02 23:14 UTC (permalink / raw)
On Sat, 02 Feb 2002 22:39:08 GMT, "Paul Pluzhnikov"
<ppluzhnikov@earthlink.net> wrote:
>"Big H" <haystacks@bigfoot.com> wrote in message
>news:gqho5u81e2rk46mnkiskje8qunuefpgim8@4ax.com...
>> >You are compiling with 'cxx',
>> >aren't you?
>>
>> Yes, was compiling with cxx v6.1-029. I read release notes for latest
>> version and that mentioned about problems with streams and thread so i
>> loaded it. Then spent 6 hours rebuilding the code! using 6.3a compiler
>> and got exactly the same result - SEGV.
>
>I used "Compaq C++ V6.2-024 for Digital UNIX V4.0E (Rev. 1091)"
>initially, then upgraded to
>"Compaq C++ V6.3-008 for Digital UNIX V5.0 (Rev. 910)" which I
>think is the latest ... The problem shift a little bit between the
>two versions, but the clues pointing to ostream() remain.
>
>> Also, the fact that the address of the arguments seems to be shifted
>> is strange, as it only does this for the static functions containing
>> the ostream constructor.
>
>So run under ladebug, stop in the static function before
>ostream is constructed, examine arguments (they should be correct),
>step over the ostream constructor, and examine arguments again...
>
I did, had to step through instruction at a time as it crashed
entering the function, don't even reach the ostream constructor.
>In my case it is actually return address, not arguments, that
>gets corrupted. Unfortunately ostream ctor executes a lot of code ...
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-02-02 23:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <943a15cc.0201290533.598aa1a7@posting.google.com>
[not found] ` <bnbn5u8ja8v7inn5de524k9fb1v4k6tldg@4ax.com>
[not found] ` <5pX68.2722$3E5.240464@newsread2.prod.itd.earthlink.net>
2002-02-02 20:14 ` Strange pointer addresses causing SEGV Big H
2002-02-02 22:39 ` Paul Pluzhnikov
2002-02-02 23:14 ` Big H
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox