Tcl Source Code

View Ticket
Login
Ticket UUID: 553320
Title: segfault in tests/fileName.test
Type: Bug Version: None
Submitter: msofer Created on: 2002-05-07 15:45:02
Subsystem: None Assigned To: vincentdarley
Priority: 8 Severity:
Status: Closed Last Modified: 2002-05-08 01:05:07
Resolution: Fixed Closed By: vincentdarley
    Closed on: 2002-05-07 18:05:07
Description:
The HEAD produces a segfault on linux (RH7.2) in test
filename-11.48. Incomplete fix?

A detail: (line 1275) test for existence of file named
$horribleglobname before renaming: when a first run
does not complete, a second one fails on the "rename"
complaining that the file already exists.
User Comments: vincentdarley added on 2002-05-08 01:05:07:
Logged In: YES 
user_id=32170

Thanks for the quick testing.  I've committed the fix, and 
the test change you suggest.

msofer added on 2002-05-08 00:57:16:

File Added - 22669: 553320.patch

Logged In: YES 
user_id=148712

That fixed the segfault; test suite A_OK now. I enclose this
as a patch - or should I rather commit it?

nobody added on 2002-05-08 00:06:20:
Logged In: NO 

Around line 1791, change the comment and code that follows 
to this:

/*
 * Error cases.  We re-get the 
interpreter's result,
 * just to be sure it hasn't changed, and 
we reset
 * the 'join' flag to zero, since we 
haven't yet
 * made use of it.
 */
badTypesArg:
resultPtr = Tcl_GetObjResult(interp);
Tcl_AppendToObj(resultPtr, "bad argument to 
\"-types\": ", -1);
Tcl_AppendObjToObj(resultPtr, look);
result = TCL_ERROR;
join = 0;
goto endOfGlob;
badMacTypesArg:
resultPtr = Tcl_GetObjResult(interp);
Tcl_AppendToObj(resultPtr,
   "only one MacOS type or creator argument"
   " to \"-types\" allowed", -1);
result = TCL_ERROR;
join = 0;
goto endOfGlob;

that might fix the problem.  I can't see anything else 
which could be wrong.

msofer added on 2002-05-07 23:55:53:
Logged In: YES 
user_id=148712

With MEM_DEBUG on, no segfault but memory corruption in the
same test:

[mig@mini unix]$ ./tcltest ../tests/fileName.test 

==== filename-11.48 Tcl_GlobCmd FAILED
==== Contents of test case:

    list [catch {glob -types abcde -dir foo -join * *} msg] $msg

---- Result was:
1 {bad argument to "-types": abcde}
---- Result should have been (exact matching):
°aaaaaaaaaaaaaaaaaaa
==== filename-11.48 FAILED

fileName.test:  Total   380     Passed  326     Skipped 53 
    Failed  1
Number of tests skipped for each constraint:
        18      macOnly
        7       nonPortable
        28      pcOnly

msofer added on 2002-05-07 23:46:58:

File Added - 22665: BackTrace

Logged In: YES 
user_id=148712

The segfault disappears when compiling with symbols.
Enclosing a  backtrace without symbols; will still try to
get more info with MEM_DEBUG on.

vincentdarley added on 2002-05-07 23:01:48:
Logged In: YES 
user_id=32170

Since this particular test works fine for me, I'm going to 
need some more information to go on, like a stack trace or 
whatever....

I'll fix line 1275, and a potential problem in test 16.16 
on Windows, but I can't do much about your segfault yet.

Attachments: