linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* bug glibc strlen() or tcl8.2
@ 1999-09-09 14:42 Maurice DIAMANTINI
  1999-09-09 17:35 ` Franz Sirl
  0 siblings, 1 reply; 4+ messages in thread
From: Maurice DIAMANTINI @ 1999-09-09 14:42 UTC (permalink / raw)
  To: linuxppc-dev, Maurice DIAMANTINI


Hello

I'm unable to execute tcl8.2 on linuxppc R5. Although it compile and
run very simply on intel box, solaris, ... but not on linuxppc 


The programm compils OK, but get a core dump at the first execution
of a tcl command (in fact at the "make test")

I've tried on the following environment :


- PM7500 + update G3
- kernel 2.2.6

and:

- PowerMac Blue G3 - 400MHz - rev 1
- kernel linux 2.2.10 provide by rshaw

then: 

- PowerMac Blue G3 - 400MHz - rev 1
- kernel linux 2.2.10 provide by rshaw
- with gcc-2.95.1 (+ the last binutils) built with the magic
  "make bootstrap" and installed into a separate directory.

then: 

- PowerMac Blue G3 - 400MHz - rev 1
- kernel linux 2.2.10 provide by rshaw
- with gcc-2.95.1 (+ the last binutils) built with the magic
  "make bootstrap" and installed into a separate directory.
- upgrade to glibc-2.1.2-4a.ppc.rpm

########################################################################
Here ara my test which gdb and some fprintf added to the file
tclResult.c:

When I run tcltest:

----------------------
./tcltest /home/diam/local/src/tcl/unix/../tests/all.tcl

fprint before strlen
fprint sizeof(tmpArgList)=12
make: *** [test] Error 139

----------------------
gdb tcltest core


GNU gdb 4.17.0.11 with Linux support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ppc-unknown-linux"...
Core was generated by `./tcltest /home/diam/local/src/tcl/unix/../tests/all.tcl'.
Program terminated with signal 11, Erreur de segmentation.
Reading symbols from /home/diam/tmp/compil/tcl_linuxppc_build/libtcl8.2.so...done.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld.so.1...done.
#0  0x161ac14 in Letext () at soinit.c:59
soinit.c:59: Aucun fichier ou répertoire de ce type.
(gdb) 

----------------------
(gdb) backtrace
#0  0x161ac14 in Letext () at soinit.c:59
#1  0x17b2688 in Tcl_AppendResultVA ()
#2  0x17b2824 in Tcl_AppendResult ()
#3  0x17bfef4 in TclpOpenFileChannel ()
#4  0x179f49c in Tcl_OpenFileChannel ()
#5  0x179e088 in Tcl_OpenObjCmd ()
#6  0x1787f7c in TclExecuteByteCode ()
#7  0x176b90c in Tcl_EvalObjEx ()
#8  0x17b06b0 in TclObjInterpProc ()
#9  0x1787f7c in TclExecuteByteCode ()
#10 0x176b90c in Tcl_EvalObjEx ()
#11 0x17b06b0 in TclObjInterpProc ()
#12 0x1787f7c in TclExecuteByteCode ()
#13 0x176b90c in Tcl_EvalObjEx ()
#14 0x17b06b0 in TclObjInterpProc ()
#15 0x17a9528 in EvalObjv ()
#16 0x17a93b0 in EvalObjv ()
#17 0x17a9ce0 in Tcl_EvalEx ()
#18 0x17a9f10 in Tcl_Eval ()
#19 0x176d498 in Tcl_GlobalEval ()
#20 0x17ad80c in Tcl_PkgRequireEx ()
#21 0x17ad5f0 in Tcl_PkgRequire ()
#22 0x17ae0f4 in Tcl_PackageObjCmd ()
#23 0x1787f7c in TclExecuteByteCode ()
#24 0x176b90c in Tcl_EvalObjEx ()
#25 0x17725a0 in Tcl_IfObjCmd ()
#26 0x17a9528 in EvalObjv ()
#27 0x17a9ce0 in Tcl_EvalEx ()
#28 0x179f158 in Tcl_EvalFile ()
#29 0x17a2718 in Tcl_Main ()
#30 0x1802ea0 in main ()
#31 0x15dc3bc in Letext () at ../sysdeps/powerpc/elf/libc-start.c:106
(gdb) 

