Share memory with Pro C?

Share memory with Pro C?

Post by root » Sun, 31 Dec 1899 09:00:00



I have 2 simple C programm share one share memeory segment, and they
must operate Oracle 8.0.5 database. The server process create and attach

one memory segment, and the client process attach the same segment to
read/write data. When I compile and link them using gnu tools or ansi C
tools, they work quite successfully. But becase they must operate
database, once we compile them together with Pro C, the server can
create and attach the segment, but the client cann't attach to the same
segment, quite puzzling.

I have tried on HP-UX 11.0 with Oracle 8.0.5 and SuSe Linux 6.0 with
Oracle 8.0.5, the result are the same.

What the problem and how to fix it?

Thanks...

David

 
 
 

1. CS/CT-lib: memory leaks

Running this simple program with Purify 3.0, I have noticed unexplicable memory
leaks (19 bytes):

#include <stdlib.h>
#define COMPILE_STYLE CPP_COMPILE
#include <ctpublic.h>

void main()
{
        CS_RETCODE      retcode;
        CS_CONTEXT    *_context;

   _context = NULL;

   // Allocates structure for _context.
   if ((retcode = cs_ctx_alloc(CS_VERSION_100,
                               &_context)) != CS_SUCCEED)
                               exit(1);

   // Initialize Open Client.
   if ((retcode = ct_init(_context,
                          CS_VERSION_100)) != CS_SUCCEED)
   {
      (void)cs_ctx_drop(_context);
      _context = NULL;
         exit(1);
   }

   if (((retcode = ct_exit(_context,
              CS_FORCE_EXIT)) != CS_SUCCEED) ||
       ((retcode = cs_ctx_drop(_context)) != CS_SUCCEED))
         exit(1);
   exit(0);

Purify shows 19 bytes leaked with this stack:

        This memory was allocated from:
               malloc         [rtlib.o]
               net_init       [libtcl.sl]
               np_init        [libct.sl]
               ct_gp_init     [libct.sl]
               uwss_999       [libct.sl]
               ct_init        [libct.sl]

Is there anyone that has experienced this problem ?
I am working with HP C++ compiler and Sybase version 10.0.2 with CT-lib ver.
5.0
(I read the file ctpublic.h).
TIA,
Filippo

--
| Filippo Onorato            | Senior Software Engineer    |
| via dei Castori 13         | Sodalia S.p.A.              |
| Martignano, 38040 Trento   | via Brennero 364 38100 TN   |

2. Storing Large Text Docs in SQL Server

3. Shared Memory Size vs Physical Memory Size

4. MS Query

5. error 55 [Shared memory]ConnectionWrite(WraperWrite())

6. - How to create a list on which the user can reorder the entries?

7. Shared Memory Connection Write WrapperWrite()

8. W32MKDE.EXE (Local) Performance hints?

9. ADO connection using Shared Memory

10. Shared Memory Error!!

11. Shared Memory Error

12. SqlServer via Shared Memory: Security Hole?

13. shared memory