21 Mar 2004 forrest   » (Journeyer)

Debian "sid" gcc problem

I hate it when I get a problem with a basic piece of infrastructure and I don't know which piece is responsible for the error. Where does one begin to file a bug report?

Since this is my diary, I feel that I can at least blow off steam by posting here ... and maybe (often!) someone will give me a clue. That's got to be one of the most inefficient ways ever of filing a bug report, but hey ... it's just my diary, ok?

I run Debian "sid" (a.k.a. "unstable") and I was revisiting some code which worked on August 19th, only to have it segfault on me.

I eventually found I could reproduce the problem just by declaring a large array. Here is (literally) a hello world program which exhibits the problem on my machine:

#include <stdio.h>

int main() { /* char arr[8385040]; no problem */ char arr[8385041]; /* segfault! */ printf("Hello, World!\n"); }
The segfault occurs on the printf statement. WTF?

I get the problem when with either

 gcc -o hello hello.c && ./hello 
or
 gcc-2.95 -o hello hello.c && ./hello 

Can anyone else reproduce this, or am I just going crazy?

As a workaround, I found that I can use malloc to create my (syntactic equivalent to a) large array with no problem.

... random personal stuff ...

I just got back from my 4th trip to China. We're having trouble getting permission for my parents-in-law to visit the U.S. (the U.S. government objects, not the Chinese) and my mom really wanted to meet them. So we took her to Wuhan, and of course visited famous sites like the Great Wall while we were there.

I like China. I wouldn't want to live there, but I think it would be cool if I could work there for a year or so. I'm too tied to job security, though, to actually try to make that happen.

And oh yeah, Happy Birthday to me. I'm now 42 years old.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!