title: C++ Segmentation fault in AIX
body: <p>Hi I have written a piece of code in C++ at AIX 6 as part of my project as below:
  It compiles and build properly.But getting segmentation fault on executing below lines,
  "EquipmentSMU _equipmentSMU=_smuArray[i];"</p>
  
  <p>I am building it with bjam and linking all libraries with -bmaxdata:0x80000000 option.
  I have tried it with  export $LDR_CNTRL=MAXDATA=0x80000000 before executing it but unable to solve the problem.</p>
  
  <p>I have ran the same code in windows, there it runs well without having any issues.</p>
  
  <p>My Code :</p>
  
  <pre><code>#define EQUIP_MAX_SMU_LEN 30
  #define EQUIP_MAX_SMU 100
  typedef struct
  {
      wchar_t _smu[EQUIP_MAX_SMU_LEN+1];
  
  } EquipmentSMU;
  
  class Equipment
  {
  public:
      Equipment();
      ~Equipment();
  
  private:
      void _AddSMU(wchar_t* smu);
  
  private:
      EquipmentSMU _smuArray[EQUIP_MAX_SMU];
  };
  
  void Equipment::_AddSMU(wchar_t* smu)
  {
      int i;
      for ( i=0; i &lt; EQUIP_MAX_SMU; i++ )
      {
          EquipmentSMU _equipmentSMU=_smuArray[i];//segmentation fault coming at here
          wchar_t _tempSmu = _equipmentSMU._smu[0];
          if(_tempSmu == L'\0' )
          {
              wcsncpy( _smuArray[i]._smu, smu, EQUIP_MAX_SMU_LEN+1 );
              return;
          }
          if( wcsncmp( _smuArray[i]._smu, smu, EQUIP_MAX_SMU_LEN+1) == 0 )
          {
              return;
          }
      }
  }
  </code></pre>
  
  <p>Can anyone please help me to solve this problem.
  Thanks,</p>