delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/12/12:26:43

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 12 Oct 2003 18:30:55 +0200
From: thomas <tom AT huno DOT net>
Reply-To: thomas <tom AT huno DOT net>
X-Priority: 3 (Normal)
Message-ID: <446671156.20031012183055@huno.net>
To: Cygwin AT cygwin DOT com
Subject: Re: std::ofstream causes segfault in 1.5.x
In-Reply-To: <1041647656.20031012170712@huno.net>
References: <9525451343 DOT 20031010223436 AT huno DOT net>
<20031012083402 DOT GB10908 AT cygbert DOT vinschen DOT de>
<1041647656 DOT 20031012170712 AT huno DOT net>
MIME-Version: 1.0

>>>    28 7293919 [main] cdrdao 1576 mmap64: addr 0, len 1065811968, prot 3, flags 22, fd -1, off 0

>> Can you tell me why the process tries to mmap 1065811968 bytes == ~1Gig?
>> That won't work, nor would it under 1.3.22 on the same machine.  The cause
>> for this is outside of the strace and very likely outside of mmap itself.

> Hmmm that is certainly most interesting. It's just opening a simple file to
> write ~10 lines to it. The exact same source code compiled in a 1.3.18
> environment works perfectly. I'm gonna debug it some more and see if i can
> find what makes the difference.

Ok replying to myself here. Except for some changed function names there is
little difference between the the two strace outputs. The only difference
appears to be that the 1.3.18 one doesn't seem to call mmap at all. Maybe
someone can take a minute and see if he/she spots a crucial difference and
can point me in some direction. I removed some probably irrelevant parts
like symlink_info and path convert from the strace output.


1.3.18:

   44 7574117 [main] cdrdao 956 open: open (test.toc, 0x601)
   [...]
   26 7574807 [main] cdrdao 956 dtable::build_fhandler: fd 3, fh 0x61120930
   20 7574827 [main] cdrdao 956 fhandler_base::open: (C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc, 0x100601) query_open 0
   21 7574848 [main] cdrdao 956 alloc_sd: uid 1003, gid 513, attribute 1B4
   29 7574943 [main] cdrdao 956 alloc_sd: ACL-Size: 100
   21 7574964 [main] cdrdao 956 alloc_sd: Created SD-Size: 176
 6672 7581636 [main] cdrdao 956 fhandler_base::open: 0x710 = CreateFile (C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc, 0x40000000, 0x7, 0x22F714, 0x2, 0x2000080, 0)
   97 7581733 [main] cdrdao 956 fhandler_base::set_flags: flags 0x100601, supplied_bin 0x10000
   23 7581756 [main] cdrdao 956 fhandler_base::set_flags: filemode set to binary
   18 7581774 [main] cdrdao 956 fhandler_base::open: 1 = fhandler_base::open (C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc, 0x100601)
   22 7581796 [main] cdrdao 956 fhandler_disk_file::open: 1 = fhandler_disk_file::open (C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc, 0x601)
   22 7581818 [main] cdrdao 956 open: 3 = open (test.toc, 0x601)
   [...]
   33 7582263 [main] cdrdao 956 fhandler_disk_file::fstat_by_handle: 1 = GetFileInformationByHandle (C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc, 1808)
   26 7582289 [main] cdrdao 956 get_nt_attribute: file: C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc
   19 7582308 [main] cdrdao 956 read_sd: file = C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc
   60 7582368 [main] cdrdao 956 read_sd: file = C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc: len=176
   45 7582413 [main] cdrdao 956 get_nt_attribute: file: C:\Programme\cygDEV\home\root\cdrdao\dao\test.toc 1B4, uid 1003, gid 513
   21 7582434 [main] cdrdao 956 fhandler_disk_file::fstat_helper: 0 = fstat (, 0x22F948) st_atime=3F897864 st_size=0, st_mode=0x81B4, st_ino=2863079, sizeof=88
   21 7582455 [main] cdrdao 956 fstat64: 0 = fstat (3, 0x22F948)
   50 7582505 [main] cdrdao 956 writev: writev (3, 0x22FA3C, 1)
   20 7582525 [main] cdrdao 956 fhandler_base::write: binary write
   96 7582621 [main] cdrdao 956 fhandler_base::write: 36 = write (0xA063218, 36)
   22 7582643 [main] cdrdao 956 writev: 36 = write (3, 0x22FA3C, 1), errno 2
   21 7582664 [main] cdrdao 956 writev: writev (3, 0x22FA3C, 1)

1.5.5 (latest CVS snapshot):

   41 7340917 [main] cdrdao 376 open: open (test.toc, 0x601)
   [...]
   28 7341626 [main] cdrdao 376 build_fh_pc: fh 0x61654A74
   20 7341646 [main] cdrdao 376 fhandler_base::open: (C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc, 0x100601) query_open 0
   23 7341669 [main] cdrdao 376 alloc_sd: uid 1003, gid 513, attribute 1B4
   26 7341743 [main] cdrdao 376 alloc_sd: ACL-Size: 100
   21 7341764 [main] cdrdao 376 alloc_sd: Created SD-Size: 176
  226 7341990 [main] cdrdao 376 fhandler_base::open: 0x6B4 = CreateFile (C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc, 0x40000000, 0x7, 0x22F608, 0x2, 0x2000080, 0)
   44 7342034 [main] cdrdao 376 fhandler_base::set_flags: flags 0x100601, supplied_bin 0x10000
   20 7342054 [main] cdrdao 376 fhandler_base::set_flags: filemode set to binary
   17 7342071 [main] cdrdao 376 fhandler_base::open: 1 = fhandler_base::open (C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc, 0x100601)
   19 7342090 [main] cdrdao 376 fhandler_base::open_fs: 1 = fhandler_disk_file::open (C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc, 0x601)
   18 7342108 [main] cdrdao 376 open: 3 = open (test.toc, 0x601)
   [...]
   68 7342176 [main] cdrdao 376 fhandler_base::fstat_by_handle: 1 = GetFileInformationByHandle (C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc, 1716)
   96 7342272 [main] cdrdao 376 get_file_attribute: file: C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc
   25 7342297 [main] cdrdao 376 read_sd: file = C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc
   86 7342383 [main] cdrdao 376 read_sd: file = C:\Programme\cygDEV\home\root\cdrdao-1.1.7\dao\test.toc: len=176
   24 7342454 [main] cdrdao 376 get_info_from_sd: ACL = 1B4, uid 1003, gid 513
   18 7342472 [main] cdrdao 376 fhandler_base::fstat_helper: 0 = fstat (, 0x22F604) st_atime=3F89776C st_size=0, st_mode=0x81B4, st_ino=425, sizeof=96
   20 7342492 [main] cdrdao 376 fstat64: 0 = fstat (3, 0x22F604)
   24 7342516 [main] cdrdao 376 mmap64: addr 0, len 1065975808, prot 3, flags 22, fd -1, off 0
  397 7342942 [main] cdrdao 376 seterrno_from_win_error: ../../../../cygwin/winsup/cygwin/mmap.cc:927 windows error 1455

thomas


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019