Bug 14441 - syntax error: unexpected end of file (expecting "fi")
Summary: syntax error: unexpected end of file (expecting "fi")
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.33.x
Hardware: All Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
: 14436 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-12-09 19:30 UTC by Mihaela Gentner
Modified: 2021-12-13 18:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
The script where the exception is triggered. (10.32 KB, text/x-sh)
2021-12-09 19:30 UTC, Mihaela Gentner
Details
The .config file (29.02 KB, text/rtf)
2021-12-13 18:13 UTC, Mihaela Gentner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihaela Gentner 2021-12-09 19:30:13 UTC
Created attachment 9186 [details]
The script where the exception is triggered.

The following exception is raised sporadically while executing one of the shell scripts with busybox 1.34 version :

/sbin/lan.sh: line 5: syntax error: unexpected end of file (expecting "fi")

The occurrence of the issue is rare, normally the script lan.sh executes without problems. When the exception is triggered, there is no special branch executing on the script.

Code snippet from lan.sh attached.
Comment 1 Denys Vlasenko 2021-12-12 21:19:28 UTC
The script contains nothing but comments in the first 6 lines:

#!/bin/sh
#
# $Id: //WIFI_SOC/MP/SDK_4_2_0_0/RT288x_SDK/source/user/rt2880_app/scripts/lan.sh#1 $
#
# usage: wan.sh
#

so it's very unusual.

Do you have a semi-reliable way to trigger this? E.g. running it in a loop until it happens?

What machine/architecture does this happen on? Is it reproducible on a x86 machine?

Is it reproducible with busybox binary which you yourself compiled (and therefore can recompile, to add debugging and such)? What is the .config?
Comment 2 Denys Vlasenko 2021-12-12 21:19:45 UTC
*** Bug 14436 has been marked as a duplicate of this bug. ***
Comment 3 Mihaela Gentner 2021-12-13 18:13:17 UTC
Created attachment 9191 [details]
The .config file
Comment 4 Mihaela Gentner 2021-12-13 18:22:28 UTC
(In reply to Denys Vlasenko from comment #1)

Running the script in a loop in order to reproduce the issue faster is an idea worth trying. 

The architecture of the system is MIPS 32Bit LE. I don't know if the issue is reproducible on a x86 machine.

Yes, the issue reproduces with a busybox binary which is compiled by me. Currently waiting for the issue to reproduce on an image with increased debugging verbosity. 

Attached the .config file in the previous comment. 

I have to mention that in this project there are a lot of scripts which are large in size (up to 32K), and a lot of include of scripts inside them. Could that be an issue? Is there a specific configuration value that should be turned on, in order to support big files?