HP compiler Bug

Greg Hogeweide ghog@nortelnetworks.com
Wed Apr 4 08:45:00 GMT 2001


Dear Sir, 
Madam
        I am unable 
to use the GNATS bug reporting system so hopefully you can help me. I am getting 
a Segmentation fault on a function call consistently. It is in the assembly code 
on a function call. I can reproduce this bug consistently and I am unable to 
solve it. If you could be help me it would be greatly appreciated. Thanks for 
your help.
 
Compiler : gcc 
version 2.8.1
Workstation:          
HP-UX 9000/712
 
      
 
Program 
Structure:

  void 
  X::doBehavior(StateMachine *eventObj)
     
  {
       // runs the the objects 
  event 
      
  return;
     
  }
   
   
  void 
  X::enterState(stateType state, StateMachine *eventObj)
    
  {
     
  
      
  pushState(state);
      
  doBehavior(eventObj);       // Program Segmentation 
  faults on this line, always. It does not get to the functions first line of 
  code and it completes the line of code just prior to 
it.
     
  
     
  return;
   }
  Bug Conditions:

  The function call 
  "doBehavior(eventObj)" is called approximately 10 - 15 times in a consistent 
  loop. In the bellow assembler code the function calls that do work properly 
  will run one after the other consecutively. Each Segmentation fault will die 
  on the same line of assembly code (highlighted line).
   
Assembler 
Code:
 
Dump 
of assembler code from 0x57a74 to 0x57b74:     0x57a74 
<Mobile::enterState(unsigned long, StateMachineEvent *)+516>:   ldw 104(sr0,r6),r19     0x57a78 
<Mobile::enterState(unsigned long, StateMachineEvent *)+520>:   ldo 38(r19),r5 =>0x57a7c 
<Mobile::enterState(unsigned long, StateMachineEvent *)+524>:   ldh 0(sr0,r5),r20     0x57a80 
<Mobile::enterState(unsigned long, StateMachineEvent *)+528>:   extrs r20,31,16,r19     0x57a84 
<Mobile::enterState(unsigned long, StateMachineEvent *)+532>:   addl r6,r19,r20     0x57a88 
<Mobile::enterState(unsigned long, StateMachineEvent *)+536>:   ldw 4(sr0,r5),r19     0x57a8c 
<Mobile::enterState(unsigned long, StateMachineEvent *)+540>:   copy r20,r26     0x57a90 
<Mobile::enterState(unsigned long, StateMachineEvent *)+544>:   ldw -2c(sr0,r3),r25     0x57a94 
<Mobile::enterState(unsigned long, StateMachineEvent *)+548>:   copy r19,r22     0x57a98 
<Mobile::enterState(unsigned long, StateMachineEvent *)+552>:   ble 3084(sr4,r0)     0x57a9c 
<Mobile::enterState(unsigned long, StateMachineEvent *)+556>:   copy r31,rp     0x57aa0 
<Mobile::enterState(unsigned long, StateMachineEvent *)+560>:   b,n 0x57c4c
 
 
 
 
 
Cheers,
 
Greg Hogeweide Design Environment 
Support . Software Tools & Advanced Research Team 
Nortel Networks, Wireless Development Centre Calgary, 
Alberta Phone: 769-4790 ESN 758-4790 
 
 



More information about the Gcc mailing list