-
Notifications
You must be signed in to change notification settings - Fork 451
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
xcodebuild has a segmentation fault #488
Comments
@bugaevc very nice, gets us past there. Now it needs:
|
We get this now. I think the no version.plist is caused by something on our end because I installed Xcode.app and the command line tools to a fresh prefix and it still happened. |
|
This is happening to me using the latest XCode 11.4 and commit 14efc18 from 2020-04-06. My host is Ubuntu 18.04 with kernel 5.3.0-45-generic:
I've attempted to collect the core dump as per https://developer.apple.com/library/archive/technotes/tn2124/_index.html#//apple_ref/doc/uid/DTS10003391-CH1-SECCOREDUMPS, but I have not been able to successfully do it. Please let me know how to gather any further information to help figuring out this issue. |
Depending on your distro — and I'm not sure how Ubuntu sets it up — core dumps may end up in a different place than the current directory. I know they do just work as they used to on Debian, so you go
or, if your distro sets It might be easier to just run the thing in LLDB and inspect the crash there, without a core file. |
Fwiw, coredumps on ubuntu are not collected by systemd, but by whoopsie - https://packages.ubuntu.com/source/bionic-updates/whoopsie - you need to shut it down to get core dumps. |
Yeah, but I can't run anything that depends on
I can get crashes of apps running on my host, but I can't see dumps from darling |
Can't you run LLDB directly? E.g.
|
That works! I might be doing something wrong since I'm used to gcc, but I can't get the core dump or any other sort of useful information running lldb:
Since you pointed out that
|
Yes
No idea what's going on there, but you should try debugging |
Ok, I took a look at https://docs.darlinghq.org/contributing/debugging.html, I downloaded https://osdn.net/projects/darling/storage/apps/lldb.tar.bz2 and that seems to work most of the time. Some times it does not, but retrying works. Please notice that the link provided in the wiki is wrongly pointing to Anyway, here's the output using the custom lldb for darling:
And the same for $(xcode-select -p)/xcodebuild
|
One point dyld reaches before crashing: calling
|
That flag means: #define DTF_HIDEW 0x0001 /* hide whiteout entries /
https://github.com/darlinghq/darling/blob/master/src/libc/gen/FreeBSD/opendir.c#L169 but it sometimes crashes earlier in opendir here:
Debugging this is difficult because there aren't debug symbols for dyld File descriptor #3 was |
It crashes calling Some how the memory allocator has gotten messed up previously in the execution is my guess. That's supposed to be identical to Note, this is statically linked |
It crashes because dyld's realloc doesn't check the source pointer for nullity and tries to memcpy the contents. I guess XNU maps "page zero" also into processes we don't map it into, but the workaround is simple. |
Current state:
which happens because current XCode requires |
|
Building may be easy, but Linux distributions don't commonly provide packages of the Swift compiler. I'm looking into our options (e.g. building |
Those are for non-Darwin platforms. On Darwin/macOS, the regular Foundation and libdispatch, which we already have, are used. |
Instead of building the swift standard library dylibs from source, we could download them upon prefix creation, much like how Wine installs Mono. They are available here: https://swift.org/download/#releases We can download and install the toolchain PKG. The libs are in |
xcodebuild have same error. I need use xcresulttool but get this error.
|
|
if we can get this working that will be wild |
...and now it wants
|
Well,
|
So
But
Unfortunately, it doesn't succeed, because it returns an exit code of 69 and asks again next time. |
New output: xcodebuild output
Oh and the license agreement only fails because it tries to write to a file in |
Awesome!! Getting there 🎉 |
Hi, everyone! I made the STUB for all the missing libraries, constants and functions to run xcodbuild 12.4, but i ran into problem - i got message that i could not accept the license, i tried to call the acceptance of the agreement: |
@pperehozhih I believe it's an issue of Note that my testing until now has been with Xcode 11, not 12. |
By the way, quick update on the current progress: with Xcode 11 and the latest commit on master, |
Using the command line tools included with Xcode should work now. Doing Note that |
any progress on this ? :) |
It actually runs stuff! (doesn't successfully build yet, of course 😄) This is the result of running Build output
|
With the latest code on However, builds still fail because Build output
|
Something to that effect has been added in darlinghq/darling-corefoundation#6? |
I'll test with that and see, but I think that still gets its info from the UTI database, which we're not currently creating because we don't have a working |
I have an impression it has worked at least somewhat for @CKegel? You need to load the launchd plist which we don't install. |
Just tried it and unfortunately I get the same thing. However, I did load up the database with |
Looks like I might have to debug and fix LLDB so I can debug this, since it currently loses connection with the process after the first breakpoint. |
As it turned out, the problem was that our implementation of With that out of the way, |
With the latest commit (fe0da14), my Hello World app compiles and runs successfully under both Darling and macOS! Build output
HelloWorld app built with `xcodebuild` running under Darling HelloWorld app built with `xcodebuild` running under macOS There are of course some things still missing/unimplemented. Most notably, all the menu items are broken: under macOS, they're completely missing; under Darling, they all have empty names and no children. This is likely because the current implementation of |
I'd be happy to correct this issue if you'd like. |
That'd be great, thanks! |
Any chance to build something for iOS? |
The text was updated successfully, but these errors were encountered: