Re: FreeBSD core dumps when wrapping big files!

Joey Mukherjee <[email protected]>
Newsgroups gmane.comp.lang.tcl.starkit
Message-ID <[email protected]>
On Dec 15, 2006, at 4:40 AM, Jean-Claude Wippler wrote:

> Joey Mukherjee wrote:
>> I have a file which is roughly 80mb that I include in the  
>> starkit.  With this file, I can never get the final "sdx.kit wrap"  
>> to work - it will just dump core.  This 80mb file is actually a  
>> zip file that if I unzip it, it works fine so its not the size of  
>> the kit I am creating, just the size of the individual file.
>
> This is very strange, the 80 Mb should not matter.  All I can think  
> of is a missing "fconfigure -translation binary" somewhere, i.e.  
> that there is a data contents sensitivity somewhere (or perhaps a  
> null-byte or some other encoding quirk).
>
> You may have to binary-search-split the problematic file to  
> determine exactly when it fails and when it still works.  Again, I  
> can't think of a reason why *size* in itself would be a problem.

I have tried taking random files out and really the only difference  
seems to be size.  I have narrowed down to a magic number, though.   
When the file in my starpack to be wrapped is greater than 67107626,  
but smaller than 67117434, it will core regardless of the files  
inside.  I have tried with several different files removed and added  
to get to this range.  Its harder than it looks to narrow this down!   
(As an aside: Does anyone know of an easy way to create a file of an  
exact size?)

Anyway, here's an example log:

 > Tcl/tclkit-freebsd6-x86 sdx.kit wrap setup -runtime ./tclkit
131 updates applied
 > ls -l setup.vfs/
total 85728
-rw-r--r--  1 joey  joey  17806074 Dec 14 22:03 bin.zip
-rw-r--r--  1 joey  joey  67107626 Dec 14 22:22 bin2.zip
-rw-r--r--  1 joey  joey      3317 Mar 22  2006 boot.tcl
-rw-r--r--  1 joey  joey        37 Apr 19  2006 config.tcl
-rw-r--r--  1 joey  joey    818855 Nov 27 16:18 config.zip
-rw-r--r--  1 joey  joey      4628 Dec  1 21:53 eula.txt
-rw-r--r--  1 joey  joey     84312 Nov 27 16:18 graphics.zip
-rw-r--r--  1 joey  joey   1517155 Nov 27 16:18 html.zip
-rw-r--r--  1 joey  joey    222437 Nov 27 16:18 layouts.zip
drwxr-xr-x  7 joey  joey       512 Dec 14 05:31 lib
-rw-r--r--  1 joey  joey     32370 Dec  1 21:53 main.tcl
-rw-r--r--  1 joey  joey     18976 Dec  1 21:53 sddas1.gif
-rw-r--r--  1 joey  joey     14575 Nov 27 16:18 svrcmds.zip
-rw-r--r--  1 joey  joey     10134 Aug 19  2003 tclkit.ico
 > cd setup.vfs/
 > zip -9 bin2.zip ../bin/db_merge
   adding: ../bin/db_merge (deflated 63%)
 > cd ..
 > Tcl/tclkit-freebsd6-x86 sdx.kit wrap setup -runtime ./tclkit
Segmentation fault (core dumped)
 > ls -l setup.vfs/
total 85744
-rw-r--r--  1 joey  joey  17806074 Dec 14 22:03 bin.zip
-rw-r--r--  1 joey  joey  67119608 Dec 14 22:26 bin2.zip
-rw-r--r--  1 joey  joey      3317 Mar 22  2006 boot.tcl
-rw-r--r--  1 joey  joey        37 Apr 19  2006 config.tcl
-rw-r--r--  1 joey  joey    818855 Nov 27 16:18 config.zip
-rw-r--r--  1 joey  joey      4628 Dec  1 21:53 eula.txt
-rw-r--r--  1 joey  joey     84312 Nov 27 16:18 graphics.zip
-rw-r--r--  1 joey  joey   1517155 Nov 27 16:18 html.zip
-rw-r--r--  1 joey  joey    222437 Nov 27 16:18 layouts.zip
drwxr-xr-x  7 joey  joey       512 Dec 14 05:31 lib
-rw-r--r--  1 joey  joey     32370 Dec  1 21:53 main.tcl
-rw-r--r--  1 joey  joey     18976 Dec  1 21:53 sddas1.gif
-rw-r--r--  1 joey  joey     14575 Nov 27 16:18 svrcmds.zip
-


