<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ACCVIO in LIBRTL while calling malloc() in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154258#M43523</link>
    <description>If you have more than one malloc() call and one free() in a typical application, you'll want to resolve that.  Scattered calls are a classic coding issue, because it makes it far harder to find these issues.&lt;BR /&gt;&lt;BR /&gt;Do centralize your memory management calls.&lt;BR /&gt;&lt;BR /&gt;Once you have your memory management calls centralized into your own my_malloc() and my_free(), you can do a couple of things.  The first of which is (if platform-specific code is permissible) ditch malloc() and free() in favor of direct lib$get_vm and lib$free_vm calls.  You have more control here, and you can particularly establish VM zones for various purposes including for garbage-collection-style memory management.  More importantly for this particular situation, you can implement what I call "fenceposts"; structures in the memory management that allow you to detect errors at deallocation (by checking the integrity of the memory), or at run-time using the RTL VM verification call.&lt;BR /&gt;&lt;BR /&gt;Articles on C memory management debugging are here, including details on fenceposts:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/401" target="_blank"&gt;http://64.223.189.234/node/401&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/260" target="_blank"&gt;http://64.223.189.234/node/260&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC&lt;BR /&gt;</description>
    <pubDate>Tue, 04 Mar 2008 01:45:53 GMT</pubDate>
    <dc:creator>Hoff</dc:creator>
    <dc:date>2008-03-04T01:45:53Z</dc:date>
    <item>
      <title>ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154251#M43516</link>
      <description>&lt;!--!*#--&gt;Recently I have ported my application from using 32bit pointers to 64bit pointers. The c-application is compiled with /pointer_size=64 on OpenVMS 8.2 for Alpha.&lt;BR /&gt;&lt;BR /&gt;On a test system the application runs without any problems. Today we tried to run the application on our production system. After a couple of minutes we get the following Error and the process dies:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0170495DD7D28823, PC=FFFFFFFF8083824C, PS=0000001B&lt;BR /&gt;%TRACE-F-TRACEBACK, symbolic stack dump follows&lt;BR /&gt;  image    module    routine             line      rel PC           abs PC&lt;BR /&gt; LIBRTL                                     0 000000000000E24C FFFFFFFF8083824C&lt;BR /&gt; DECC$SHR_EV56                              0 000000000005C01C FFFFFFFF80ACC01C&lt;BR /&gt; Ossl  OSSL  sizedMalloc                42784 0000000000000108 0000000003D40108&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"Ossl" is my module, the "line" points to a call to the crtl-function "malloc()". This should return a 64bit-pointer to an unused memory block.&lt;BR /&gt;&lt;BR /&gt;Does the virtual address in the error message point to S2 space? Is there an error in the LIBRTL.EXE sharable (this file is the same on the test and production system)?&lt;BR /&gt;&lt;BR /&gt;More info: Till the error the application has done about 500 malloc()s and nearly the same count of free()s.</description>
      <pubDate>Mon, 03 Mar 2008 15:42:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154251#M43516</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-03T15:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154252#M43517</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;consider to get a process dump. Use SET PROC/DUMP before running the image or run it with /DUMP if a detached process. Then look at the failing instrurtion, the registers and whatever value your routine passed to the malloc call.&lt;BR /&gt;&lt;BR /&gt;The bad virtual address could be interpreted as a P2 space address, but it's most likely just an invalid address.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Mon, 03 Mar 2008 16:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154252#M43517</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-03-03T16:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154253#M43518</link>
      <description>This is 99.99% sure to be a usage error.&lt;BR /&gt;I'm only saying that you help you focus your trouble shoorting. Do NOT waste time suspecting the sustem function.&lt;BR /&gt;&lt;BR /&gt;This is likely to be a control structure corruption DETECTED (ok, not detected but stumbled into) by malloc, but caused by a bad FREE.&lt;BR /&gt;&lt;BR /&gt;Something de-allocated which was (no more) allocated?&lt;BR /&gt;Some structure used after the memory was freed?&lt;BR /&gt;&lt;BR /&gt;You may need to fully trace your mallocs/frees.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Mar 2008 17:34:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154253#M43518</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-03T17:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154254#M43519</link>
      <description>Volker,&lt;BR /&gt;thanks to remind me to set the process's dump-flag. I usually use it in all my projects but forgot it here.&lt;BR /&gt;&lt;BR /&gt;Hein,&lt;BR /&gt;and what about the other 0.01% ;-) Okay, I agree not to assume a system-function error.&lt;BR /&gt;&lt;BR /&gt;I am definitly sure that each malloc() has its free() and that there are no double free()s. But I cannot be absolutely sure, wether the limits of the allocated memory blocks are respected or not - the blocks are used by a third party api.&lt;BR /&gt;&lt;BR /&gt;During massive tests with several 100 thousand iterations on the test system the limits were respected (validated by using my own implementation of malloc/free). The crash on the production system occurred on the 3rd iteration.&lt;BR /&gt;&lt;BR /&gt;While reading your reply I suspect that the LIBRTL keeps its structures within P2. Is this also the case for the lib$*vm* routines which I suppose you prefere?&lt;BR /&gt;&lt;BR /&gt;And what about thread-safety? Are malloc() and free() (and realloc()) thread-save?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Dominik&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Mar 2008 20:04:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154254#M43519</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-03T20:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154255#M43520</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;  If you want to easily trace your LIBRTL calls, use FAKE_RTL. Here's a complete transcript, building the fake image and tracing all LIB$GET_VM and LIB$FREE_VM calls in a DIRECTORY command:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ @fake_rtl&lt;BR /&gt;Defining FAKE_RTL environment&lt;BR /&gt;$ @fake_rtl librtl&lt;BR /&gt;%COPY-S-COPIED, SYS$COMMON:[SYSLIB]LIBRTL.EXE;1 copied to DISK_USER0:[JG.FAKE_RTL]REAL_LIBRTL.EXE;1 (2080 blocks)&lt;BR /&gt;Generating symbol vector for LIBRTL on Alpha&lt;BR /&gt;%ANALYZE-I-ERRORS, DISK_USER0:[JG.FAKE_RTL]REAL_LIBRTL.EXE;1          0 errors&lt;BR /&gt;Generating MACRO code for LIBRTL&lt;BR /&gt;Assumed JSB routine LIB$ANALYZE_SDESC_R2&lt;BR /&gt;Warning - vector hole before LIB$CVT_DTB. Expecting 272, got 288&lt;BR /&gt;Warning - vector hole before LIB$DELETE_FILE. Expecting 336, got 352&lt;BR /&gt;Warning - vector hole before LIB$EXTV. Expecting 432, got 448&lt;BR /&gt;Warning - vector hole before LIB$GET_COMMAND. Expecting 544, got 576&lt;BR /&gt;Warning - vector hole before LIB$INDEX. Expecting 608, got 624&lt;BR /&gt;Warning - vector hole before LIB$LOCC. Expecting 656, got 672&lt;BR /&gt;Warning - vector hole before LIB$SCANC. Expecting 848, got 864&lt;BR /&gt;Assumed JSB routine LIB$SGET1_DD_R6&lt;BR /&gt;Warning - vector hole before LIB$TRA_ASC_EBC. Expecting 1168, got 1184&lt;BR /&gt;Assumed JSB routine OTS$$CVT_D_T_R8&lt;BR /&gt;Assumed JSB routine OTS$$CVT_F_T_R8&lt;BR /&gt;Assumed JSB routine OTS$$CVT_G_T_R8&lt;BR /&gt;Assumed JSB routine OTS$$CVT_H_T_R8&lt;BR /&gt;Assumed JSB routine OTS$MOVE3_R5&lt;BR /&gt;Assumed JSB routine OTS$MOVE5_R5&lt;BR /&gt;Assumed JSB routine OTS$SGET1_DD_R6&lt;BR /&gt;Assumed JSB routine STR$ANALYZE_SDESC_R1&lt;BR /&gt;Assumed JSB routine STR$COPY_DX_R8&lt;BR /&gt;Assumed JSB routine STR$COPY_R_R8&lt;BR /&gt;Assumed JSB routine STR$FREE1_DX_R4&lt;BR /&gt;Assumed JSB routine STR$GET1_DX_R4&lt;BR /&gt;Assumed JSB routine STR$LEFT_R8&lt;BR /&gt;Assumed JSB routine STR$LEN_EXTR_R8&lt;BR /&gt;Assumed JSB routine STR$POSITION_R6&lt;BR /&gt;Assumed JSB routine STR$POS_EXTR_R8&lt;BR /&gt;Assumed JSB routine STR$REPLACE_R8&lt;BR /&gt;Assumed JSB routine STR$RIGHT_R8&lt;BR /&gt;Assumed JSB routine OTS$$RET_A_CVT_TAB_R1&lt;BR /&gt;Warning - vector hole before LIB$EMUL. Expecting 2896, got 2912&lt;BR /&gt;Warning - vector hole before LIB$REMQHI. Expecting 3104, got 3120&lt;BR /&gt;Warning - vector hole before STR$ADD. Expecting 3392, got 3680&lt;BR /&gt;Assumed JSB routine STR$ELEMENT_R8&lt;BR /&gt;Warning - vector hole before LIB$TABLE_PARSE. Expecting 4496, got 4576&lt;BR /&gt;Warning - vector hole before LIB$FIND_VM_ZONE. Expecting 4608, got 4640&lt;BR /&gt;Warning - vector hole before LIB$LOCK_IMAGE. Expecting 6912, got 7248&lt;BR /&gt;Warning - vector hole before OTS$CNVOUT_S. Expecting 7328, got 7376&lt;BR /&gt;Start of data block 1 0000000000107230 LIB$AB_ASC_EBC&lt;BR /&gt;Compiling FAKE_LIBRTL&lt;BR /&gt;Linking FAKE_LIBRTL&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;$ define FAKE_DUMPARGS TRUE ! Enable argument dumping&lt;BR /&gt;$ fake_librtl ! enable fake_librtl for next image to run&lt;BR /&gt;$ dir *librtl*&lt;BR /&gt;&lt;BR /&gt;Directory DISK_USER0:[JG.FAKE_RTL]&lt;BR /&gt;&lt;BR /&gt;FAKE_LIBRTL.EXE;1                               271   4-MAR-2008 08:28:41.70&lt;BR /&gt;FAKE_LIBRTL.MAR;1                                60   4-MAR-2008 08:28:30.62&lt;BR /&gt;FAKE_LIBRTL.OBJ;1                               426   4-MAR-2008 08:28:32.16&lt;BR /&gt;FAKE_LIBRTL.OPT;1                                57   4-MAR-2008 08:28:30.62&lt;BR /&gt;LIBRTL.DATA;1                                     1   4-MAR-2008 08:28:30.58&lt;BR /&gt;LIBRTL.VEC;1                                     60   4-MAR-2008 08:28:30.54&lt;BR /&gt;REAL_LIBRTL.EXE;1                              2080   4-MAR-2008 08:28:29.14&lt;BR /&gt;&lt;BR /&gt;Total of 7 files, 2955 blocks.&lt;BR /&gt;&lt;BR /&gt;$  search fake_argdump.log _VM ! Look for calls in argument dump&lt;BR /&gt;LIB$GET_VM at 08:30:30.43 from 00000000000342B4&lt;BR /&gt;LIB$GET_VM called with 3 args&lt;BR /&gt;LIB$GET_VM returning 3 args&lt;BR /&gt;LIB$GET_VM returned: 00000001 at 08:30:30.43&lt;BR /&gt;LIB$GET_VM at 08:30:30.43 from 00000000000342B4&lt;BR /&gt;LIB$GET_VM called with 3 args&lt;BR /&gt;LIB$GET_VM returning 3 args&lt;BR /&gt;LIB$GET_VM returned: 00000001 at 08:30:30.43&lt;BR /&gt;LIB$GET_VM at 08:30:30.43 from 000000007AFA0D5C&lt;BR /&gt;LIB$GET_VM called with 2 args&lt;BR /&gt;LIB$GET_VM returning 2 args&lt;BR /&gt;LIB$GET_VM returned: 00000001 at 08:30:30.43&lt;BR /&gt;LIB$GET_VM at 08:30:30.45 from FFFFFFFF80DD06B8&lt;BR /&gt;LIB$GET_VM called with 2 args&lt;BR /&gt;LIB$GET_VM returning 2 args&lt;BR /&gt;LIB$GET_VM returned: 00000001 at 08:30:30.45&lt;BR /&gt;LIB$FREE_VM at 08:30:30.46 from 0000000000034434&lt;BR /&gt;LIB$FREE_VM called with 3 args&lt;BR /&gt;LIB$FREE_VM returning 3 args&lt;BR /&gt;LIB$FREE_VM returned: 00000001 at 08:30:30.46&lt;BR /&gt;LIB$FREE_VM at 08:30:30.46 from 0000000000034434&lt;BR /&gt;LIB$FREE_VM called with 3 args&lt;BR /&gt;LIB$FREE_VM returning 3 args&lt;BR /&gt;LIB$FREE_VM returned: 00000001 at 08:30:30.46&lt;BR /&gt;LIB$FREE_VM at 08:30:30.46 from FFFFFFFF80DD6004&lt;BR /&gt;LIB$FREE_VM called with 2 args&lt;BR /&gt;LIB$FREE_VM returning 2 args&lt;BR /&gt;LIB$FREE_VM returned: 00000001 at 08:30:30.46&lt;BR /&gt;&lt;BR /&gt;(that said, I'd be interested to see how FAKE_RTL handles 64 bit addressing... it might not work properly)</description>
      <pubDate>Mon, 03 Mar 2008 21:36:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154255#M43520</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-03-03T21:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154256#M43521</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;thank you for the hint. I will try this tomorrow. Btw. I've never heard of fake_rtl. Is this link the latest version of it?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/openvms/journal/v7/fake_rtl_com.txt" target="_blank"&gt;http://h71000.www7.hp.com/openvms/journal/v7/fake_rtl_com.txt&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Dominik</description>
      <pubDate>Mon, 03 Mar 2008 21:54:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154256#M43521</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-03T21:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154257#M43522</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;  Come to think of it, that version is a bit old. I've attached the latest version as a text file, just rename to FAKE_RTL.COM&lt;BR /&gt;&lt;BR /&gt;  Please let me know what happens with the 64 bit addresses.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Mar 2008 01:13:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154257#M43522</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-03-04T01:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154258#M43523</link>
      <description>If you have more than one malloc() call and one free() in a typical application, you'll want to resolve that.  Scattered calls are a classic coding issue, because it makes it far harder to find these issues.&lt;BR /&gt;&lt;BR /&gt;Do centralize your memory management calls.&lt;BR /&gt;&lt;BR /&gt;Once you have your memory management calls centralized into your own my_malloc() and my_free(), you can do a couple of things.  The first of which is (if platform-specific code is permissible) ditch malloc() and free() in favor of direct lib$get_vm and lib$free_vm calls.  You have more control here, and you can particularly establish VM zones for various purposes including for garbage-collection-style memory management.  More importantly for this particular situation, you can implement what I call "fenceposts"; structures in the memory management that allow you to detect errors at deallocation (by checking the integrity of the memory), or at run-time using the RTL VM verification call.&lt;BR /&gt;&lt;BR /&gt;Articles on C memory management debugging are here, including details on fenceposts:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/401" target="_blank"&gt;http://64.223.189.234/node/401&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/260" target="_blank"&gt;http://64.223.189.234/node/260&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Mar 2008 01:45:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154258#M43523</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2008-03-04T01:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154259#M43524</link>
      <description>&lt;!--!*#--&gt;John,&lt;BR /&gt;&lt;BR /&gt;I have written this small C-code:&lt;BR /&gt;&lt;BR /&gt;$ type test64.c&lt;BR /&gt;//#include stdlib.h // suppress compile err&lt;BR /&gt;void main() {&lt;BR /&gt;  char *c = malloc(1);&lt;BR /&gt;  *c = 1; // this is line 4 in traceback&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;and compiled it with 64bit-pointer support:&lt;BR /&gt;$ cc test64/noopt/debug/pointer_size=64&lt;BR /&gt;$ link test64&lt;BR /&gt;$ r test64&lt;BR /&gt;&lt;BR /&gt;This works fine so far. If run after a call to fake_librtl test64 will crash. If the same code is compiled without 64bit-pointer support then test64 does not crash.&lt;BR /&gt;&lt;BR /&gt;In the 64bit-version of test64 the address I get from malloc() is a valid address. But it seems that the related memory page is still protected when used with fake_librtl :-(&lt;BR /&gt;&lt;BR /&gt;$ fake_librtl&lt;BR /&gt;$ r test64&lt;BR /&gt;%SYSTEM-F-ACCVIO, access violation, reason mask=04, virtual address=FFFFFFFF80000010, PC=0000000000020108, PS=0000001B&lt;BR /&gt;%TRACE-F-TRACEBACK, symbolic stack dump follows&lt;BR /&gt;  image    module    routine             line      rel PC           abs PC&lt;BR /&gt; test64  TEST64  main                       4 0000000000000108 0000000000020108&lt;BR /&gt; test64  TEST64  __main                     0 0000000000000094 0000000000020094&lt;BR /&gt;                                            0 FFFFFFFF8033BF94 FFFFFFFF8033BF94&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have also tried to use fake_librtl to trace lib$ calls within my module. But because my module is itself a sharable image it is very difficult to get it running (the main image crashed while using fake_librtl). I have given it up to get this running.&lt;BR /&gt;&lt;BR /&gt;Next I will check if any code tries to reuse invalid memory addresses.&lt;BR /&gt;&lt;BR /&gt;Dominik</description>
      <pubDate>Wed, 05 Mar 2008 11:02:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154259#M43524</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-05T11:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154260#M43525</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;  Thanks for the feedback, I suspected it might not work, as there has been no consideration for 64 bit addresses in FAKE_RTL. FAKE_RTL assumes a VAX style calling standard with homed 32 bit arguments. I'll consider adding 64 bit support when I have long term access to an I64 system to test on. &lt;BR /&gt;&lt;BR /&gt; Interesting that the VA of the fault is 8000010 - that's the address of the AST dispatcher, and you're trying to WRITE to it!&lt;BR /&gt;&lt;BR /&gt;  The implication is your pointer "c" has been corrupted with the system address.</description>
      <pubDate>Wed, 05 Mar 2008 20:28:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154260#M43525</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-03-05T20:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154261#M43526</link>
      <description>&amp;gt;Interesting that the VA of the fault is 8000010 - that's the address of the AST dispatcher, and you're trying to WRITE to it!&lt;BR /&gt;&lt;BR /&gt;John,&lt;BR /&gt;&lt;BR /&gt;That's not the case. If you're compiling with 64 bit pointers you will get a 64 bit pointer to a piece of memory, in this case 00000000.80000010 which is a valid P2 space address.&lt;BR /&gt;&lt;BR /&gt;Fwiw,&lt;BR /&gt;&lt;BR /&gt;Jur.&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:44:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154261#M43526</guid>
      <dc:creator>Jur van der Burg</dc:creator>
      <dc:date>2008-03-06T08:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154262#M43527</link>
      <description>&lt;!--!*#--&gt;Jur,&lt;BR /&gt;&lt;BR /&gt;fake_librtl returns a signed(?) 32bit pointer. It is implicit converted to 64bit to the value FFFFFFFF.80000010. This means this is not a valid P2 address. I should have looked at the address given by the traceback.&lt;BR /&gt;I have verified this with the debugger. Or append:&lt;BR /&gt;&lt;BR /&gt;printf("%Lx\n", c);&lt;BR /&gt;&lt;BR /&gt;after the call to malloc(). Btw. malloc() has called lib$vm_malloc_64 which itself allocated P2 space at 00000000.80000000:00000000.80001FFF (see SDA). At least this has worked fine.&lt;BR /&gt;&lt;BR /&gt;Dominik&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Mar 2008 09:47:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154262#M43527</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-06T09:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154263#M43528</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;FAKE_RTL uses PUSHR/POPR to save and restore R0 and R1 around various calls. This seems to cause the high-order longword of the quadword register values to be clobbered.&lt;BR /&gt;&lt;BR /&gt;$PUSH64 and $POP64 might be correct replacements for this.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Fri, 07 Mar 2008 18:59:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154263#M43528</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-03-07T18:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154264#M43529</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;you can make FAKE_RTL.COM work for routines returning 64-bit status values in R0/R1 like this:&lt;BR /&gt;&lt;BR /&gt;In FAKE_RTL.COM replace&lt;BR /&gt;&lt;BR /&gt;PUSHR #^M&lt;R0&gt;    ; save R0 &amp;amp; R1&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;$PUSH64 R0          ; save full quadword values&lt;BR /&gt;$PUSH64 R1&lt;BR /&gt;&lt;BR /&gt;and replace&lt;BR /&gt;&lt;BR /&gt;POPR  #^M&lt;R0&gt;    ; restore registers&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;$POP64 R1             ; restore full quadword values&lt;BR /&gt;$POP64 R0&lt;BR /&gt;&lt;BR /&gt;After this modification, your TEST64 program does work and the malloc returns the correct address in P2 sapce.&lt;BR /&gt;&lt;BR /&gt;Making FAKE_DUMPARGS print the full 64-bit register values takes a little bit more work.&lt;BR /&gt;&lt;BR /&gt;Volker.&lt;/R0&gt;&lt;/R0&gt;</description>
      <pubDate>Sun, 09 Mar 2008 07:26:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154264#M43529</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-03-09T07:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154265#M43530</link>
      <description>Volker,&lt;BR /&gt;&lt;BR /&gt;thanks for your patience. I got a dump file from my process. The accvio of this dumpfile is not in malloc() but in some module for which I have sourcecode. The module was compiled with /noopt and /debug enabled. This means I should have all symbols.&lt;BR /&gt;When invoking "ana/proc &lt;DUMPFILE&gt;" the debugger always claims that the source listing for my module is not available. This is also the case if I force using specific sources by typing "set source/latest &lt;SOURCE-DIR&gt;".&lt;BR /&gt;Normally this works fine for me. But in this case the problem may be because my module is linked as a shared image and the symbols of the shared image are resolved at runtime (here: by Java's JNI).&lt;BR /&gt;Do you see any chance to make the source code visible in the debugger in this case?&lt;BR /&gt;&lt;BR /&gt;Dominik&lt;/SOURCE-DIR&gt;&lt;/DUMPFILE&gt;</description>
      <pubDate>Tue, 11 Mar 2008 09:12:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154265#M43530</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-11T09:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154266#M43531</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;did you try DBG&amp;gt; SET IMAGE xxx&lt;BR /&gt;&lt;BR /&gt;Otherwise, you might have to compile your source code with /LIST/MACHINE and find the offending instruction stream by comparing the instructions around the failing PC in the dump and the machine code listing.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 11 Mar 2008 13:42:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154266#M43531</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-03-11T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154267#M43532</link>
      <description>Volker,&lt;BR /&gt;&lt;BR /&gt;I tried to use "set image xxx" but it claims that the specified image cannot be found??? I also tried "set image/all" which loaded my module into the process set. At this time I could see the correct symbols in the call frames. But I am still not able to view the source code within the debugger.&lt;BR /&gt;I do not need to compile with /list/machine because the traceback (at the time the dump occurs) shows me the linenumbers. But I would like to examine the used variables and the contents of specific memory-addresses. I can do this only in the debugger, but only if the debugger finds the source-listings.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Okay, this is one thing. But let's go back to the origin for this thread:&lt;BR /&gt;&lt;BR /&gt;Sure malloc() is not the origin of the failure. But I wonder that a module that is run in USER-MODE can corrupt memory areas which is used by system functions. (At least I call routines in LIBRTL as system function.)&lt;BR /&gt;I have expected that LIBRTL functions keep their internal structures within memory pages which are not accessable by USER-MODE modules. That's why I thought of an error within malloc().&lt;BR /&gt;&lt;BR /&gt;Dominik</description>
      <pubDate>Tue, 11 Mar 2008 14:01:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154267#M43532</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-11T14:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154268#M43533</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;the LIB$ routines are NOT system services, so they run in user mode and therefore can't protect their data from other user mode code.&lt;BR /&gt;&lt;BR /&gt;To make progress with your process dump, you would probably need to resort to the machine code listings - tedious, but works...&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 11 Mar 2008 14:09:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154268#M43533</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-03-11T14:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154269#M43534</link>
      <description>Dominik,&lt;BR /&gt;&lt;BR /&gt;  You may want to try using the HeapAnalyzer to see who's doing what with your heap memory. It's part of the debugger. See Chapter 12 in the "HP OpenVMS Debugger Manual".&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/doc/82final/4538/4538pro_024.html#index_x_1206" target="_blank"&gt;http://h71000.www7.hp.com/doc/82final/4538/4538pro_024.html#index_x_1206&lt;/A&gt;</description>
      <pubDate>Tue, 11 Mar 2008 22:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154269#M43534</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-03-11T22:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: ACCVIO in LIBRTL while calling malloc()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154270#M43535</link>
      <description>Thanks to all of you, who tried to help me. I have found the error!&lt;BR /&gt;&lt;BR /&gt;Because my module and the 3rd party api are cross-platform I built the same code on Windows. With a good portion of luck the application then crashed near the point with the coding error. The problem was: I not only ported the code to 64bit-pointers but also tried to reduce the heap-usage by changing the sequence of some api-calls - in the wrong order...&lt;BR /&gt;&lt;BR /&gt;Side-effect of the code review: On OpenVMS I now use lib$get/free_vm_64() directly. The code is about 25% faster than before, because the used api makes heavy use of memory allocation and deallocation.&lt;BR /&gt;&lt;BR /&gt;Again, thanks to all of you!&lt;BR /&gt;Dominik</description>
      <pubDate>Tue, 25 Mar 2008 09:34:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/accvio-in-librtl-while-calling-malloc/m-p/4154270#M43535</guid>
      <dc:creator>Dominik Andelshauser</dc:creator>
      <dc:date>2008-03-25T09:34:48Z</dc:date>
    </item>
  </channel>
</rss>

