Hi,
I am using sun's CC (c++ compiler) to compile the follow code:
#define __REENTRANT
#include <stdio.h>
#include <pthread.h>
void *one(void *dummy);
void two(void);
void output(void);
int main (int argc, char **argv)
{
pthread_t tid;
pthread_create( &tid, NULL, one, NULL );
pthread_join(tid,NULL);
}
void *one(void *dummy)
{
output();
two();
return NULL;
}
void two(void)
{
output();
}
void output(void)
{
//char string[16468]; //This one purify likes
//char string[16469]={0}; //This and greater makes purify spit
BSW's
char string[16469]; //This and greater makes purify spit a
IPW/R's
string[0]='\0';
}
This is purify's output:
IPW: Invalid pointer write
This is occurring while in thread 7:
void output() [testmain3.o]
void two() [testmain3.o]
void*one(void*) [testmain3.o]
_thread_start [libthread.so.1]
Writing 1 byte to 0x7e5fbbef on the stack of thread 7.
Address 0x7e5fbbef is 16473 bytes below frame pointer in
function void output().
Thread Summary : 7 threads in existence
Thread 0 [main thread]
Stack Limit : (0xff3f0000 0xffbf0000), size = 0x800000
Thread 1
Stack Limit : (0x7ef10000 0x7f010000), size = 0x100000
Stack Use : (0x7f00fa30 0x7f00fd54), size = 0x324
Thread 2
Stack Limit : (0x7e652000 0x7e656000), size = 0x4000
Stack Use : (0x7e655978 0x7e655d54), size = 0x3dc
Thread 3
Stack Limit : (0x7f902b64 0x7f91e3f8), size = 0x1b894
Stack Use : (0x7f9076d0 0x7f9078f4), size = 0x224
Thread 4
Stack Limit : (0x7ee0e000 0x7ef0e000), size = 0x100000
Stack Use : (0x7ef0db30 0x7ef0dd54), size = 0x224
Thread 6
Stack Limit : (0x7e612000 0x7e616000), size = 0x4000
Stack Use : (0x7e615b28 0x7e615d54), size = 0x22c
Thread 8
Stack Limit : (0x7e632000 0x7e634000), size = 0x2000
Stack Use : (0x7e633b28 0x7e633d54), size = 0x22c
This is with CC. With gcc or g++ it does not have this problem. cc has
the problem too but with a larger number in the array.
Is it the compiler/linker bug or it purify making things up?
If it is the compiler I assume I am screwing up memory badly.
Matt 6 2638
Matthew wrote: Hi,
I am using sun's CC (c++ compiler) to compile the follow code:
#define __REENTRANT #include <stdio.h> #include <pthread.h>
void *one(void *dummy);
void two(void); void output(void);
int main (int argc, char **argv) { pthread_t tid; pthread_create( &tid, NULL, one, NULL ); pthread_join(tid,NULL); }
void *one(void *dummy) { output(); two(); return NULL; }
void two(void) { output(); }
void output(void) { //char string[16468]; //This one purify likes //char string[16469]={0}; //This and greater makes purify spit BSW's char string[16469]; //This and greater makes purify spit a IPW/R's string[0]='\0'; }
This is purify's output:
IPW: Invalid pointer write This is occurring while in thread 7: void output() [testmain3.o] void two() [testmain3.o] void*one(void*) [testmain3.o] _thread_start [libthread.so.1] Writing 1 byte to 0x7e5fbbef on the stack of thread 7. Address 0x7e5fbbef is 16473 bytes below frame pointer in function void output().
Thread Summary : 7 threads in existence Thread 0 [main thread] Stack Limit : (0xff3f0000 0xffbf0000), size = 0x800000 Thread 1 Stack Limit : (0x7ef10000 0x7f010000), size = 0x100000 Stack Use : (0x7f00fa30 0x7f00fd54), size = 0x324 Thread 2 Stack Limit : (0x7e652000 0x7e656000), size = 0x4000 Stack Use : (0x7e655978 0x7e655d54), size = 0x3dc Thread 3 Stack Limit : (0x7f902b64 0x7f91e3f8), size = 0x1b894 Stack Use : (0x7f9076d0 0x7f9078f4), size = 0x224 Thread 4 Stack Limit : (0x7ee0e000 0x7ef0e000), size = 0x100000 Stack Use : (0x7ef0db30 0x7ef0dd54), size = 0x224 Thread 6 Stack Limit : (0x7e612000 0x7e616000), size = 0x4000 Stack Use : (0x7e615b28 0x7e615d54), size = 0x22c Thread 8 Stack Limit : (0x7e632000 0x7e634000), size = 0x2000 Stack Use : (0x7e633b28 0x7e633d54), size = 0x22c
This is with CC. With gcc or g++ it does not have this problem. cc has the problem too but with a larger number in the array.
Is it the compiler/linker bug or it purify making things up?
If it is the compiler I assume I am screwing up memory badly.
Matt
man pthread_attr_setstackaddr
/J
Johan Lindh wrote: Matthew wrote:
Hi,
I am using sun's CC (c++ compiler) to compile the follow code:
#define __REENTRANT #include <stdio.h> #include <pthread.h>
void *one(void *dummy);
void two(void); void output(void);
int main (int argc, char **argv) { pthread_t tid; pthread_create( &tid, NULL, one, NULL ); pthread_join(tid,NULL); }
void *one(void *dummy) { output(); two(); return NULL; }
void two(void) { output(); }
void output(void) { //char string[16468]; //This one purify likes //char string[16469]={0}; //This and greater makes purify spit BSW's char string[16469]; //This and greater makes purify spit a IPW/R's string[0]='\0'; }
This is purify's output:
IPW: Invalid pointer write This is occurring while in thread 7: void output() [testmain3.o] void two() [testmain3.o] void*one(void*) [testmain3.o] _thread_start [libthread.so.1] Writing 1 byte to 0x7e5fbbef on the stack of thread 7. Address 0x7e5fbbef is 16473 bytes below frame pointer in function void output(). Thread Summary : 7 threads in existence Thread 0 [main thread] Stack Limit : (0xff3f0000 0xffbf0000), size = 0x800000 Thread 1 Stack Limit : (0x7ef10000 0x7f010000), size = 0x100000 Stack Use : (0x7f00fa30 0x7f00fd54), size = 0x324 Thread 2 Stack Limit : (0x7e652000 0x7e656000), size = 0x4000 Stack Use : (0x7e655978 0x7e655d54), size = 0x3dc Thread 3 Stack Limit : (0x7f902b64 0x7f91e3f8), size = 0x1b894 Stack Use : (0x7f9076d0 0x7f9078f4), size = 0x224 Thread 4 Stack Limit : (0x7ee0e000 0x7ef0e000), size = 0x100000 Stack Use : (0x7ef0db30 0x7ef0dd54), size = 0x224 Thread 6 Stack Limit : (0x7e612000 0x7e616000), size = 0x4000 Stack Use : (0x7e615b28 0x7e615d54), size = 0x22c Thread 8 Stack Limit : (0x7e632000 0x7e634000), size = 0x2000 Stack Use : (0x7e633b28 0x7e633d54), size = 0x22c
This is with CC. With gcc or g++ it does not have this problem. cc has the problem too but with a larger number in the array.
Is it the compiler/linker bug or it purify making things up?
If it is the compiler I assume I am screwing up memory badly.
Matt man pthread_attr_setstackaddr
/J
Uh, I meant
man pthread_attr_setstacksize
...(of course :P)
Johan Lindh wrote: Johan Lindh wrote: man pthread_attr_setstackaddr
/J
Uh, I meant
man pthread_attr_setstacksize
Do you know any newsgroups where threads are on topic ?
--
pete
pete wrote: Johan Lindh wrote:
Johan Lindh wrote:
man pthread_attr_setstackaddr
/J
Uh, I meant
man pthread_attr_setstacksize
Do you know any newsgroups where threads are on topic ?
Sure!
alt.sex.spam
Johan Lindh wrote: pete wrote:
Johan Lindh wrote:
Johan Lindh wrote:
man pthread_attr_setstackaddr
/J
Uh, I meant
man pthread_attr_setstacksize
Do you know any newsgroups where threads are on topic ?
Sure! alt.sex.spam
Then take your discussion to there.
--
pete This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tomer Ben-David |
last post by:
Hi
I downloaded purify.
Im running a simple hello world through purify on windows2000 machine.
However whenever the purify runs it i get in the console window:
Error occurred during...
|
by: Matthew |
last post by:
Hi,
I am using sun's CC (c++ compiler) to compile the follow code:
#define __REENTRANT
#include <stdio.h>
#include <pthread.h>
void *one(void *dummy);
|
by: grahamo |
last post by:
Hey,
maybe a little off topic but I'm running round in circles here...
I am aware of a couple of other memory tracking products out there but
I would like to know of ALL of them. So far I...
|
by: hcc |
last post by:
Hi,
Does anyone have experience with using Purify with db2 CLI
application? We're using Purify to diagnose some problem in our
multi-thread CLI application, and we're getting lots of the
"UMR:...
|
by: sangeetha_b |
last post by:
Hello,
I've writen one simple program to automate some manual process. I've
written that in c program. It works fine so far no problem reported on
this. Last week, i get chance to run my program...
|
by: eyh5 |
last post by:
Hi,
My C code (running on Soalris Unix) has some "segmentation fault"
that I wish to use purify to do it. I poked around the web, and found
some information about adding some lines in a Makefile...
|
by: saby |
last post by:
Can anybody knowing Rational Purify help me?
I am instrumenting an exe on solaris using Rational Purify.
While building the exe, known as "DPSRun", it does not give any problem.
But while I...
|
by: Teddy |
last post by:
Hey guyes I am getting problem with purify. I am using g++ compiler on
Solaris 5.10 and linking it with purify.
Whenever I compiled program with purify option I get CORE DUMP error
with message...
|
by: Achint Mehta |
last post by:
Hi,
I am running purify on my program (on linux with gcc ver. 3.4.6)
I have installed a signal handler (for timer) using sigaction.
I am passing a pointer (data) into the sival_ptr which I...
|
by: sudheer786 |
last post by:
A purify error while doing build is setup
--------------------------------------------------------------------------------
Hi all,
I was facing a strange error while trying to run my labeled...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |