multithreaded application, internal heap error

multithreaded application, internal heap error

Post by Andreas Ledere » Thu, 21 Mar 2002 02:17:12



hallo!

i have some troubles with porting my applikation
from windows to aix.

under windows there are no problems with my application (i have
tested this with rational purify).

now, on aix 4.3.3 with oracle 8.1.7 the application is very
instable, crashing sometimes with core dump sometimes with
internal heap error ...

the application is c++ compiled with xlC (vacpp 5.0.2) and
dynamically loads a c++ shared library which have the oracle
functionality.

the oracle functionality is written with embedded sql
and precompiled with proc version "Pro*C/C++: Release 8.1.7.0.0" then
compiled with xlC and linked with libclntsh.
the following options are set for proc:
                sys_include=$(ORACLE_HOME)/oci/include \
                sys_include=$(ORACLE_HOME)/plsql/public \
                sys_include=$(ORACLE_HOME)/plsql/demo \
                sys_include=$(ORACLE_HOME)/rdbms/demo \
                sys_include=$(ORACLE_HOME)/precomp/public \
                define=__STDC__ \
                hold_cursor=no \
                release_cursor=yes \
                threads=yes \
                objects=no \
                code=CPP \
                parse=partial

i also tried to compile with oraxlc which has the same effect.

are there some known bugs??

when i not explicity set hold_cursor or release_cursor

i get the following heap error when selecting:
    exec sql at :Og_Database_Name declare sql_command_1 STATEMENT;

    exec sql prepare sql_command_1 from :select_string;

    if (sqlca.sqlcode != 0) break;

    exec sql declare sql_cursor_1 cursor for sql_command_1;

    if (sqlca.sqlcode != 0) break;

    exec sql open sql_cursor_1 using descriptor Og_Sqlda_Bind_1_Ptr;

    if (sqlca.sqlcode != 0) break;
    exec sql describe select list for sql_command_1 into
sqlda_select_ptr;

********** Internal heap ERROR 17114 addr=0x95 *********

***** Dump of memory around addr 0x95:
000 00000000 00000000 00000000 00000000  [................]
        Repeat 15 times
