Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-05-08
01:05 • Closed ticket [553320ffff]: segfault in tests/fileName.test plus 7 other cha... artifact: 13e6c2eea5 user: vincentdarley
00:57 • Add attachment 553320.patch to ticket [553320ffff] artifact: 39d40b5272 user: msofer
00:57 • Ticket [553320ffff] segfault in tests/fileName.test status still Open with 4... artifact: 223c638206 user: msofer
00:06 • Ticket [553320ffff]: 4 changes artifact: be7a11271d user: nobody
2002-05-07
23:55 • Ticket [553320ffff]: 4 changes artifact: 863424cf96 user: msofer
23:46 • Ticket [553320ffff]: 4 changes artifact: e51817942c user: msofer
23:46 • Add attachment BackTrace to ticket [553320ffff] artifact: 56601c4774 user: msofer
23:01 • Ticket [553320ffff] segfault in tests/fileName.test status still Open with 4... artifact: 37f2c7103b user: vincentdarley
15:45 • New ticket [553320ffff]. artifact: a00a3fe0eb user: msofer

segfault in tests/fileName.test

Closed / Fixed553320ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-05-07 15:45:02
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.
vincentdarleyplain2002-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.
msoferplain2002-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.
msoferplain2002-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
nobodyplain2002-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.
msoferplain2002-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?
vincentdarleyplain2002-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.
Log in (anonymous is fine) to add a comment.

Attachments: