R13B01: erts_cpu_info_update() "int mib[0];" + sysctl call trashes stack

Michael Turner leap@REDACTED
Tue Jul 28 16:41:45 CEST 2009


I'm trying to build R13B01.  I was getting seg faults on erlexec. 
Bringing it up in gdb just gave me "No stack."

Hours (and *hours*) later: I've traced it to the following in
erl_misc_utils.c

  {
   int mib[0];
   size_t len;
   ....

Yes, that's legal (according to gcc, anyway).  Even useful for some
things.

  http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Zero-Length.html

In this context, however, it should be "int mib[2];"  The problem is
that there are assignments to mib[0] and mib[1] immediately following,
clobbering some context.

So, uh . . . this is the questions list, so I have a question after all:
where do I report this as a bug?  And suggest this fix?  And all that? 
I'm pretty new to this.

-michael turner


More information about the erlang-questions mailing list