public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2897: Segmentation fault by calling methods of ifstream
@ 2001-05-22  5:16 pompl
  0 siblings, 0 replies; only message in thread
From: pompl @ 2001-05-22  5:16 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2897
>Category:       c++
>Synopsis:       Segmentation fault by calling methods of ifstream
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 22 05:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Marc Pompl
>Release:        2.95.2
>Organization:
>Environment:
sparc-sun-solaris2.6  
>Description:
I have build a little program to so some wild stuff.
In this routine I am using ifstream, such as seekg()
and so on as given in several examples.
And on my Linux it works quite well, but on Solaris 2.6 
every call to such routines leads to a segmentation fault.

The ddd tells:

Program received signal SIGSEGV, Segmentation fault.
0xff2c5934 in _malloc_unlocked ()

and backtrace show me this:

...
in filebuf::seekoff () at fileops.c: 454
in _IO_doallocbuf () at genops.c: 322
in filebuf::doallocate () at filebuf.cc:151
in _IO_file_doallocate () at  filedoalloc.c: 102
in malloc ()
in _malloc_unlocked ()

Here follows he code snapshot:

  ifstream eingabe(dateiname);
  if (!eingabe) {
    cerr << "Datei '" << dateiname << "' konnte nicht geoeffnet werden!\n";cerr.flush();
    exit(5);
  }
  //cerr << "Position: " << eingabe.tellg() << "\n"; cerr.flush();
    // If you undocument the upper line you will get a segmentation fault!
  links = 0;
  eingabe.seekg(0,ios::end);
    // Here also!
 
Hope, you are able to fix this bug!
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-22  5:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-22  5:16 c++/2897: Segmentation fault by calling methods of ifstream pompl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).