-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix for invalid elf file when converting to bin #8356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
On windows 10 xltensa-lx106-elf-objdump sporadically returns no output and results into build errors. Adding logic to retry to read segment from elf.
Would it be possible to print the exception details so this weird behavior is understood ? |
I'm not sure that would be helpful. The exception now manually raised when the output is empty. Python's So we really don't have anything to go on here. I would maybe add a note to the top saying I'd also like to get a report or two that this fixes things from someone who has been having failures before merging. My gut says there's something in these users' Windows installs that's blocking the app from running (malware scanner? antivirus? race condition w/OneDrive online? no idea) every now and then. I, too, have never had it fail in my (admittedly limited) Windows testing, nor has it crapped out ever in Windows CI. |
I was indeed thinking of a race condition without further clue but
Considering that we are dealing with executable files, I think you put your finger on it @earlephilhower . |
The process doesn't print any output to STDOUT, while debugging the issue I dumped each line inside the for-loop and noticed that when it fails there is no output. Perhaps the process writes on STDERR but returns with exit code 0 because there was no OSError exception on console. The process silently goes away sporadically without printing a single line. I will revert my local script change and put screenshot later when I will get chance. The error was pretty consistent to reproduce but it was failing randomly for one of the segment of elf.
I was running it on local isolated development environment which is excluded from OneDrive sync therefore I don't think its related to one drive/Antivirus/Malware. |
Look at the attached log lines from build output I generated this log file locally after adding print in elf2bin.py. Notice how there were 2 attempts to load .text segment at line#6 and line#7.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed raise exception level
Have you tried wait() / communicate() after Popen() call, and then read the stdout? |
The Seeing if The logs seem to show it failing after succeeding several times, so the race condition thing seems harder to believe now (unless AV/etc. is non-deterministic and only checks things after a few 10s of ms). And, still, no Windows CI failures (running on a Win2K21 Server VM I believe). |
Print STDERR and STDOUT on console when segment read fails.
I cannot reproduce it anymore . I have modified the reattempt logic and added print statement to dump STDOUT and STDERR on console may be it will help in future. |
Citrix Workspace was causing the issue. I updated Citrix and problem gone! |
On windows 10 xltensa-lx106-elf-objdump sporadically returns no output and results into build errors. Adding logic to retry to read segment from elf.
Ref: #7253