----------------
Note that the previous glibc (firt release od linuxppc-R5) give:

(gdb)  backtrace
#0  0x158e94c in strlen () at soinit.c:59
#1  0x17b25d0 in Tcl_AppendResultVA ()
#...
#30 0x1802ea0 in main ()
#31 0x15507d4 in __libc_start_main () at ../sysdeps/powerpc/elf/libc-start.c:106

########################################################################
In file tclResult.c:


void
Tcl_AppendResultVA (interp, argList)
    Tcl_Interp *interp;		/* Interpreter with which to associate the
				 * return value. */
    va_list argList;		/* Variable argument list. */
{
    Interp *iPtr = (Interp *) interp;
    va_list tmpArgList;
    char *string;
    int newSpace;

    /*
     * If the string result is empty, move the object result to the
     * string result, then reset the object result.
     */

    if (*(iPtr->result) == 0) {
	Tcl_SetResult((Tcl_Interp *) iPtr,
	        TclGetString(Tcl_GetObjResult((Tcl_Interp *) iPtr)),
	        TCL_VOLATILE);
    }
    
    /*
     * Scan through all the arguments to see how much space is needed.
     */

    memcpy ((VOID *) &tmpArgList, (VOID *) &argList, sizeof (tmpArgList));
    newSpace = 0;
    while (1) {
	string = va_arg(tmpArgList, char *);
	if (string == NULL) {
	    // diam :
	    fprintf (stderr, "fprint before break\n");
	    break;
	}

        ////////////////////////////////////////////////////////////////
        // 
        // diam :  VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
        fprintf (stderr, "fprint before strlen\n");
        // diam :
        fprintf (stderr, "fprint sizeof(tmpArgList)=%d\n", 
                                        sizeof (tmpArgList));
                                        
	newSpace += strlen(string);
	
        // diam :
        fprintf (stderr, "fprint after strlenstrlen\n");
        // 
        ////////////////////////////////////////////////////////////////
        
    }

    ....

}
########################################################################

-- 
Maurice DIAMANTINI   | Ecole Nationale Superieure de Techniques Avancees
mailto:diam@ensta.fr | 32 Boulevard Victor 75739 PARIS Cedex 15 - France

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug glibc strlen() or tcl8.2
  1999-09-09 14:42 bug glibc strlen() or tcl8.2 Maurice DIAMANTINI
@ 1999-09-09 17:35 ` Franz Sirl
  1999-09-10 14:31   ` Maurice DIAMANTINI
  0 siblings, 1 reply; 4+ messages in thread
From: Franz Sirl @ 1999-09-09 17:35 UTC (permalink / raw)
  To: Maurice DIAMANTINI; +Cc: linuxppc-dev, Maurice DIAMANTINI


At 16:42 09.09.99 , Maurice DIAMANTINI wrote:

>Hello
>
>I'm unable to execute tcl8.2 on linuxppc R5. Although it compile and
>run very simply on intel box, solaris, ... but not on linuxppc
>
>
>The programm compils OK, but get a core dump at the first execution
>of a tcl command (in fact at the "make test")

[...]

>     memcpy ((VOID *) &tmpArgList, (VOID *) &argList, sizeof (tmpArgList));
      ^^^^^^^^

This is unportable in combination with va_list. Try:

       __va_copy (tmpArgList, argList);

