From owner-freebsd-questions@FreeBSD.ORG Thu Jun 9 19:53:59 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DC1A16A41C for ; Thu, 9 Jun 2005 19:53:59 +0000 (GMT) (envelope-from keyser456@verizon.net) Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1AC943D4C for ; Thu, 9 Jun 2005 19:53:58 +0000 (GMT) (envelope-from keyser456@verizon.net) Received: from mdis ([66.14.40.249]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IHU006R11XXJQXB@vms048.mailsrvcs.net> for freebsd-questions@freebsd.org; Thu, 09 Jun 2005 14:53:58 -0500 (CDT) Date: Thu, 09 Jun 2005 12:54:08 -0700 From: "Keyser" To: Message-id: <002001c56d2c$fffd5bf0$5b01a8c0@mdis> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-Priority: 3 X-MSMail-priority: Normal Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: g++ successfully compiled "Hello World" program causes segfault at runtime X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2005 19:53:59 -0000 I posted this topic a few days ago but still haven't found a solution = yet. However, I believe I'm able to provide more information now. Here = is a log showing what I'm up against: vitoc# pwd /usr/temp/cpp vitoc# ls test.cpp vitoc# cat test.cpp #include using namespace std; int main() { cout << "Hello world!"; return 0; } vitoc# g++ -g -o test test.cpp vitoc# ls test test.cpp vitoc# gdb test GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you = are welcome to change it and/or distribute copies of it under certain = conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for = details. This GDB was configured as "i386-marcel-freebsd"... (gdb) run Starting program: /usr/temp/cpp/test Program received signal SIGSEGV, Segmentation fault. 0x2819d7de in wctype () from /lib/libc.so.5 (gdb) bt #0 0x2819d7de in wctype () from /lib/libc.so.5 #1 0x28119002 in std::ctype::_M_convert_to_wmask () from /usr/lib/libstdc++.so.4 #2 0x28119453 in std::ctype::_M_initialize_ctype () from /usr/lib/libstdc++.so.4 #3 0x28119b08 in std::ctype::ctype () from = /usr/lib/libstdc++.so.4 #4 0x28112a69 in std::locale::_Impl::_Impl () from = /usr/lib/libstdc++.so.4 #5 0x281120ba in std::locale::_S_initialize_once () from /usr/lib/libstdc++.so.4 #6 0x28112128 in std::locale::_S_initialize () from = /usr/lib/libstdc++.so.4 #7 0x28111e9b in std::locale::locale () from /usr/lib/libstdc++.so.4 #8 0x280e3531 in __gnu_cxx::stdio_sync_filebuf >::stdio_sync_filebuf () from = /usr/lib/libstdc++.so.4 #9 0x2810c0e2 in std::ios_base::Init::Init () from = /usr/lib/libstdc++.so.4 #10 0x0804888e in __static_initialization_and_destruction_0 = (__initialize_p=3D1, __priority=3D65535) at iostream:77 #11 0x080488d9 in global constructors keyed to main () at test.cpp:9 #12 0x08048922 in __do_global_ctors_aux () #13 0x08048536 in _init () #14 0x08048682 in _start () #15 0x00000001 in ?? () (gdb) kill Kill the program being debugged? (y or n) y (gdb) quit vitoc# ldd test test: libstdc++.so.4 =3D> /usr/lib/libstdc++.so.4 (0x28076000) libm.so.3 =3D> /lib/libm.so.3 (0x28148000) libc.so.5 =3D> /lib/libc.so.5 (0x28163000) vitoc# g++ -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.4.2 [FreeBSD] 20040728 vitoc# This is on FreeBSD 5.4 obtained from a freebsd.org mirror. Any ideas? = Thanks!