Issue634

classification
Title Debug Assertion Failed! f:\dd\vctools\crt_bld\self_x86\crt\src\getcwd.c
Type defect Module legal
Severity crash Platform mswindows
Keywords error handling Nosy List adrian
explanation
process
These controls should only be changed by committers and tracker administrators.
Status closed   Reason not our bug
Superseder  
Priority cosmetic   Assigned To

Created on 2009-11-21.11:47:25 by adrian, last changed 2013-09-02.06:45:04 by stephen.

Files
File name Uploaded Type Edit Remove
Installation adrian, 2009-11-21.11:57:16 application/octet-stream
Installation adrian, 2009-11-21.12:40:08 application/octet-stream
nt.c-2009-11-21T205718+0100.patch adrian, 2009-11-21.19:59:31 text/plain
Messages
msg1999 [hidden] ([hidden]) Date: 2009-11-21.19:59:31
I have a patch for the crash, but it shows and arguable regression in 
bevavior against 21.4.19.

Old behavior of f-n-d was to return non-existent drive unmodified.

New behavior rerturns nil in such cases.

docstring says to return nil if FILENAME does not include a directory.

This leaves some room for mis-interpretation.

Consequentially C-x d f : RET will wipe that entry on completion, where 
old behavior left it intact and said [No match] after it.

I'd appreciate your opinions.

Regards,
Adrian

With my fix (courtesy Mozilla project) :

(file-name-directory "c:")
"C:\\Programme\\XEmacs\\XEmacs-21.5-b29\\i586-pc-win32\\"
(file-name-directory "f:")
nil
(file-name-directory "NUL")
nil
(file-name-directory "/")
"/"
(file-name-directory "\\")
"\\"

21.4.19

(file-name-directory "c:")
"C:\\Hacking\\cvs.xemacs.org\\XEmacs\\xemacs-21.4\\src\\"
(file-name-directory "f:")
"f:"
(file-name-directory "NUL")
nil
(file-name-directory "/")
"/"
(file-name-directory "\\")
"\\"
msg1998 [hidden] ([hidden]) Date: 2009-11-21.13:02:15
Here's the backtrace for
http://tracker.xemacs.org/XEmacs/its/file131/Installation

13:58 21.11.2009
 	msvcr90d.dll!00aa921b() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded 
for msvcr90d.dll]	
 	msvcr90d.dll!00aa918c() 	
 	msvcr90d.dll!00aa9094() 	
 	xemacs.exe!mswindows_getdcwd(int drivelet=6)  Line 1820	C++
>	xemacs.exe!Ffile_name_directory(long filename=37785972)  Line 
393 + 0x13 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=2, long * args=0x0082ec84)  Line 
3907 + 0x19 bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x046b2e98, int stack_depth=8, long * constants_data=0x02e2cf10)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082ed78)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=5, long * args=0x0082ed74)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x04697f60, int stack_depth=5, long * constants_data=0x02e2c8f0)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082ee64)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=4, long * args=0x0082ee60)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!call3(long fn=19934476, long arg0=37785972, long 
arg1=37757292, long arg2=19968556)  Line 4592 + 0x23 bytes	C++
 	xemacs.exe!Ftry_completion(long string=37785972, long 
collection=19934476, long predicate=37757292)  Line 355 + 0xd bytes	
C++
 	xemacs.exe!Ffuncall(int nargs=4, long * args=0x0082ef64)  Line 
3907 + 0x3c bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x046a6e08, int stack_depth=5, long * constants_data=0x02e28838)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082f05c)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=1, long * args=0x0082f058)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!apply1(long fn=50565216, long arg=19968556)  Line 
4533	C++
 	xemacs.exe!Fcall_interactively(long function=19889284, long 
record_flag=19968556, long keys=19968556)  Line 458 + 0xd bytes	C++
 	xemacs.exe!Fcommand_execute(long cmd=19889284, long 
record_flag=19968556, long keys=19968556)  Line 3117 + 0x14 bytes	
C++
 	xemacs.exe!execute_command_event(command_builder * 
command_builder=0x02ef1770, long event=34587748)  Line 4288 + 0x12 bytes	
C++
 	xemacs.exe!Fdispatch_event(long event=34587748)  Line 4600 + 
