* Justin Pryzby <[EMAIL PROTECTED]> [2006-06-21 08:47] : > On Wed, Jun 21, 2006 at 02:25:31AM +0200, Fr??d??ric Bothamy wrote:
[...] > > pn openoffice.org2-core <n?ant> > > (aucune description n'est disponible) > > > > /usr/bin/dlocate: line 55: 26638 Done egrep "$1" > > $DPKGLIST > > 26639 Erreur de segmentation | while read stat name ver descr; do > > printf "%-2s %-${fieldw}.${fieldw}s %-${fieldw}.${fieldw}s > > %-${fieldd}.${fieldd}s\\n" "$stat" "$name" "$ver" "$descr"; > > done > > > > Program exited normally. > > (gdb) > > > > Do you have another idea? > Is egrep the one segfaulting? You can do the same as before to build > a "grep" deb with debugging symbols, then just dpkg -i > ../grep_....deb. apt-get {--re,}install grep later if you wish. > > It isn't completely clear to me how gdb would handle debugging the > grep; you might have to change the shell script to use > > 'gdb egrep "$1" $DPKGLIST' > > instead, or just dump "$1" and $DPKGLIST to a file to fiddle with it > manually. Hello Justin, Thanks for your help. I have tried to see if this was a problem with egrep and I have replaced the egrep in the dlocate script with a simple "cat $DPKGLIST". The segfault also occurs. But it does not occur if I use a "head $DPKGLIST". I have found that the problem only occurs if I send 276 lines (or more) of text to the "| while ...". If I try to execute the dlocate script with "sh -x" at the beginning of the script, I need 373 lines to get the segmentation error. If I execute the lines of the script at the command prompt, I get an error with 22504. Here is the exact command that I used: $ echo $COLUMNS 150 $ ((fieldw=(COLUMNS-24)/4)) $ ((fieldd=COLUMNS-fieldw*2-6)) $ cat dpkg-list_fr | while read stat name ver descr; do printf "%-2s %-${fieldw}.${fieldw}s %-${fieldw}.${fieldw}s %-${fieldd}.${fieldd}s\\n" "$stat" "$name" "$ver" "$descr"; done fieldw is 31, fieldd 82. dpkg-list_fr is the file generated by the dlocate cron job: $ LINES=40 COLUMNS=200 dpkg -l "*" | sed -e '1,5d' -e 's/ */ /g' >$DPKGLIST for the fr_FR.UTF-8 locale. Greetings, Fred -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]