CTRL-C hangs after "hush: fix segfault on syntax error"
Rabin,
With 128059b926b3 "hush: fix segfault on syntax error" applied, I find that if I press CTRL-C at the U-Boot prompt, U-Boot hangs. If I revert that commit, CTRL-C works fine (prints CTRL-C and returns to the command prompt).
I'm testing on real HW (rpi_b board), although I don't expect the exact HW matters. This issue doesn't reproduce with sandbox, since CTRL-C now seems to just execute the binary rather than being handled by U-Boot shell.
Hello,
Quoted 11 lines · Stephen Warren
Rabin,
With
128059b926b3"hush: fix segfault on syntax error" applied, I find that if I press CTRL-C at the U-Boot prompt, U-Boot hangs. If I revert that commit, CTRL-C works fine (prints CTRL-C and returns to the command prompt).I'm testing on real HW (
rpi_bboard), although I don't expect the exact HW matters. This issue doesn't reproduce with sandbox, since CTRL-C now seems to just execute the binary rather than being handled by U-Boot shell.
I can confirm this issue on Trats2. U-Boot hangs in infinite loop, but after revert this commit - it works well.
Using CTRL-C in commands works fine, it only hangs in the console.
It stays in: ./common/cli.c:206 (cli_loop())
Best regards,
Signature · 4 lines
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak at samsung.com
Hi Stephen,
Quoted 10 lines · Stephen Warren
Rabin,
With
128059b926b3"hush: fix segfault on syntax error" applied, I find that if I press CTRL-C at the U-Boot prompt, U-Boot hangs. If I revert that commit, CTRL-C works fine (prints CTRL-C and returns to the command prompt).I'm testing on real HW (
rpi_bboard), although I don't expect the exact HW matters. This issue doesn't reproduce with sandbox, since CTRL-C now seems to just execute the binary rather than being handled by U-Boot shell.
You can repeat this on sandbox:
./u-boot -t raw
Then Ctrl-C will work (i.e. hang).
This seems bad - as Przemyslaw mentions it hangs in cli_loop(). parse_stream_outer() should not return.
Regards,
Simon
PATCH 1/1 Revert "hush: fix segfault on syntax error"
In reply to Stephen Warren128059b92 ("hush: fix segfault on syntax error") attempted to fix a segfault on syntax errors, but it broke Ctrl-C handling, and the assumption that it made, that rcode could not be -1, is incorrect. Revert this change.
--- common/cli_hush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/cli_hush.c +1 -1
@@ -3217,7 +3217,7 @@ static int parse_stream_outer(struct in_str *inp, int flag) }b_free (&temp);/* loop on syntax errors, return on EOF */ - }while (rcode !=1 && !(flag &FLAG_EXIT_FROM_LOOP ) && + }while (rcode !=-1 && !(flag &FLAG_EXIT_FROM_LOOP ) && (inp->peek != static_peek ||b_peek (inp)));#ifndef __U_BOOT__return 0 ;
Signature · 1 line
2.1.1
PATCH 1/1 Revert "hush: fix segfault on syntax error"
Quoted 8 lines · Rabin Vincent
128059b92("hush: fix segfault on syntax error") attempted to fix a segfault on syntax errors, but it broke Ctrl-C handling, and the assumption that it made, that rcode could not be -1, is incorrect. Revert this change.Reported-by Stephen Warren <[email protected]>Reported-by Przemyslaw Marczak <[email protected]>Signed-off-by Rabin Vincent <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141124/585d7239/attachment.pgp>