delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/03/14:26:25

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Sent: 3 Aug 2001 18:25:36 GMT
Reply-To: <jim AT gedae DOT com>
From: "Jim Steed" <jim AT gedae DOT com>
To: <cygwin AT cygwin DOT com>
Subject: 1.3.2: Seg Fault (seemingly) Caused by fopen / symlink_info / GetFileAttributesA
Date: Fri, 3 Aug 2001 14:23:58 -0400
Message-ID: <CLELLGBBBGDMONHEAOJCMEHGCDAA.jim@gedae.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

------=_NextPart_000_0000_01C11C27.EF6F5E00
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello cygwin experts,

I am attempting to port a large application to the Cygwin environment (1.3.2
release on Windows 2000).  The application has previously been ported to and
run on both Win2000 using Visual C++ and on Redhat using gcc with no
(similar or as catastrophic) problems.  However, I have run into a seg fault
while testing the port to Cygwin that I cannot seem to understand or get
past.

The application opens (ie, dlopen()'s) and uses DLLs from a library.  Calls
to a function in a DLL suddenly stop working during application set up.  I
debugged my program, stepping through it, and narrowed the problem down to a
call to fopen.  The call to fopen returns a valid file pointer (FILE *)
value that can be fscanf'ed with no problem, however any call to the
function in the DLL after that causes a segfault (variables from the DLL are
suddenly "Address 0x... out of bounds").  In simpler words, if I have the
following code:

  TEST_DLL();
  fptr = fopen("FGlibaries/boxes/internal/dequeue","r");
  TEST_DLL();

where TEST_DLL() tests the function in the DLL:  The first test returns
success and the second test segfaults and crashes the application.

I downloaded the Cygwin sources and compiled them with -g to further
investigate.  I am not sure how to interpret the results of this or what to
try next.  After fast forwarding to the call to fopen in question, I did a

  (gdb) disp TEST_DLL()

and stepped through my application.  The last few lines of the step through
are as follows:

---BEGIN OUTPUT---
symlink_info::check (this=0x2d0e574,
    path=0x2d0e454 "c:\\gedev\\user\\redhat\\FGlibraries\\boxes\\internal",
    suffixes=0x0, opt=33) at /cygwin/src/winsup/cygwin/path.cc:2734
/cygwin/src/winsup/cygwin/path.cc:2734:71982:beg:0x610397b4
1: TEST_DLL() = 1
(gdb)
/cygwin/src/winsup/cygwin/path.cc:2735:71999:beg:0x610397be
1: TEST_DLL() = 1
(gdb)
0x61067d34 in GetFileAttributesA AT 4 () at
/cygwin/src/winsup/cygwin/uinfo.cc:284
/cygwin/src/winsup/cygwin/uinfo.cc:284:8357:beg:0x61067d34
1: TEST_DLL() = 1
(gdb)
0x77e83b81 in _libkernel32_a_iname ()
1: TEST_DLL () = 1
(gdb)
Single stepping until exit from function _libkernel32_a_iname,
which has no line number information.

Breakpoint 2, strncpy (
    dst0=0x2d0e2d4 "v/system/FGlibraries/boxes/internal/dequeue",
    src0=0x2d0e9f4
"c:\\gedev\\system\\FGlibraries\\boxes\\internal\\dequeue",
    count=260) at /cygwin/src/newlib/libc/string/strncpy.c:91
/cygwin/src/newlib/libc/string/strncpy.c:91:1979:beg:0x6108052e
1: TEST_DLL () =
Program received signal SIGSEGV, Segmentation fault.
Disabling display 1 to avoid infinite recursion.
0x29ed9b68 in internal_offset (name=0x58968a "granularity",
type=VALUE_OFFSET,
    table=0x5898bd, offsets=0x589b68) at ../../lots_of_dirs/my_C_code_file.c
---END OUTPUT---

The call to TEST_DLL() segfaults (after numerous previous calls went through
fine), and it appears as if it seg faults because values in
internal_offset() parameters "table" and "offsets" are corrupted by
something deep inside the fopen() function.

Enclosed is a call to "cygcheck" for all my system setup info.  Does anyone
have any recommendations on where to go from here?  I am not sure how or
whether to try to dig deeper into the GetFileAttributesA() function or
_libkernel32_a_iname.

* Is it possible to make -g compiled versions of libkernel32?  Would doing
this provide information I could use to solve this problem?

* Is there a problem related to using a symbolic link (since the function
this error happens in seems to be related to that)?  The file and path to it
do not appear as symbolic links in Cygwin.

Does anyone have any suggestions on workarounds or other possible causes for
my problem?

Any help would be greatly appreciated.  I would very much like to have my
application supported on Cygwin, but I seem to be very stuck currently.

Thank you very much,
jim steed
jim DOT steed AT gedae DOT com

------=_NextPart_000_0000_01C11C27.EF6F5E00
Content-Type: application/octet-stream;
	name="check.080301"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="check.080301"

=0A=
Cygnus Win95/NT Configuration Diagnostics=0A=
Current System Time: Fri Aug  3 12:07:46 2001=0A=
=0A=
WinNT Ver 5.0 build 2195 Service Pack 1=0A=
=0A=
Path:	/bin=0A=
	/cygdrive/c/gedev/system/../user/redhat/object=0A=
	.=0A=
	/usr/bin=0A=
	/usr/X11R6/bin=0A=
	/usr/local/bin=0A=
=0A=
SysDir: C:\WINNT\System32=0A=
WinDir: C:\WINNT=0A=
=0A=
PWD =3D `/cygdrive/c/gedev/user/redhat'=0A=
=0A=
NUMBER_OF_PROCESSORS =3D `1'=0A=
PROMPT =3D `$P$G'=0A=
GEDAE =3D `/cygdrive/c/gedev/system'=0A=
LOGONSERVER =3D `\\HECTOR'=0A=
OS2LIBPATH =3D `C:\WINNT\system32\os2\dll;'=0A=
COLORFGBG =3D `0;default;15'=0A=
COMSPEC =3D `C:\WINNT\system32\cmd.exe'=0A=
WINDOWID =3D `2097155'=0A=
!C: =3D `C:\cygwin\usr\X11R6\bin\startup-scripts'=0A=
SYSTEMDRIVE =3D `C:'=0A=
HOSTNAME =3D `HECTOR'=0A=
INCLUDE =3D `C:\Program Files\Microsoft Visual =
Studio\VC98\atl\include;C:\Program Files\Microsoft Visual =
Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual =
Studio\VC98\include'=0A=
PROCESSOR_REVISION =3D `0806'=0A=
MSDEVDIR =3D `C:\Program Files\Microsoft Visual Studio\Common\MSDev98'=0A=
PATHEXT =3D `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'=0A=
COMPUTERNAME =3D `HECTOR'=0A=
WINDIR =3D `C:\WINNT'=0A=
USERPROFILE =3D `C:\Documents and Settings\Jim Steed'=0A=
PROGRAMFILES =3D `C:\Program Files'=0A=
!:: =3D `::\'=0A=
MACHTYPE =3D `i686-pc-cygwin'=0A=
PROCESSOR_IDENTIFIER =3D `x86 Family 6 Model 8 Stepping 6, GenuineIntel'=0A=
OS =3D `Windows_NT'=0A=
OLDPWD =3D `/lib'=0A=
PROCESSOR_ARCHITECTURE =3D `x86'=0A=
TEMP =3D `/cygdrive/c/DOCUME~1/JIMSTE~1/LOCALS~1/Temp'=0A=
EDITOR =3D `notepad'=0A=
PROCESSOR_LEVEL =3D `6'=0A=
SYSTEMROOT =3D `C:\WINNT'=0A=
GEDEV =3D `/cygdrive/c/gedev/development'=0A=
COLORTERM =3D `rxvt-xpm'=0A=
TMP =3D `/cygdrive/c/DOCUME~1/JIMSTE~1/LOCALS~1/Temp'=0A=
DISPLAY =3D `127.0.0.1:0.0'=0A=
HOMEDRIVE =3D `C:'=0A=
LIB =3D `C:\Program Files\Microsoft Visual =
Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib'=0A=
ALLUSERSPROFILE =3D `C:\Documents and Settings\All Users'=0A=
SHLVL =3D `1'=0A=
APPDATA =3D `C:\Documents and Settings\Jim Steed\Application Data'=0A=
COMMONPROGRAMFILES =3D `C:\Program Files\Common Files'=0A=
HOMEPATH =3D `\'=0A=
USERDOMAIN =3D `HECTOR'=0A=
USERNAME =3D `Jim Steed'=0A=
SHELL =3D `/bin/bash'=0A=
HOSTTYPE =3D `i686'=0A=
OSTYPE =3D `cygwin'=0A=
TERM =3D `xterm'=0A=
_ =3D `/bin/cygcheck'=0A=
TZ =3D `EST5EDT4,M4.1.0/2,M10.5.0/2'=0A=
=0A=
HKEY_CURRENT_USER\Software\Cygnus Solutions=0A=
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin=0A=
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2=0A=
  (default) =3D `/cygdrive'=0A=
  cygdrive flags =3D 0x00000022=0A=
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options=0A=
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Menu=
Order\Start Menu\Programs\Cygnus Solutions=0A=
  (default) =3D (unsupported type)=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/=0A=
  (default) =3D `C:/cygwin'=0A=
  flags =3D 0x0000000a=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin=0A=
  (default) =3D `C:/cygwin/bin'=0A=
  flags =3D 0x0000000a=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib=0A=
  (default) =3D `C:/cygwin/lib'=0A=
  flags =3D 0x0000000a=0A=
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options=0A=
=0A=
a:  fd           N/A    N/A                    =0A=
c:  hd  FAT32   7758Mb  64% CP    UN           =0A=
d:  cd  CDFS       0Mb -2147483548%    CS              Audio CD=0A=
=0A=
C:\cygwin\bin  /usr/bin  system  binmode=0A=
C:\cygwin\lib  /usr/lib  system  binmode=0A=
C:\cygwin  /        system  binmode=0A=
c:    /cygdrive/c  user    binmode,noumount=0A=
d:    /cygdrive/d  user    binmode,noumount=0A=
=0A=
Found: C:\cygwin\bin\bash.exe=0A=
Found: C:\cygwin\bin\cat.exe=0A=
Found: C:\cygwin\bin\cpp.exe=0A=
Found: C:\cygwin\bin\find.exe=0A=
Found: C:\cygwin\bin\gcc.exe=0A=
Found: C:\cygwin\bin\gdb.exe=0A=
Found: C:\cygwin\bin\ld.exe=0A=
Found: C:\cygwin\bin\ls.exe=0A=
Found: C:\cygwin\bin\make.exe=0A=
Found: C:\cygwin\bin\sh.exe=0A=
=0A=
   56k 2000/12/03 C:\cygwin\bin\cygbz21.0.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygbz21.0.dll" v0.0 ts=3D2000/11/20 18:53=0A=
  390k 2000/12/05 C:\cygwin\bin\cygtcl80.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygtcl80.dll" v0.0 ts=3D2000/11/25 20:39=0A=
    5k 2000/12/05 C:\cygwin\bin\cygtclpip80.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
   10k 2000/12/05 C:\cygwin\bin\cygtclreg80.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygtclreg80.dll" v0.0 ts=3D2000/11/25 20:39=0A=
  623k 2000/12/05 C:\cygwin\bin\cygtk80.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygtk80.dll" v0.0 ts=3D2000/11/25 20:43=0A=
   18k 2000/10/23 C:\cygwin\bin\cyggdbm.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cyggdbm.dll" v0.0 ts=3D2000/10/22 22:26=0A=
   21k 2001/06/20 C:\cygwin\bin\cygintl.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygintl.dll" v0.0 ts=3D2001/6/20 13:09=0A=
   45k 2001/07/04 C:\cygwin\bin\cygjbig1.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygjbig1.dll" v0.0 ts=3D2001/7/3 23:25=0A=
  119k 2001/06/06 C:\cygwin\bin\cygjpeg6b.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygjpeg6b.dll" v0.0 ts=3D2001/6/6 0:27=0A=
  163k 2001/05/06 C:\cygwin\bin\cygpng2.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygpng2.dll" v0.0 ts=3D2001/5/6 0:05=0A=
   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygform5.dll" v0.0 ts=3D2001/4/25 1:28=0A=
   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygmenu5.dll" v0.0 ts=3D2001/4/25 1:27=0A=
  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygncurses++5.dll" v0.0 ts=3D2001/4/25 1:29=0A=
  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygncurses5.dll" v0.0 ts=3D2001/4/25 1:17=0A=
   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygpanel5.dll" v0.0 ts=3D2001/4/25 1:27=0A=
   17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cyghistory4.dll" v0.0 ts=3D2001/1/6 23:34=0A=
   21k 2001/06/28 C:\cygwin\bin\cyghistory5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cyghistory5.dll" v0.0 ts=3D2001/6/27 22:27=0A=
  108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygreadline4.dll" v0.0 ts=3D2001/1/6 23:34=0A=
  135k 2001/06/28 C:\cygwin\bin\cygreadline5.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygreadline5.dll" v0.0 ts=3D2001/6/27 22:27=0A=
   81k 2000/12/05 C:\cygwin\bin\cygitcl30.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygitcl30.dll" v0.0 ts=3D2000/11/25 20:43=0A=
   35k 2000/12/05 C:\cygwin\bin\cygitk30.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygitk30.dll" v0.0 ts=3D2000/11/25 20:43=0A=
  245k 2001/06/12 C:\cygwin\bin\cygtiff3.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygtiff3.dll" v0.0 ts=3D2001/6/12 13:25=0A=
   41k 2001/07/04 C:\cygwin\bin\cygXpm-noX4.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygXpm-noX4.dll" v0.0 ts=3D2001/7/3 21:21=0A=
   45k 2001/07/04 C:\cygwin\bin\cygXpm-X4.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygXpm-X4.dll" v0.0 ts=3D2000/11/19 21:45=0A=
   49k 2001/02/03 C:\cygwin\bin\cygz.dll - os=3D4.0 img=3D1.0 sys=3D4.0=0A=
                  "cygz.dll" v0.0 ts=3D2001/2/3 15:35=0A=
 5051k 2001/08/03 C:\cygwin\bin\cygwin1.dll - os=3D4.0 img=3D1.0 =
sys=3D4.0=0A=
                  "cygwin1.dll" v0.0 ts=3D2001/8/2 23:15=0A=
    Cygwin DLL version info:=0A=
        dll major: 1003=0A=
        dll minor: 3=0A=
        dll epoch: 19=0A=
        dll bad signal mask: 19005=0A=
        dll old termios: 5=0A=
        dll malloc env: 28=0A=
        api major: 0=0A=
        api minor: 42=0A=
        shared data: 3=0A=
        dll identifier: cygwin1=0A=
        mount registry: 2=0A=
        cygnus registry name: Cygnus Solutions=0A=
        cygwin registry name: Cygwin=0A=
        program options name: Program Options=0A=
        cygwin mount registry name: mounts v2=0A=
        cygdrive flags: cygdrive flags=0A=
        cygdrive prefix: cygdrive prefix=0A=
        cygdrive default prefix: =0A=
        build date: Thu Aug 2 23:15:07 2001=0A=
        shared id: cygwin1S3=0A=
=0A=
   73k 2001/07/27 C:\cygwin\usr\local\bin\cygltdl-3.dll - os=3D4.0 =
img=3D1.0 sys=3D4.0=0A=
                  "cygltdl-3.dll" v0.0 ts=3D2001/7/27 13:44=0A=
Use -h to see help about each section=0A=


------=_NextPart_000_0000_01C11C27.EF6F5E00
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_0000_01C11C27.EF6F5E00--

- Raw text -


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