From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11893 invoked by alias); 20 Apr 2003 18:51:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11886 invoked from network); 20 Apr 2003 18:51:26 -0000 Received: from unknown (HELO fencepost.gnu.org) (199.232.76.164) by sources.redhat.com with SMTP; 20 Apr 2003 18:51:26 -0000 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.10) id 197JuP-0000kh-00 for bug-gcc@gnu.org; Sun, 20 Apr 2003 14:51:25 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 197JuN-0002ng-00 for bug-gcc@gnu.org; Sun, 20 Apr 2003 14:51:24 -0400 Received: from th00.opsion.fr ([62.39.122.10]) by monty-python.gnu.org with smtp (Exim 4.10.13) id 197JuM-0002ex-00 for bug-gcc@gnu.org; Sun, 20 Apr 2003 14:51:22 -0400 Received: from 10.1.1.14 [10.1.1.14] by th00.opsion.fr id 200304201851.0500; Sun, 20 Apr 2003 18:51:05 GMT Send-By: 80.103.118.4 with Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) To: Subject: bug report From: "Manuel Alguacil Payán" X-Priority: 3 (normal) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="----=_NextPart_1050864666_5239731869488486" Date: Sun, 20 Apr 2003 18:51:00 -0000 Message-id: <200304201851.0500@th00.opsion.fr> X-Spam-Status: No, hits=2.6 required=5.0 tests=PRIORITY_NO_NAME,SPAM_PHRASE_01_02 version=2.41 X-Spam-Level: ** X-SW-Source: 2003-04/txt/msg00881.txt.bz2 List-Id: ------=_NextPart_1050864666_5239731869488486 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 2157 Hello, my name is Manuel Alguacil and this message is about a possible=20 gcc/g++ bug. I am Computer Engeenering and I use to compile C programs under=20 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=20 with the error and other with the "correct runnable code". Both codes compile=20 perfectly, but the first one gives the error, and the other one patchs it (but=20 this is a very poor solution). Anyway, this solution only works with a small=20 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,=20 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=20 think that malloc is in same way. You can see the output of the wrong code in=20 the 'out.txt' file. If you want to see the error, you only have to uncomment the=20 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 or I hope this e-mail will be useful for everyone. Thanks. Manuel Alguacil Payan Seville (Spain) ---Publicidad-------------------------------------------------------- Juega con Ventura24.es, loter=EDa inteligente y multiplica tus posibilidades!! http://www.iespana.es/_reloc/email.ventura ------=_NextPart_1050864666_5239731869488486 Content-Type: text/plain; name="dmesg.txt" Content-Disposition: attachment; filename="dmesg.txt" Content-Transfer-Encoding: quoted-printable Content-length: 7226 Linux version 2.4.18-14smp (bhcompile@astest.test.redhat.com) (gcc version = 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 SMP Wed Sep 4 11:55:37 EDT 2002 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 0000000013ff0000 (usable) BIOS-e820: 0000000013ff0000 - 0000000013ff3000 (ACPI NVS) BIOS-e820: 0000000013ff3000 - 0000000014000000 (ACPI data) BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved) 0MB HIGHMEM available. 319MB LOWMEM available. On node 0 totalpages: 81904 zone(0): 4096 pages. zone(1): 77808 pages. zone(2): 0 pages. Kernel command line: auto BOOT_IMAGE=3Dlinux ro BOOT_FILE=3D/boot/vmlinuz-2= .4.18-14smp root=3DLABEL=3D/ No local APIC present or hardware disabled Initializing CPU#0 Detected 499.050 MHz processor. Speakup v-1.00 CVS: Tue Jun 11 14:22:53 EDT 2002 : initialized Console: colour VGA+ 80x25 Calibrating delay loop... 990.06 BogoMIPS Memory: 316960k/327616k available (1426k kernel code, 8092k reserved, 1057k= data, 240k init, 0k highmem) Dentry cache hash table entries: 65536 (order: 7, 524288 bytes) Inode cache hash table entries: 32768 (order: 6, 262144 bytes) Mount cache hash table entries: 8192 (order: 4, 65536 bytes) ramfs: mounted with options: ramfs: max_pages=3D39892 max_file_pages=3D0 max_inodes=3D0 max_dentries=3D3= 9892 Buffer cache hash table entries: 16384 (order: 4, 65536 bytes) Page-cache hash table entries: 131072 (order: 7, 524288 bytes) CPU: Before vendor init, caps: 0081f9ff c0c1f9ff 00000000, vendor =3D 2 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 512K (64 bytes/line) CPU: After vendor init, caps: 0081f9ff c0c1f9ff 00000000 00000000 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU: After generic, caps: 0081f9ff c0c1f9ff 00000000 00000000 CPU: Common caps: 0081f9ff c0c1f9ff 00000000 00000000 Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au) mtrr: detected mtrr type: Intel CPU: Before vendor init, caps: 0081f9ff c0c1f9ff 00000000, vendor =3D 2 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 512K (64 bytes/line) CPU: After vendor init, caps: 0081f9ff c0c1f9ff 00000000 00000000 Intel machine check reporting enabled on CPU#0. CPU: After generic, caps: 0081f9ff c0c1f9ff 00000000 00000000 CPU: Common caps: 0081f9ff c0c1f9ff 00000000 00000000 CPU0: AMD-K7(tm) Processor stepping 02 per-CPU timeslice cutoff: 1461.94 usecs. task migration cache decay timeout: 1 msecs. SMP motherboard not detected. Local APIC not detected. Using dummy APIC emulation. migration_task 0 on cpu=3D0 PCI: PCI BIOS revision 2.10 entry at 0xfb3c0, last bus=3D1 PCI: Using configuration type 1 PCI: Probing PCI hardware Unknown bridge resource 0: assuming transparent PCI: Using IRQ router default [1022/7006] at 00:00.0 isapnp: Scanning for PnP cards... isapnp: No Plug & Play device found speakup: initialized device: /dev/synth, node (MAJOR 10, MINOR 25) Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16) Starting kswapd VFS: Diskquotas version dquot_6.5.0 initialized pty: 2048 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with MANY_PORTS MULTIPORT SHARE_IR= Q SERIAL_PCI ISAPNP enabled ttyS0 at 0x03f8 (irq =3D 4) is a 16550A ttyS1 at 0x02f8 (irq =3D 3) is a 16550A Real Time Clock Driver v1.10e block: 608 slots per queue, batch=3D152 Uniform Multi-Platform E-IDE driver Revision: 6.31 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=3D= xx AMD7409: IDE controller on PCI bus 00 dev 39 AMD7409: chipset revision 3 AMD7409: not 100% native mode: will probe irqs later AMD7409: disabling single-word DMA support (revision < C4) ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:pio hda: ST320413A, ATA DISK drive hdb: LG CD-ROM CRD-8521B, ATAPI CD/DVD-ROM drive hdc: SAMSUNG SV0432A 024, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 blk: queue c0435b64, I/O limit 4095Mb (mask 0xffffffff) blk: queue c0435b64, I/O limit 4095Mb (mask 0xffffffff) hda: setmax LBA 39102337, native 39102336 hda: 39102336 sectors (20020 MB) w/1024KiB Cache, CHS=3D2434/255/63, UDMA(3= 3) blk: queue c0435ec0, I/O limit 4095Mb (mask 0xffffffff) blk: queue c0435ec0, I/O limit 4095Mb (mask 0xffffffff) hdc: 8421840 sectors (4312 MB) w/482KiB Cache, CHS=3D8912/15/63, UDMA(33) ide-floppy driver 0.99.newide Partition check: hda: hda1 hda2 hda4 < hda5 hda6 > hdc: [PTBL] [524/255/63] hdc1 Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 NET4: Frame Diverter 0.46 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize ide-floppy driver 0.99.newide md: md driver 0.90.0 MAX_MD_DEVS=3D256, MD_SB_DISKS=3D27 md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 2048 buckets, 16Kbytes TCP: Hash tables configured (established 32768 bind 32768) Linux IP multicast router 0.06 plus PIM-SM NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. RAMDISK: Compressed image found at block 0 Freeing initrd memory: 131k freed VFS: Mounted root (ext2 filesystem). Journalled Block Device driver loaded kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. Freeing unused kernel memory: 240k freed usb.c: registered new driver usbdevfs usb.c: registered new driver hub usb-ohci.c: USB OHCI at membase 0xd484b000, IRQ 11 usb-ohci.c: usb-00:07.4, Advanced Micro Devices [AMD] AMD-756 [Viper] USB usb-ohci.c: AMD756 erratum 4 workaround usb.c: new USB bus registered, assigned bus number 1 hub.c: USB hub found hub.c: 4 ports detected usb.c: registered new driver hiddev usb.c: registered new driver hid hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik hid-core.c: USB HID support drivers mice: PS/2 mouse device common for all mice EXT3 FS 2.4-0.9.18, 14 May 2002 on ide0(3,1), internal journal Adding Swap: 104380k swap-space (priority -1) kjournald starting. Commit interval 5 seconds EXT3 FS 2.4-0.9.18, 14 May 2002 on ide0(3,5), internal journal EXT3-fs: mounted filesystem with ordered data mode. parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,EPP] parport0: irq 7 detected ohci1394: pci_module_init failed ip_tables: (C) 2000-2002 Netfilter core team es1371: version v0.30 time 12:07:55 Sep 4 2002 es1371: found chip, vendor id 0x1274 device id 0x1371 revision 0x06 es1371: found es1371 rev 6 at io 0xe400 irq 10 es1371: features: joystick 0x0 ac97_codec: AC97 Audio codec, id: 0x8384:0x7609 (SigmaTel STAC9721/23) ide-floppy driver 0.99.newide hdb: ATAPI 52X CD-ROM drive, 128kB Cache Uniform CD-ROM driver Revision: 3.12 cdrom: This disc doesn't have any tracks I recognize! ------=_NextPart_1050864666_5239731869488486 Content-Type: application/octet-stream; name="wrong.c" Content-Disposition: attachment; filename="wrong.c" Content-Transfer-Encoding: base64 Content-length: 643 I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQoNCiNk ZWZpbmUgRgk1DQojZGVmaW5lIEMJNQ0KDQppbnQgbWFpbigpDQp7DQoJaW50 IAlpLGo7DQoJY2hhciAqKiBhOw0KDQoJYT0oY2hhciAqKikgY2FsbG9jKEYs IHNpemVvZihjaGFyKSk7DQoJZm9yKGk9MDsgaTxGOyBpKyspIHsNCgkJKihh K2kpPShjaGFyICopIGNhbGxvYyhDLCBzaXplb2YoY2hhcikpOw0KCQlpZigg KihhK2kpID09IE5VTEwgKSB7DQoJCQlwcmludGYoIkNhbGxvYyBGYWlsdXJl XG4iKTsNCgkJCWV4aXQoMSk7DQoJCX0NCgl9DQoNCglmb3IoaT0wOyBpPEY7 IGkrKykgew0KCQlmb3Ioaj0wOyBqPEM7IGorKykgcHJpbnRmKCIlaSAgIiwg YVtpXVtqXSk7DQoJCXB1dGNoYXIoJ1xuJyk7DQoJfQ0KDQovKglmb3IoaT0w OyBpPEY7IGkrKykNCgkJZm9yKGo9MDsgajxDOyBqKyspIGFbaV1bal09J3gn OyAqLw0KDQoJcmV0dXJuIDA7DQp9DQo= ------=_NextPart_1050864666_5239731869488486 Content-Type: text/plain; name="out.txt" Content-Disposition: attachment; filename="out.txt" Content-Transfer-Encoding: quoted-printable Content-length: 106 -120 -106 4 8 0=20=20 0 0 0 0 0=20=20 0 0 0 0 0=20=20 0 0 0 0 0=20=20 0 0 0 0 0=20=20 ------=_NextPart_1050864666_5239731869488486 Content-Type: application/octet-stream; name="fine.c" Content-Disposition: attachment; filename="fine.c" Content-Transfer-Encoding: base64 Content-length: 696 I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQoNCiNk ZWZpbmUgRgk1DQojZGVmaW5lIEMJNQ0KDQppbnQgbWFpbigpDQp7DQoJaW50 IAlpLGo7DQoJY2hhciAqKiBhOw0KDQoJYT0oY2hhciAqKikgY2FsbG9jKEYs IHNpemVvZihjaGFyKSk7DQoJZm9yKGk9MDsgaTxGOyBpKyspIHsNCgkJKihh K2kpPShjaGFyICopIGNhbGxvYyhDLCBzaXplb2YoY2hhcikpOw0KCQkqKGEr aSk9KGNoYXIgKikgY2FsbG9jKEMsIHNpemVvZihjaGFyKSk7DQoJCWlmKCAq KGEraSkgPT0gTlVMTCApIHsNCgkJCXByaW50ZigiQ2FsbG9jIEZhaWx1cmVc biIpOw0KCQkJZXhpdCgxKTsNCgkJfQ0KCX0NCg0KCWZvcihpPTA7IGk8Rjsg aSsrKSB7DQoJCWZvcihqPTA7IGo8QzsgaisrKSBwcmludGYoIiVpICAiLCBh W2ldW2pdKTsNCgkJcHV0Y2hhcignXG4nKTsNCgl9DQoNCglmb3IoaT0wOyBp PEY7IGkrKykNCgkJZm9yKGo9MDsgajxDOyBqKyspIGFbaV1bal09J3gnOw0K DQoJcmV0dXJuIDA7DQp9DQo= ------=_NextPart_1050864666_5239731869488486--