-
Notifications
You must be signed in to change notification settings - Fork 238
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
WSL Error: 'sh: 1: Syntax error: "(" unexpected' #1503
Comments
I think that is indeed something we should be worried about. |
I doubt it has to do with multi-threading, in particular, the errors that just say "Killed" are the same functions as in #1456, where they segfault.
The other error, on line
Do you see this appearing in any other example files? Perhaps try:
|
The cat command produces no output. I'll try rebuilding again. Should I try uninstalling csdp? |
Might be worth trying with both system csdp and csdp built by M2. Let's try to reproduce it without rebuilding first. Try:
Do you see any errors? What if you do:
|
Whoops, I just rebuilt from scratch now. Seeing the same errors. the cat command produces nothing. Running
produces no errors even on the same system that just had errors. The only concerning information is the syntax error warnings.
I'm running the full uninstall and install of packages now, but I expect that to take a bit longer. |
The same errors occurred with the full uninstall + install of the packages that did not occur when just installing NumericalImplicitization. See for instance:
|
Could you attach the log, at least after Also, could you try doing:
|
What's the best way to grab the log? (Sorry for the dumb question). Anyways, removing NumericalAlgebraicGeometry and installing SumsOfSquare and NumericalImplicitization worked with no errors. |
Not a dumb question, because I don't think there's a great way other than just copy and pasting from the terminal. I guess it would be easier to paste it as a gist: https://gist.github.com/ instead of right here.
Hmm, this is such a Heisenbug. |
BuildPackages-Output.zip |
Thanks! I'll look into this more, though I have no idea right now. |
So I tried uninstalling all packages and then running I suppose we could modify the packages in question to produce more debugging output? Is there any chance that there's some issue interacting with these third party programs simultaneously? I'm not sure how the multi-threading package installation works. How do I reduce the number of threads it uses? (Although i guess I can control resources shared to WSL2). |
Ninja has a If the issue is about the order in which the packages are installed, that would be a problem with the packages that should be fixed. If the issue has to do with multiple programs using csdp at the same time, that would be detectable by running the same example multiple times in parallel as a test. I'll try this later. |
Ok, so I have not tried the -j option yet. I will in the next day or two. By the way, why these packages appearing towards the end of the install-packages command? If this is controlled by build.ninja, at least NumericalImplicitization should be running in the middle? |
It's possible that they start in the middle, but those examples take a long time and in that time because of the parallelization other packages start and finish. |
Maybe, but running them individually doesn't take a particularly long
amount of time.
…On Fri, Sep 18, 2020, 9:27 PM Mahrud Sayrafi ***@***.***> wrote:
It's possible that they start in the middle, but those examples take a
long time and in that time because of the parallelization other packages
start and finish.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1503 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQAMMOEP4AGMHPO43V45QDSGQQLJANCNFSM4RQYDVBA>
.
|
I'm getting more and more convinced that this has to do with #1456. There's a variety of reasons that might cause a bug never to appear with autotools. Maybe because of parallelization, maybe because for some libraries CMake uses a more recent version. Unfortunately, I also have no idea where the shell unexpected syntax errors are coming from. |
Actually, I think it might have to do with Ubuntu using dash instead of bash as /usr/bin/sh, as implied here. Do you know what shell you're using? |
I'm using bash. |
Just ran a clean build (master branch), using There were no errors. |
Did you get any dash errors? (the unexpected "(" syntax errors) |
Yes, I still did (in some of the same packages). Here's the full output. |
I still can't reproduce the syntax errors. Without rebuilding, if you run -- warning: method has no documentation: Macaulay2Doc :: part(ZZ,ZZ,Number), key (part,ZZ,ZZ,Number), package Macaulay2Doc
../../../../Macaulay2/packages/VectorGraphics.m2:437:31:(2):[56]: warning: local declaration of temp shields variable with same name The first time the error occurs is between these two lines. Can you try doing this and seeing if you get the syntax error or not? In particular, can you tell me if there's a long pause before or after the error is printed? The error must be coming from some invocation of the system shell, but I can't figure out where that is happening. Do you have either mosek, sdpa, bertini, hom4ps2, or phcpack installed or on your path? I ask because my suspicion is that something is going wrong with SemidefiniteProgramming, which is only loaded by SumsOfSquares (via PackageExports) and Macaulay2Doc (because there's a link to that package), which matches where the unexpected syntax errors appear. By the way, you're running this from a normal terminal, right? (i.e., not vscode or something like that) Also, is this just on top of development, or a different branch? |
This is on the master branch. Should I be on development? I am running in a normal terminal. There is a pause of less than 5 seconds (maybe 3 seconds?) after the
I get no syntax errors on VectorGraphics. Should I switch to development? I do not believe I have |
No, I was just making sure it's recent.
But did you get the @tom111 have you ever seen such an error related to SemidefiniteProgramming? Every occurrence of it seems to be related to that package, but also it only seems to occur on the CMake build, but I'm not able to reproduce it. |
I've not seen those. But it might be that they are related to the recent changes in how external programs are called: #1447 (race conditions and such...) |
Thank you! @d-torrance do you know if all csdp examples are run in the same directory or in the temporary directory of the respective example? That might explain the "killed" errors above. Also, does |
M2/M2/Macaulay2/packages/SemidefiniteProgramming.m2 Lines 585 to 594 in 837c8c6
The M2/M2/Macaulay2/m2/programs.m2 Lines 85 to 90 in 837c8c6
No, not directly. It just uses |
@jchen419 confirmed that this still seems to happen, exactly on the packages that I suspected: [382/575] Getting package information for Macaulay2Doc
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
[404/575] Getting package information for StatePolytope
sh: 1: Syntax error: "(" unexpected
[544/575] Getting package information for SemidefiniteProgramming
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
[545/575] Getting package information for SumsOfSquares
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected Still no clue, other than this has to do with one of these packages being loaded! |
I am also getting a bunch of messages: Note that every time your program uses libc "system(...)" it is going to try to run something with sh. The "sh: 1:" makes it quite likely that is where the errors are coming from. I looked at what is going on with strace, and there are some crazy things going on during start up. For some reason it (or something it starts) even begins searching into my /mnt/c/... directories, which I do not appreciate. It also tries to execute "polymake" all over the place. These and other things I see during startup in the strace log are a bit worrying. Then M2-binary itself has full scripts littered throughout. This program is a hodge-podge of weirdness. What in the world is M2 trying to do when it starts up? |
M2 does a lot of things upon startup. You can make it do fewer by adding The program polymake is used by the package StatePolytope, and if StatePolytope is loaded, then it tries to tell whether polymake is installed on the system. |
Hmm, this would indicate that this is not necessarily related to CMake. Could you try running
You can pass |
Running with
linking /bin/sh to bash instead of dash, I still get errors
So it is trying to run polymake all over the place, and it is not properly escaping file paths. So with this in mind, we can produce a similar error on a normal Ubuntu (non WSL) system.
I don't really understand what is going on here. |
Ahhhhh!! M2 isn't escaping the paths properly! That explains why this is specific to WSL, I guess none of us had a parenthesis in PATH on mac or linux systems. @d-torrance do your functions escape paths? I'm not aware of the specifics of those packages, but I agree with you that such queries shouldn't happen automatically even when a package is loaded, let alone when |
I think this is in the code for "findProgram". It must be taking the members of the path, one at a time, and running a command to see if the program is there. Adding (single) quotation marks around the member of the path would help. |
@DanGrayson there is a separate issue though: why are any package files being read when |
Maybe add |
I'll look into this. It might be useful having a function, similar to |
Just put single quotes around the whole thing. |
But single quotes break other things -- in particular
|
Yes, keep an initial |
Environment variables also don't work with single quotes.
…On Tue, Feb 16, 2021 at 7:34 PM Daniel R. Grayson ***@***.***> wrote:
Yes, keep an initial ~ out of quotes.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1503 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYAPRW6SWMD6EZEXYQOHW3S7MMMBANCNFSM4RQYDVBA>
.
|
Not sure what you're referring to: gallium$ export foo='a b'
gallium$ printenv foo
a b |
They don't work with environment variables contained in paths:
|
There would never be a literal |
again, why are you even manually searching everything in the path |
That's a good point. Doug? ( @d-torrance ) |
Not in |
A couple reasons for the current implementation:
I'm totally open to suggestions for improvement, though! |
I'm having repeated errors when building documentation with Cmake Gninja. I don't have these issues when compiling these the classic way.
master branch, WSL2 + Ubuntu 20.04, AMD 3900x, WSL2 looks like it's using about 12 gigs of memory (out of 32).
Is something going on with the multi-threading of building documentation? Currently, the only errors I see are those at the end. I'm attaching (the not very helpful) example output errors here in a zip file.
ErrorsFromBuild.zip
Some of the example outputs simply say "Killed" at the end.
Weirdly, when I try re-running
ninja install-packages
at least the second time (and getting a different similar-looking error the first time), it completed without errors.
Finally, peridocally, in the terminal output, i also see
sh: 1: Syntax error: "(" unexpected
Is this something I should be worried about?
(they don't seem to cause the compilation to fail)
The text was updated successfully, but these errors were encountered: