BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000846 [BusyBox] Other major always 04-22-06 13:18 03-01-08 01:35
Reporter John View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.1.x
Summary 0000846: msh - break/continue statement within nested loop causes hang or segfault
Description To be more exact, break/continue statement within nested loop causes hang or segfault on 2nd/3rd/i.e. >1 iteration.
Additional Information Minimal sample code that shows the bug:
n=0
while :
do
        while :
        do
                break
        done
        echo iteration
        [ $n = 1 ] && break
        n=`expr $n + 1`
done

Run in ash/bash/ksh it echoes iteration twice and exits.
Run in msh it echoes iteration once and either hangs or segfaults (I've experienced both; there seem to be some randomness involved).
Attached Files

- Relationships

- Notes
(0005544)
vda
03-01-08 00:52

forkexec temporarily sets t->words to processed/expanded list of arguments (I think), does its job, returns to execute(), and execute() restores t->words. This scheme breaks horribly with "break" - it longjmps away out of nested execute() call back to some previous execute(), which was executing "while". Leaving break's t->words clobbered! On next iteration "break" has wrong/corrupted t->words...

Fix: do not touch t->words, but separately pass wp as param list to builtins.
 
(0005554)
vda
03-01-08 01:35

Fixed in rev 21144.
 

- Issue History
Date Modified Username Field Change
04-22-06 13:18 John New Issue
04-22-06 13:18 John Status new => assigned
04-22-06 13:18 John Assigned To  => BusyBox
03-01-08 00:52 vda Note Added: 0005544
03-01-08 01:35 vda Status assigned => closed
03-01-08 01:35 vda Note Added: 0005554
03-01-08 01:35 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker