Bus Error on fopen()?
<p>I am using Totalview to debug some code, and it is stopping with a Bus Error.</p>

<p>What is this, and how do I fix it? here is the code snip </p>

<p>In my main:</p>

<pre><code>    char *infilename = "/home/dcole/Images/lena1024s.jpg";

    /* Try opening a jpeg*/
    if( read_jpeg_file( infilename ) &gt; 0 ) 
    {   
       //do some stuff    
    }
</code></pre>

<p>The function:</p>

<pre><code>int read_jpeg_file( const char *filename )
 {
         /* these are standard libjpeg structures for reading(decompression) */
         struct jpeg_decompress_struct cinfo;
         struct jpeg_error_mgr jerr;
         /* libjpeg data structure for storing one row, that is, scanline of an image */
         JSAMPROW row_pointer[1];

         FILE *infile = fopen( filename, "rb" ); //this line is where the debugger stops with a Bus Error
         unsigned long location = 0;
         int i = 0;

         if ( !infile )
         {
                 printf("Error opening jpeg file %s\n!", filename );
                 return -1;
         }
         return 1;
 }
</code></pre>

<p>The file I am passing in does exist. I can see that it shows up as the right sting to the full path in the debugger.</p>
