Link to home
Start Free TrialLog in
Avatar of jmahtani
jmahtani

asked on

Help : Cannot understand error mesg.

Hello,
      I have written a C program to build the tables
that an assembler usually does. After compiling and trying
to run the program, an error message is displayed :

General Protection Exception
0xf8DF:0x0D12
SYS1A(1) 0x58DF:0X0D12 Processor Fault

I would really appreciate it if someone could tell me
whats going on ? What kind of error message is this and
where do I need to look ? The message gives me no idea of
where do I start looking for a problem.
I will summarize.

Waiting for a response.
Thanks.
Jeetandra
ASKER CERTIFIED SOLUTION
Avatar of Jackie071497
Jackie071497

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmahtani
jmahtani

ASKER

Hello,
     Thanks for replying. I believe the error is being caused due to an array that is of 68 by 48. When I cut the array size from 68 by 48 to 37 by 48( and commented the rest), I did not get the error. Then I decided to cut the 68 by 48 array to two arrays - 37 by 48 and 31 by 48, but then the error message came back. Do you have any idea of whats going wrong ?
( Note : In one of the initialisations of my array, I have one of the          rows as
         "         DC    C'BANANA    ,           ,KIWI   '",
  Can this be causing the problem.        

  If its not a problem to you, should I email my program to you,   so that it will give you a better idea of how the array is   being  initialised.
)
Waiting for your response.
Jeetandra.
You should post the part causing problem as it could be different reason like you access a memory allocation where you shouldn't or you try to free a pointer which point anywhere....

CpH
You can e-mail me : sigmafei@ms1.hinet.net

But I think your better way is to post up some parts of your
initializations here. Maybe other friends also feel interested
for your coding problems.

Hello,
     I really appreciate your help. The following is the declaration of the array that I believe is causing the problem,since when I reduced the size of the array from 68 rows to 37, the error disappeared. When I split the 68 rows array into 2 arrays of 37 and 31 rows, the error came back. If its not a problem,, can someone please examine it and let me know of what could be causing the problem.
Waiting for your response.
Jeetandra
char code[68][48]=
 {"DIFF     CSECT                             ",
  "         STM   14,12,12(13)                       ",
  "         BALR  12,0                               ",
  "         USING *,12                               ",
  "         ST    13,MAINSAV+4                  ",
  "         LA    13,MAINSAV                       ",
  "         LA    2,TABLE1                       ",
  "         LA    3,TABLE2                         ",
  "         LA    4,0                                  ",
  "NEXT     CLI   0(2),C' '                         ",
  "         BC    B'1000',GETNEXT                     ",
  "         CLC   0(10,2),=CL10'NOMORE'               ",
  "         BC    B'1000',NOMORE                   ",
  "         MVC   0(10,3),0(2)                          ",
  "         LA    4,1(4)                             ",
  "         LA    3,10(3)                           ",
  "GETNEXT  LA    2,10(2)                          ",
  "         BC    B'1111',NEXT                     ",
  "NOMORE   ST    4,COUNT                          ",
  "         LA    1,=A(PARMLT)                     ",
  "         LA    15,SORT                          ",
  "         BALR  14,15                               ",
  "         L     13,MAINSAVE+4                       ",
  "         LM    14,12,12(13)                         ",
  "         R     14                                   ",
  "         LTORG                                  ",
  "PARMLT   DC    A(TABLE2)                          ",
  "         DC    X'80',AL3(COUNT)                   ",
  "MAINSAVE DS    18F                                ",
  "COUNT    DS    F                                ",
  "TABLE1   DC    C'APPLE   ,PEAR       ,         '",
  "         DC    C'BANANA  ,           ,KIWI     '",
  "         DC    C'        ,RAMBUTAN   ,DATE     '",
  "         DC    C'GRAPE   ,BERRY      ,DURIAN   '",
  "         DC    C'KUMQUAT ,POMEGRANIT ,PAPAYA   '",
  "         DC    C'QUINCE  ,           ,NOMORE   '",
  "TABLE2   DS    15CL10                           ",
  "SORT     CSECT                           ",
  "          STM   14,12,12(13)                     ",
  "         BALR  12,0                           ",
  "         USING *,12                             ",
  "         ST    13,SORTSAVE+4                        ",
  "          LA    13,SORTSAVE                     ",
  "           L     2,4(1)                     ",
  "              L     2,0(2)                     ",
  "         L     5,0(2)                     ",
  "         BCTR  2,0                           ",
  "DO10     EQU   *                           ",
  "          LR    3,2                           ",
  "         SR    4,4                           ",
  "DO20     EQU   *                           ",
  "          L     6,0(4,5)                     ",
  "IF30     C     6,10(6)                     ",
  "         BNH   FI30                           ",
  "         MVC   TEMP(10),10(6)                     ",
  "         MVC   10(10,6),0(6)                     ",
  "         MVC   0(10,6),TEMP                     ",
  "FI30     EQU   *                           ",
  "         LA    4,10(4)                     ",
  "         BCT   3,DO20                     ",
  "0D20     EQU   *                           ",
  "         BCT   2,DO10                            ",
  "0D10     EQU   *                                ",
  "         L     13,SORTSAVE+4                     ",
  "         LM    14,12,12,(13)                     ",
  "         BR    14                               ",
  "TEMP     DS    CL10                             ",
  "         END   DIFF                           "};

Make sure that you are not trying to access code[68] anywhere in your program. Since 'C' language is zero based valid values are code[0] to code[67].

for(i=0; i<=68; i++) is wrong; it should be for(i=0; i<68; i++)
I am not trying to access row 68 anywhere in my program. The error seems to be associated with the declaration of the array since when I reduced the array size from 68 rows to 37 rows, I did not get the error message. So I decided to split the original array of 68 rows into two arrays of 37 rows and 31 rows, but then  the error message came back, which is surprising.
Waiting for a response.
Jeetandra.  

I felt strange in your dim declaration : char code[68][48]= ...
Your data type is only 68 "pointers", so you need to define : char *code[68]=...

Could you show us how do you accessing code[n]?

Dear Jackie and everyone who helped,
Thank you very much.
 char *code[68]=.... solved the problem.
Though the problem has been solved, can someone please
explain why char code[68][48] did not work, but
 char *code[68]=.. worked. I was under the impression
 that since my array consists of 68 rows and each row
consists of 48 columns, shouldn't char code[68][48]=...
work ??
Jeetandra
*a = "1", a is a pointer. ( maybe 4 byte )
a = '1', a is a character buffer. ( 1 byte )

If you want to define code[68][48], you should use :
code[68][48] =
{ {'D','I','F','F',...}
  {'S','T','M',...}
  ...
}