Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.os2.programmer.misc > #1605

Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean?

From "Andi B." <andi.b@gmx.net>
Newsgroups comp.os.os2.programmer.misc
Subject Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean?
Date 2017-12-29 10:46 +0100
Organization A noiseless patient Spider
Message-ID <p252th$6o6$1@dont-email.me> (permalink)
References <p1vsob$l1p$1@dont-email.me> <11p86vVJT4Oe-pn2-bkgdMpp7SV6j@slamain>

Show all headers | View raw


Hi,
thanks both of you.

Steven Levine schrieb:
> On Wed, 27 Dec 2017 10:30:38 UTC, "Andi B." <andi.b@gmx.net> wrote:
>
> Hi Andi,
>
>> I came across XCPT_BAD_ACCESS. This is with a strcpy operation which I do not see any
>> coding error. strcpy works as expected, pointers seem to be valid and code works as (I)
>> expect. Anyway ICAT pops up this exception. ICAT let me run the exception handler and all
>> is fine. strcpy operation fills the memory as expected.
>
> There may be no error here.  The reference to XCPT_BAD_ACCESS is in
> gam5lde.msg:
>
> Message: PMD0210
> XCPT_BAD_ACCESS
>
> I suspect that the developers got lazy when they created the .msg
> file.  Since you mention uncommitted memory, I am going to guess that
> the actual exception was
>
> #define XCPT_ACCESS_VIOLATION           0xC0000005
>
> with ExceptionInfo[ 0 ] set to one of:
>
>        /* ExceptionInfo[ 0 ] - Access Code: XCPT_READ_ACCESS
>                                             XCPT_WRITE_ACCESS
>                                             XCPT_SPACE_ACCESS
>                                             XCPT_LIMIT_ACCESS
>                                             XCPT_UNKNOWN_ACCESS */
>
> To verify this you need to look at the content of the
> ExceptionReportRecord.

Have to learn about.

>
>> Now I ask myself if this is really a problem with the code or this is the way it works
>> (and should work, uncommited memory?). I slowly get the feeling I'm chasing the wrong track.
>
> It could be you are chasing a red herring.  The labels shown in that
> stack trace are all part of the VAC 3.65 runtime, unless I am
> misinterpreting something.

Yes. All in the runtime and I do not find a way back to the caller. Based on my very 
limited knowledge in that area it seems to me the stack is trashed and so ICAT does not 
find the way back to the calling code in my app. But as said guessing. I know that i know 
nothing.

>
> What is the widget doing when this exception occurs?  What is the
> strcpy destination?  An uncommitted stack guard page?  Is your process
> running when the exception occurs?

I can narrow down the problem to code like this -

typedef struct _DIM {
   HMODULE        hmod;
   ULONG          ulModuleId;
   CHAR           szModuleBaseName[32];
   ULONG          ulDriverCount;
   PFNIDS         pfnids;
<SNIP>
} DIM, *PDIM;

static   PDIM  padim = NULL;

    padim = malloc( ulDimTableSize);  // actually about 215 bytes in my case
    if (!padim)
       {
       rc = ERROR_NOT_ENOUGH_MEMORY;
       break;
       }
    memset( padim, 0xAA, ulDimTableSize);
    strcpy( padim->szModuleBaseName, "TestStringAB_TEST");

The strcpy triggers the exception in ICAT.

I do not see why this should trash the stack so my above assumption is probably wrong. 
Moreover this is old code in xwlan/wlanstat and works since many years. The good thing is 
- while being there I found out that http://trac.netlabs.org/wpstk does no compile with 
VAC anymore and needs attention too. So no problem finding new tasks.

>
> Some of this is just how the kernel debugger works?  It appears you
> have the debugger configured to capture/report ring3 exceptions.

I've 'set CAT_KDB_INIT="vsf *"'. At the first sight I did not even find any reference to 
vsf and vc except on your page. And not much info in ICAT files. If I ever would find the 
time to learn more about these basics in debugging....

Maybe I should add exceptq to wlanstat an let your trap tool decode what's going wrong 
then playing endless hours with ICAT and trying to decode myself. Moreover the starting 
problem seems to be unrelated to what I'm looking here anyway. Maybe you want to have a 
look at - http://trac.netlabs.org/xwlan/ticket/46 which is the reason why I'm started to 
play ICAT.

Andi

Back to comp.os.os2.programmer.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ICAT 'XCPT_BAD_ACCESS' - what does it mean? "Andi B." <andi.b@gmx.net> - 2017-12-27 11:30 +0100
  Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? Lars Erdmann <lars.erdmann@arcor.de> - 2017-12-27 13:53 +0100
    Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? Lars Erdmann <lars.erdmann@arcor.de> - 2017-12-27 13:55 +0100
  Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? "Steven Levine" <steve53@nomail.earthlink.net> - 2017-12-27 14:23 -0600
    Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? "Andi B." <andi.b@gmx.net> - 2017-12-29 10:46 +0100
      Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? "Steven Levine" <steve53@nomail.earthlink.net> - 2017-12-30 12:05 -0600
        Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? "Andi B." <andi.b@gmx.net> - 2017-12-31 12:02 +0100
          Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? Lars Erdmann <lars.erdmann@arcor.de> - 2017-12-31 21:30 +0100
          Re: ICAT 'XCPT_BAD_ACCESS' - what does it mean? Paul Ratcliffe <abuse@orac12.clara34.co56.uk78> - 2018-01-03 19:26 +0000

csiph-web