100 7DF143A6 7DF042A6 F80F00C8 4808C402  [}.C.}.B.....H...]
110 7DF142A6 7DF143A6 7DF042A6 F8CF02C0  [}.B.}.C.}.B.....]
120 E9EF02B8 7CC00026 2C2F0000 41820010  [....|..&,/..A...]
130 7CCFF120 38C00101 48090BAE 7CCFF120  [|.. 8...H...|.. ]
140 7CDB02A6 39E00002 7CC67878 7CDB03A6  [|...9...|.xx|...]
150 7DF042A6 E8CF02C0 F80F00C8 4808C402  [}.B.........H...]
160 41820094 818D01F0 39400000 7D896010  [A.......9@..}.`.]
170 314A0001 2C0C0000 4181FFF4 81060010  [1J..,...A.......]
180 7D034014 81680000 7D6E0034 7D4E5011  [}.@..h..}n.4}NP.]
190 40810064 2C0B0000 4082000C 31080004  [@..d,...@...1...]
1A0 4BFFFFE4 82270034 76250800 3CE05590  [K....'.4v%..<.U.]
1B0 4082003C 3CA08204 60A50080 7CAF01A4  [@..<<...`...|...]
1C0 3D00F0A0 7CA000A6 60A60010 7CC00124  [=...|...`...|..$]
1D0 4C00012C 90E80300 7CA00124 7CA52A78  [L..,....|..$|.*x]
1E0 7CAF01A4 4C00012C 7C0004AC 48000000  [|...L..,|...H...]
1F0 00208DD4 802D00C0 804D00C4 7C42682E  [. ...-...M..|Bh.]
200 7DF143A6 7DF042A6 F8CF02C0 E9EF02B8  [}.C.}.B.........]
210 7CC00026 2C2F0000 41820010 7CCFF120  [|..&,/..A...|.. ]
220 38C00200 48090BAE 7CCFF120 7CDB02A6  [8...H...|.. |...]
230 39E00002 7CC67878 7CDB03A6 7DF042A6  [9...|.xx|...}.B.]
240 E8CF02C0 F80F00C8 4808C3D2 3820FFFC  [........H...8 ..]
250 304DFFFC 39C000B8 76250800 40820024  [0M..9...v%..@..$]
260 84C20004 94C10004 7C0008EC 7C017000  [........|...|.p.]
270 4180FFF0 7C0004AC 4C00012C 4800002A  [A...|...L..,H..*]
280 84C20004 94C10004 7C0008AC 7C0004AC  [........|...|...]
290 7C000FAC 7C017000                    [|...|.p.]        

******************************************************
HEAP DUMP heap name="Alloc statemen"  desc=0x204c2814
 extent sz=0x0 alt=32767 het=32767 rec=32 flg=76 opc=6
 parent=204c2434 owner=20477974 nex=0 xsz=0xd4c0a924
EXTENT 0
ERROR extent contains wrong ds 0
  Chunk       bc sz=        0  ERROR, BAD MAGIC NUMBER (0)
Total heap size    =        0
FREE LISTS:
 Bucket 0 size=272
 Bucket 1 size=528
 Bucket 2 size=0
 Bucket 3 size=4412160
 Bucket 4 size=541552312
 Bucket 5 size=0
 Bucket 6 size=2571
 Bucket 7 size=541862004
 Bucket 8 size=22
 Bucket 9 size=0
 Bucket 10 size=524288
 Bucket 11 size=0
 Bucket 12 size=0
 Bucket 13 size=0
 Bucket 14 size=0
 Bucket 15 size=541865212
 Bucket 16 size=0
 Bucket 17 size=25165824
 Bucket 18 size=0
 Bucket 19 size=65792
 Bucket 20 size=134217728
 Bucket 21 size=0
 Bucket 22 size=10
 Bucket 23 size=0
 Bucket 24 size=589824
 Bucket 25 size=0
 Bucket 26 size=0
 Bucket 27 size=0
 Bucket 28 size=0
 Bucket 29 size=541865240
 Bucket 30 size=0
 Bucket 31 size=25165824
 Bucket 32 size=0
 Bucket 33 size=65792
 Bucket 34 size=541862480
 Bucket 35 size=0
 Bucket 36 size=35
 Bucket 37 size=0
 Bucket 38 size=17498112
 Bucket 39 size=0
 Bucket 40 size=540397481
 Bucket 41 size=4043400032
Total free space   =        0
UNPINNED RECREATABLE CHUNKS (lru first):
  Chunk 204c23d8 sz=  2798280  ERROR, BAD MAGIC NUMBER (d02ab2c8)
Unpinned space     =        0  rcr=11 trn=541860928
PERMANENT CHUNKS:
Permanent space    =        0
******************************************************
 Hla: 0

**** Recursive heap error: 17113 addr=0x0, ds=0

second run, different statement
 exec sql fetch sql_cursor_1 using descriptor sqlda_select_ptr;

********** Internal heap ERROR 17112 addr=0x204c3580 *********

***** Dump of memory around addr 0x204c3580:
204C3380 00000000 00000000 00000000 00000000  [................]
        Repeat 4 times
204C33D0 204C34B0 00000000 00000000 00000000  [ L4.............]
204C33E0 00000000 F0043C08 00000000 00000000  [......<.........]
204C33F0 00000000 00000000 00000000 00000000  [................]
204C3400 C0000075 204C3328 204C250C 204C250C  [...u L3( L%. L%.]
204C3410 00000000 00000000 00000000 00000000  [................]
        Repeat 5 times
204C3470 00000000 200000C5 204C3400 00000000  [.... ... L4.....]
204C3480 00000000 73656C65 6374202A 2066726F  [....select * fro]
204C3490 00000008 0000007B 204BE88E 43542077  [.......{ K..CT w]
204C34A0 68657265 2028676F 00000026 20496618  [here (go...& If.]
204C34B0 204C3500 206F7220 D4C474A0 5F69645F  [ L5. or ..t._id_]
204C34C0 32203C3E 2040F890 20616E64 20282867  [2 <> @.. and ((g]
204C34D0 6F6E675F 69645F31 3E302920 6F722028  [ong_id_1>0) or (]
204C34E0 28676F6E 675F6964 5F313D30 2920616E  [(gong_id_1=0) an]
204C34F0 64202867 00000008 00000810 204BE88E  [d (g........ K..]
204C3500 204C3590 64657220 D4C430BC 6F6E675F  [ L5.der ..0.ong_]
204C3510 69645F31 2C20676F 6E675F69 645F322C  [id_1, gong_id_2,]
204C3520 20636D64 5F636E74 5F312C20 636D645F  [ cmd_cnt_1, cmd_]
204C3530 636E745F 32000000 30000039 204C3474  [cnt_2...0..9 L4t]
204C3540 00000000 00000000 00004654 00000000  [..........FT....]
204C3550 00000000 00000000 00000000 00000000  [................]
204C3560 00000000 204BE88E 20490588 00000001  [.... K.. I......]
204C3570 204965F8 00000000 2048B998 00000000  [ Ie..... H......]
204C3580 00000000 204BD6A8 204C36A0 00000000  [.... K.. L6.....]
204C3590 204C3650 D000101D D4AA8B98 204C04FC  [ L6P........ L..]
204C35A0 204C2524 2040F890 00000000 00000000  [ L%$ @..........]
204C35B0 00000000 00000000 00000000 00000000  [................]
        Repeat 2 times
204C35E0 204C36C0 00000000 00000000 00000000  [ L6.............]
204C35F0 0000007B 00000000 00000000 00000000  [...{............]
204C3600 00000000 00000000 00000000 00000000  [................]
204C3610 20487B44 28242080 00000000 000013AC  [ H{D($ .........]
204C3620 D4ECABAB 20492D18 20490588 00000001  [.... I-. I......]
204C3630 00000020 20492D18 20490588 00000008  [...  I-. I......]
204C3640 20495DE8 204BD6A8 00000000 00000001  [ I]. K..........]
204C3650 204C3F10 22442021 D4AA5230 00000000  [ L?."D !..R0....]
204C3660 00000000 00000000 00000000 00000000  [................]
        Repeat 3 times
204C36A0 06000000 0000024F 204BD6EE 00000001  [.......O K......]
204C36B0 00000000 00000000 00000026 20496618  [...........& If.]
204C36C0 204C3710 00000000 D4C474A0 00000000  [ L7.......t.....]
204C36D0 00000000 2040F890 00000000 00000000  [.... @..........]
204C36E0 00000000 00000000 00000000 00000000  [................]
        Repeat 1 times
204C3700 00000000 00000008 00000810 204BD6EE  [............ K..]
204C3710 204C37A0 00000000 D4C430BC 00000000  [ L7.......0.....]
204C3720 00000000 00000000 00000000 00000000  [................]
        Repeat 4 times
204C3770 00000000 204BD6EE 20490588 00000001  [.... K.. I......]

******************************************************
HEAP DUMP heap name="Alloc environm"  desc=0x20476b28
 extent sz=0x1024 alt=32 het=32767 rec=0 flg=2 opc=2
 parent=0 owner=0 nex=0 xsz=0x1038
EXTENT 0
ERROR extent contains wrong ds 2048b998
  Chunk 204c3580 sz=        0  ERROR, BAD MAGIC NUMBER (0)
Total heap size    =        0
FREE LISTS:
 Bucket 0 size=272
  Chunk 2048736c sz=       20    free      "               "
  Chunk 20477528 sz=      124    free      "               "
 Bucket 1 size=528
 Bucket 2 size=1040
Total free space   =      144
UNPINNED RECREATABLE CHUNKS (lru first):
PERMANENT CHUNKS:
  Chunk 20477500 sz=       40    perm      "perm           "  alo=40
Permanent space    =       40
******************************************************
 Hla: 0

**** Recursive heap error: 17113 addr=0x0, ds=0

maybe someone has the same troubles and can give me a hint.

thanks
andreas lederer

 
 
 

multithreaded application, internal heap error

Post by Billy Verreyn » Thu, 21 Mar 2002 21:15:17



>i have some troubles with porting my applikation
>from windows to aix.

Looking at some of the errors (e.g. complaining about the wrong data
segment) and the fact that you have a threaded Windows app ported to
AIX... I would guess you are running into re-entrant problems. How are
you implementing/porting the Window thread code to AIX? Not familiar
at all myself with AIX - do you have PThreads or are you using
forking?

Depending on the thread model used on Windows, you can have the
threads sharing the same datasegment. If you use fork() on Unix, each
child process get a copy of the data segment. Inheriting stuff like
SQL statement handles that way, can be a problem.

I would suggest looking at the threading issue first. Possible running
it as a test in single threaded mode first, resolve the basic porting
problems, then tackling the multithreading.

--
Billy

 
 
 

1. multithreaded ODBC application

I have an object that started another CWinThread object as a
child thread to perform ACCESS and ORACLE synchronization using ODBC.  
Oracle is connected via phone line.  Everything works OK until, the
thread ended and when any variable in parent thread was accessed -- I
got access violation.  No variable was being shared, except one.  I got
lazy, and created a shared BOOL variable to notify parent that the child
has endedits thread.  I did use ENTER and LEAVECRITICALSECTION accessing
this variable.  Microsoft documentation did specify that not all ODBC is
thread-safe.  However, I don't have multiple ODBC threads.

Any help you can provided will be greatly appreciated.  Anything I can
do in return, please, just ask.

Regards,
  Joey.

2. Which Card Should I Purchase?

3. Multithreaded PRO*C application coredump

4. Roguewave's RWTValDlist and C++_dev version 7.2.1

5. VNI-4048 : Agent internal error (e.g, Out of memory, Operating system error)

6. Evaluate and @LeftBack

7. Oracle 600 Internal Error

8. msn and NT 4.0

9. Help! ORA-00602: internal programming error

10. Oracle Internal Error

11. HELP - ORA-00600 internal error

12. Upgrade brought PL/SQL problem: internal error 1407 ?!?

13. Anyone ever seen "ORA-6501: PL/SQL: internal error..."