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?




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>
#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)

   // Initialize Open Client.
   if ((retcode = ct_init(_context,
                          CS_VERSION_100)) != CS_SUCCEED)
      _context = NULL;

   if (((retcode = ct_exit(_context,
              CS_FORCE_EXIT)) != CS_SUCCEED) ||
       ((retcode = cs_ctx_drop(_context)) != CS_SUCCEED))

Purify shows 19 bytes leaked with this stack:

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

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.
(I read the file ctpublic.h).

| 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