0x21 bytes	C++
 	xemacs.exe!Fcommand_loop_1()  Line 600 + 0xa bytes	C++
 	xemacs.exe!condition_case_1(long handlers=19964908, long (long)* 
bfun=0x0104ddf0, long barg=19968556, long (long, long)* hfun=0x0104da00, 
long harg=19968556)  Line 1929	C++
 	xemacs.exe!command_loop_3()  Line 266	C++
 	xemacs.exe!Ffuncall(int nargs=2, long * args=0x0082f384)  Line 
3907 + 0x19 bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x0082f3d0, int stack_depth=2, long * constants_data=0x02e24d18)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!Fbyte_code(long instructions=49467732, long 
constants=48385288, long stack_depth=5)  Line 2622 + 0xb bytes	C++
 	xemacs.exe!Feval(long form=49469036)  Line 3655 + 0x42 bytes	
C++
 	xemacs.exe!internal_catch(long tag=19930780, long (long)* 
func=0x0106bad0, long arg=49469036, int * volatile threw=0x00000000, 
long * volatile thrown_tag=0x00000000, long * volatile 
backtrace_before_throw=0x00000000)  Line 1532	C++
 	xemacs.exe!execute_rare_opcode(long * stack_ptr=0x0082f5e8, 
const unsigned char * unused_program_ptr=0x04677401, Opcode 
opcode=Bcatch)  Line 1419 + 0x18 bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x046772b0, int stack_depth=6, long * constants_data=0x02e25540)  
Line 754 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082f6d8)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=8, long * args=0x0082f6d4)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x046bc8e8, int stack_depth=9, long * constants_data=0x02e2b4c0)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082f7c8)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=8, long * args=0x0082f7c4)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x04726f78, int stack_depth=8, long * constants_data=0x02e2c6b0)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082f8b8)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=9, long * args=0x0082f8b4)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x04726f10, int stack_depth=9, long * constants_data=0x02e2c728)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082f9b0)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Ffuncall(int nargs=5, long * args=0x0082f9ac)  Line 
3946 + 0xa bytes	C++
 	xemacs.exe!execute_optimized_program(const unsigned char * 
program=0x00e9ffe0, int stack_depth=7, long * constants_data=0x02d2e280)  
Line 862 + 0x8 bytes	C++
 	xemacs.exe!funcall_compiled_function(long fun=0, int nargs=0, 
long * args=0x0082fa20)  Line 3496 + 0x18 bytes	C++
 	xemacs.exe!Feval(long form=37670620)  Line 3716 + 0xc bytes	
C++
 	xemacs.exe!Fcall_interactively(long function=19911436, long 
record_flag=19968556, long keys=19968556)  Line 401	C++
 	xemacs.exe!Fcommand_execute(long cmd=19911436, long 
record_flag=19968556, long keys=19968556)  Line 3117 + 0x14 bytes	
C++
 	xemacs.exe!execute_command_event(command_builder * 
command_builder=0x02ef1770, long event=35033804)  Line 4288 + 0x12 bytes	
C++
 	xemacs.exe!Fdispatch_event(long event=35033804)  Line 4600 + 
0x21 bytes	C++
 	xemacs.exe!Fcommand_loop_1()  Line 600 + 0xa bytes	C++
 	xemacs.exe!condition_case_1(long handlers=19964908, long (long)* 
bfun=0x0104ddf0, long barg=19968556, long (long, long)* hfun=0x0104da00, 
long harg=19968556)  Line 1929	C++
 	xemacs.exe!command_loop_3()  Line 266	C++
 	xemacs.exe!internal_catch(long tag=19688548, long (long)* 
func=0x0104de60, long arg=19968556, int * volatile threw=0x00000000, 
long * volatile thrown_tag=0x00000000, long * volatile 
backtrace_before_throw=0x00000000)  Line 1532	C++
 	xemacs.exe!initial_command_loop(long load_me=19968556)  Line 319	
