From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,590105a5ce7f98b5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.germany.com!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-Id: <2518982.DQdlQZ4ST9@linux1.krischik.com> From: Martin Krischik Subject: Re: very long string and Segmentation fault Newsgroups: comp.lang.ada Date: Fri, 07 Jul 2006 20:24:52 +0200 References: <1152261569.199484.272250@m73g2000cwd.googlegroups.com> User-Agent: KNode/0.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 80.218.119.160 (80.218.119.160) NNTP-Posting-Date: Fri, 07 Jul 2006 20:30:10 +0200 X-Trace: 7af4344aea832f57fd20523888 Xref: g2news2.google.com comp.lang.ada:5556 Date: 2006-07-07T20:24:52+02:00 List-Id: zychp@o2.pl wrote: > I have problem with creating very long strings. When I try to create > string bigger than 5MB I get Segmentation fault. Well, you should not ;-) - its certainly a compiler bug. > Tmp: String_Access; > ... > Tmp := new String (1 .. 10_000_000); > > In this line a get Segmentation fault. I use GNAT 3.4.5. Provided by whom? > What is more when I run this code: > > type ttt is array (positive range <> ) of Character; > type ttt_a is access ttt; > Tmp : ttt_a ; > begin > Tmp := new ttt ( 1 .. 10_000_000 ) ; > for i in Tmp'range loop > Tmp(i) := 'x'; > end loop; > > It works fine. But now it's hard to use some Ada.Strings.Fixed > functions. > > What can be the reason of this? How it can be soved? As I said: Certainly a compiler bug so the solution can only be an upgrade. You might want to have a look at: http://gnuada.sf.net. Mind you: There *might* be a new release for SuSE within the week. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com