bug report

Manuel Alguacil Payán mapmail@iespana.es
Sun Apr 20 18:51:00 GMT 2003


Hello, my name is Manuel Alguacil and this message is about a possible 
gcc/g++ bug. I am Computer Engeenering and I use to compile C programs
under 
Linux using the Gnu C Compiler (version 3.2 release 7). Actually I am
using
Red Hat 8.0 with an AMD Athlon 500Mhz, but you can find the whole
configuration
described in the 'dmesg.txt' file.

Some days ago I started a program and I found some troubles while trying
to use
a dinamic matrix. I was reciving a 'Segmentation fault' error. In the
beginning
I thought it could be produced by a bad data manipulation by me, but
making some
probes, I finally reach this conclusion: The gcc compiler is not
treating
correctly the dinamic matrix. I include in this message two code files:
one 
with the error and other with the "correct runnable code". Both codes
compile 
perfectly, but the first one gives the error, and the other one patchs
it (but 
this is a very poor solution). Anyway, this solution only works with a
small 
matrix. If we try to use a bigger one, it gives the same error.

The problem is as follows: I am mannaging a two dimensions matrix
dinamically, 
and after a lot of probes I think the problem is that the 'calloc' call
doesn't
works fine, because the first row is not set to zero after 'calloc'. I 
think that malloc is in same way. You can see the output of the wrong
code in 
the 'out.txt' file. If you want to see the error, you only have to
uncomment the 
code of the wrong file (that fill the whole matrix) and you will see.

I don't really know if I was right sending this bug here. If not, please
excuse me and if you know who I have to write, tell me, ok?

Well, I tried to explain the best I can the problem. Please, forgive my
poor
english (I am Spanish). For any doub or suggest, please contact me at
<mapmail@iespana.es> or <manuel.alguacil.ext@juntadeandalucia.es>

I hope this e-mail will be useful for everyone. Thanks.

Manuel Alguacil Payan
Seville (Spain)

---Publicidad--------------------------------------------------------
Juega con Ventura24.es, lotería inteligente y multiplica tus
posibilidades!! http://www.iespana.es/_reloc/email.ventura

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dmesg.txt
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030420/92e7eb07/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrong.c
Type: application/octet-stream
Size: 473 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030420/92e7eb07/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: out.txt
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030420/92e7eb07/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fine.c
Type: application/octet-stream
Size: 512 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030420/92e7eb07/attachment-0001.obj>


More information about the Gcc-bugs mailing list