C++
 	xemacs.exe!xemacs_21_5_b28_i586_pc_win32(int argc=1, wchar_t * * 
argv=0x0082ff20, wchar_t * * unused_envp=0x00000000, int restart=0)  
Line 1209	C++
 	xemacs.exe!main(int argc=1, char * * argv=0x00e94c00, char * * 
unused_envp=0x00e936b8)  Line 3167	C++
 	xemacs.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	xemacs.exe!mainCRTStartup()  Line 403	C
 	kernel32.dll!7c817077() 	
----
msg1997 [hidden] ([hidden]) Date: 2009-11-21.12:40:08
Just reproduced with this attached build configuration as well.

I just used
C-x d f : RET
for the unavailable F drive.
msg1995 [hidden] ([hidden]) Date: 2009-11-21.11:57:16
That's the build information.
This XEmacs would not run on Windows 2000.

But another XEmacs build with same VC++ 2008 Express Edition
without NEW_GC and without KKCC
runs on Windows 2000 and never crashes there.

See also issue 612.
msg1994 [hidden] ([hidden]) Date: 2009-11-21.11:47:24
Happens to me a lot when accessing USB drives which are not currently 
available:

Typical error popup:

---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!

Program: ...xemacs\XEmacs-21.5-b28-a1dd514df5c6+\i586-pc-
win32\xemacs.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\getcwd.c
Line: 233

Expression: ("Invalid Drive",0)

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
---------------------------
Abbrechen   Wiederholen   Ignorieren   
---------------------------

I have build this XEmacs with
C:\Programme\Microsoft Visual Studio 9.0\VC>cl -help
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 
for 80x86
...

Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: VC Express

Microsoft Visual C++ 2008   91909-152-0000052-60003
Microsoft Visual C++ 2008

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU 
(KB945282)   KB945282
This hotfix is for Microsoft Visual C++ 2008 Express Edition with SP1 - 
ENU.
If you later install a more recent service pack, this hotfix will be 
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945282.

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU 
(KB946040)   KB946040
This hotfix is for Microsoft Visual C++ 2008 Express Edition with SP1 - 
ENU.
If you later install a more recent service pack, this hotfix will be 
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946040.

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU 
(KB946308)   KB946308
This hotfix is for Microsoft Visual C++ 2008 Express Edition with SP1 - 
ENU.
If you later install a more recent service pack, this hotfix will be 
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946308.

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU 
(KB947540)   KB947540
This hotfix is for Microsoft Visual C++ 2008 Express Edition with SP1 - 
ENU.
If you later install a more recent service pack, this hotfix will be 
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947540.

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU 
(KB947789)   KB947789
This hotfix is for Microsoft Visual C++ 2008 Express Edition with SP1 - 
ENU.
If you later install a more recent service pack, this hotfix will be 
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947789.

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU 
(KB948127)   KB948127
This hotfix is for Microsoft Visual C++ 2008 Express Edition with SP1 - 
ENU.
If you later install a more recent service pack, this hotfix will be 
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/948127.
History
Date User Action Args
2013-09-02 06:45:04stephensetmessages: - msg2500
2013-09-02 06:44:48stephensetmessages: - msg2505
2013-09-02 06:32:20stephensetfiles: - test2.html
2013-09-02 06:31:22stephensetfiles: - sa4.html
2013-08-26 14:47:55economicseries8setfiles: + sa4.html
nosy: - iWontFixYourBug
messages: + msg2505
2013-08-24 00:19:01iWontFixYourBugsetassignedto: iWontFixYourBug ->
module: + legal, - core code 21.5
2013-08-24 00:18:34iWontFixYourBugsetstatus: done/needs work -> closed
nosy: + iWontFixYourBug
messages: + msg2500
priority: critical -> cosmetic
assignedto: adrian -> iWontFixYourBug
reason: fixed -> not our bug
2013-08-22 12:32:25mushydye13setfiles: + test2.html
2009-11-21 20:00:58adriansetstatus: new -> done/needs work
reason: fixed
2009-11-21 19:59:31adriansetfiles: + nt.c-2009-11-21T205718+0100.patch
messages: + msg1999
2009-11-21 13:02:15adriansetmessages: + msg1998
2009-11-21 12:59:56adriansetassignedto: adrian
2009-11-21 12:40:08adriansetfiles: + Installation
messages: + msg1997
2009-11-21 11:57:16adriansetfiles: + Installation
messages: + msg1995
2009-11-21 11:47:25adriancreate