> I've just checked in some changes to kitgen to better support *BSD  
> OS'es.  One crucial bit of info is that you have to use GNU make,  
> i.e. "gmake", not "make".  A quick test on a FreeBSD machine on the  
> SourceForge compile farm appears to work.

Hmm, I wonder how they are doing it.  I still have problems, and I  
don't think I have much more than a vanilla 6.1 install.  Anyway,  
here's end of the log after doing a "gmake small":

Creating package index /usr/home/joey/kitgen/8.4/kit-small/build/lib/ 
tk8.4/pkgIndex.tcl
Installing libtk8.4.so to /usr/home/joey/kitgen/8.4/kit-small/build/lib/
Installing wish as /usr/home/joey/kitgen/8.4/kit-small/build/bin/wish8.4
Installing tkConfig.sh to /usr/home/joey/kitgen/8.4/kit-small/build/lib/
Installing libtkstub8.4.a to /usr/home/joey/kitgen/8.4/kit-small/ 
build/lib/
Making directory /usr/home/joey/kitgen/8.4/kit-small/build/lib/tk8.4/ 
images
Making directory /usr/home/joey/kitgen/8.4/kit-small/build/lib/tk8.4/ 
msgs
Installing header files
Installing library files to /usr/home/joey/kitgen/8.4/kit-small/build/ 
lib/tk8.4
Installing library images directory
Installing translation directory
gmake[2]: Leaving directory `/usr/home/joey/kitgen/8.4/kit-small/ 
build/tkdyn'
cp kit-cli tclkit-dyn && strip tclkit-dyn
./kit-cli -init- ../../setupvfs.tcl  tclkit-dyn dyn
application-specific initialization failed: error copying "build/lib/ 
libtk8.4.so]": no such file or directory
%

It says it can not find libtk8.4.so, but it is in the directory as  
listed above (/usr/home/joey/kitgen/8.4/kit-small/build/lib/).  It  
also leaves me in the Tcl prompt.

A "gmake large" fails as well, but I'd swear it gets further:

-lX11 -lXss -lXext -L/usr/X11R6/lib -lXft -lX11 -L/usr/local/lib - 
Wl,--rpath -Wl,/usr/local/lib -lfreetype -lz -L/usr/X11R6/lib - 
lfontconfig -L/usr/X11R6/lib -lXrender -lX11 -lXext  -lpthread -lm -L/ 
usr/home/joey/kitgen/8.5/kit-large/build/lib -ltclstub8.5   -rpath / 
usr/home/joey/kitgen/8.5/kit-large/build/lib:/usr/X11R6/lib
ld: unrecognized option '-Wl,--rpath'
ld: use the --help option for usage information
gmake[2]: *** [libtk8.5.so] Error 1
gmake[2]: Leaving directory `/usr/home/joey/kitgen/8.5/kit-large/ 
build/tkdyn'
gmake[1]: *** [build/tkdyn] Error 2
gmake[1]: Leaving directory `/usr/home/joey/kitgen/8.5/kit-large'
gmake: *** [large] Error 2

If I keep rerun "gmake large":

 > gmake large
sh config.sh 8.5/kit-large aqua univ thread allenc allmsgs tzdata
Configuring 8.5/kit-large/Makefile for FreeBSD.
cd 8.5/kit-large && gmake && gmake clean
gmake[1]: Entering directory `/usr/home/joey/kitgen/8.5/kit-large'
cp kit-cli tclkit-dyn && strip tclkit-dyn
./kit-cli -init- ../../setupvfs.tcl -t -e -m -z tclkit-dyn dyn
application-specific initialization failed: error copying "build/lib/ 
tk8.5/bgerror.tcl": no such file or directory
%

I feel like it is very close...

The only thing I changed was makefile.include:

cvs server: Diffing .
Index: makefile.include
===================================================================
RCS file: /home/cvs/tclkit/kitgen/makefile.include,v
retrieving revision 1.12
diff -r1.12 makefile.include
5c5
< #LDFLAGS = -L/usr/X11R6/lib -lX11 -ldl -lm # -lpthread
---
 > LDFLAGS = -L/usr/X11R6/lib -lXft -lX11 -lm -lpthread

Thanks again!

Joey
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.