Franz.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug glibc strlen() or tcl8.2
  1999-09-09 17:35 ` Franz Sirl
@ 1999-09-10 14:31   ` Maurice DIAMANTINI
  1999-09-10 18:19     ` Franz Sirl
  0 siblings, 1 reply; 4+ messages in thread
From: Maurice DIAMANTINI @ 1999-09-10 14:31 UTC (permalink / raw)
  To: Franz Sirl, linuxppc-dev; +Cc: Maurice DIAMANTINI


    Vous disiez:
    > 
    > >I'm unable to execute tcl8.2 on linuxppc R5. Although it compile and
    > >and run very simply on intel box, solaris, ... but not on linuxppc
    > > ...
    > >The programm compils OK, but get a core dump at the first execution
    > >of a tcl command (in fact at the "make test")
    > ...
    > >     memcpy ((VOID *) &tmpArgList, (VOID *) &argList, sizeof \
    >                                                (tmpArgList));
    >       ^^^^^^^^
    > This is unportable in combination with va_list. Try:
    >        __va_copy (tmpArgList, argList);
     
    Danke Franz,
    
    But when I modify the code (from the true tcl distrib):
    (I do'nt thes function which aren't part of the tcl distrib.
    
            // string = va_arg(tmpArgList, char *);
            string = __va_arg(tmpArgList, argList);
    
    then "make clean" then "make test" but I get:
    
    cc -c -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES  -fPIC
    -I/home/diam/local/src/tcl/unix/../generic
    -I/home/diam/local/src/tcl/unix -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1
    -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1
    -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1
    -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1
    -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_TM_GMTOFF=1
    -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1
    -DNEED_MATHERR=1 -DRETSIGTYPE=void -D__CHAR_UNSIGNED__=1
    -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1
    -DTCL_SHLIB_EXT=\".so\"
    /home/diam/local/src/tcl/unix/../generic/tclResult.c 
    /home/diam/local/src/tcl/unix/../generic/tclResult.c: \
        In function `Tcl_AppendResultVA':
    /home/diam/local/src/tcl/unix/../generic/tclResult.c:488:\
        incompatible types in assignment
    make: *** [tclResult.o] Error 1


    
    Sorry but I'm not very clever in system! I just need to be able
    to compil a standard distrib for tcl...
    Anybody there has tried to compil tcl/tk last version?
    
    (available from http://www.scriptics.com/products/tcltk/8.2.html)
    
    
    When I read this html page :
    
         Supported Platforms 
    
         Tcl/Tk 8.2 is compatible with most releases of the
         following operating systems: 
    
              Windows 95 and 98 
              Windows NT 
              Solaris and SunOS 
              Linux 
              HP-UX 
              SGI 
              IRIX 
              Digital Unix 
              AIX 
              SCO Unix 
              NetBSD, FreeBSD, BSDi 
              Most other Unix-like operating systems 
              Macintosh (68K and Power Mac) 
    
    but not linuppc :-((

-- 
Maurice DIAMANTINI   | Ecole Nationale Superieure de Techniques Avancees
mailto:diam@ensta.fr | 32 Boulevard Victor 75739 PARIS Cedex 15 - France

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug glibc strlen() or tcl8.2
  1999-09-10 14:31   ` Maurice DIAMANTINI
@ 1999-09-10 18:19     ` Franz Sirl
  0 siblings, 0 replies; 4+ messages in thread
From: Franz Sirl @ 1999-09-10 18:19 UTC (permalink / raw)
  To: Maurice DIAMANTINI; +Cc: linuxppc-dev


At 16:31 10.09.99 , Maurice DIAMANTINI wrote:

>     Vous disiez:
>     >
>     > >I'm unable to execute tcl8.2 on linuxppc R5. Although it compile and
>     > >and run very simply on intel box, solaris, ... but not on linuxppc
>     > > ...
>     > >The programm compils OK, but get a core dump at the first execution
>     > >of a tcl command (in fact at the "make test")
>     > ...
>     > >     memcpy ((VOID *) &tmpArgList, (VOID *) &argList, sizeof \
>     >                                                (tmpArgList));
>     >       ^^^^^^^^
>     > This is unportable in combination with va_list. Try:
>     >        __va_copy (tmpArgList, argList);
>
>     Danke Franz,
>
>     But when I modify the code (from the true tcl distrib):
>     (I do'nt thes function which aren't part of the tcl distrib.
>
>             // string = va_arg(tmpArgList, char *);
>             string = __va_arg(tmpArgList, argList);

??? I didn't tell you to do that. I meant: Replace the "memcpy" line in the 
source with the "__va_copy" line I sent you.

Franz.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-09-10 18:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-09 14:42 bug glibc strlen() or tcl8.2 Maurice DIAMANTINI
1999-09-09 17:35 ` Franz Sirl
1999-09-10 14:31   ` Maurice DIAMANTINI
1999-09-10 18:19     ` Franz Sirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).