4

I can't seem to be able to compile even simple C programs anymore; I can't seem to be able to pinpoint what changed from yesterday, when all seemed to be fine.

I'm using gcc 5.2.1.

Compiling this program (or any other program)

#include <stdio.h> int main(int argc, char *argv[]) { printf("Hello world!\n"); return 0; } 

gives me this error:

<built-in>: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions. 

I'm at loss; what I found while searching on the internet are posts from a few years back detailing bugs that have been solved, or bus error generated from a C program for incorrect use of memory.

I've tried purging and reinstalling gcc with apt-get (I'm using Ubuntu), but nothing changed.

4
  • 2
    Maybe reinstall gcc? it looks gcc is corrupted somehow. Commented Apr 30, 2016 at 8:27
  • @fluter Already tried with apt-get, added an edit to the post Commented Apr 30, 2016 at 8:28
  • 1
    Did you make any changes to gcc recently say and upgrade? Commented Apr 30, 2016 at 8:43
  • @sjsam I didn't change anything in gcc, at least not voluntarily; I experimented with some warning options (-Werror, -Wextra, -Wall and so on), but as far as I can see doing that should be of no consequence to gcc itself. I haven't updated my system since last week, so I shouldn't have upgraded gcc either. Again, voluntarily at least. Commented Apr 30, 2016 at 8:59

3 Answers 3

1

I would check the memory, file system, and disk surface, and maybe did other hardware checks as well.

Sign up to request clarification or add additional context in comments.

1 Comment

fsck said everything was fine; I will try with a memtest as soon as I'm able to
0

I was having issues with my wireless, too; I have no idea how or why, but after entering the command

sudo apt-get install --reinstall bcmwl-kernel-source 

and rebooting, gcc started working again. I'm confident that this did the trick, as I tried compiling just before issuing the command.

While I'd still like to understand why that happened, I guess this fixed the problem.

Comments

0

I have the same problem I could not install mysqldb and my GCC was giving error like that:

enter image description here

I fixed the problem in Ubuntu by updater and the Ubuntu partial version

The problem arises because of partial installation of other packages.

Steps:

1) got to updater
2) find there to update and restart Ubuntu

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.