Skip to content
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

Backports for 1.12.0-alpha1 #57258

Open
wants to merge 9 commits into
base: release-1.12
Choose a base branch
from
Open

Conversation

I couldn't find `time_ns` when I was looking for it, nice to make clear
the "monotonic" clock is also available in Base.

(cherry picked from commit a52de83)
@KristofferC KristofferC added the release Release management and versioning. label Feb 4, 2025
@KristofferC
Copy link
Member Author

@nanosoldier runtests(vs=":release-1.11")

@DilumAluthge
Copy link
Member

@KristofferC Should this PR target release-1.12 (instead of master)?

@KristofferC KristofferC changed the base branch from master to release-1.12 February 4, 2025 17:21
@KristofferC
Copy link
Member Author

Oops, yes, thanks!

@DilumAluthge
Copy link
Member

I think I'll have to make a commit to this branch just for the sake of kicking off 1.12 Buildkite for the first time - I'll immediately revert the commit, and from then on CI should work correctly.

@DilumAluthge
Copy link
Member

The next time you force-push to this branch, you can drop both f15d417 and 8bb55bd.

@DilumAluthge
Copy link
Member

Looks like the 1.12 Buildkite CI has now been triggered correctly on this PR.

@DilumAluthge
Copy link
Member

Alright, looks like the 1.12 Buildkite pipeline is working.

topolarity and others added 6 commits February 6, 2025 12:59
…57241)

The `fork()` we do here relies on `SIGCHLD` to make sure that we don't
race against the child.

This is easy to see in an embedding application that dynamically links
`libjulia`:
```c
int main(int argc, char *argv[])
{
    signal(SIGCHLD, SIG_IGN);
    void *handle = dlopen("path/to/libjulia.so", RTLD_LAZY);
    return 0;
}
```

Without this change, this fails with an error message:
```
Error during libstdcxxprobe in parent process:
waitpid: No child processes
```

Resolves #57240

(cherry picked from commit daf865e)
Restores #57035, undo #57089 for non-FreeBSD. While I suggested doing
this change for all platforms, I forgot that means non-FreeBSD platforms
become vulnerable again to the very deadlock problems that #57035 was
required to prevent. That fix seems to not be viable on FreeBSD due to
known libc implementation problems on that platform. However, upon
closer inspection of the questionable design implementation decisions
they seem to have made here, the platform is likely not currently
vulnerable to this libunwind bug in the first place:
https://github.com/lattera/freebsd/blob/master/libexec/rtld-elf/rtld_lock.c#L120

(cherry picked from commit 2f0a523)
It looks like these methods were just missed while overloading for
BufferStream.

There's also `readbytes!` where the current implementation will fallback
to the `LibuvStream` implementation that is currently not threadsafe.
What's the best approach there since the implementation is quite a bit
more involved? Just duplicate the code but for BufferStream? Should we
take the BufferStream lock and invoke the LibuvStream method? Open to
ideas there.

Also open to suggestions for having tests here? Not easy to simulate the
data race of writing and calling readavailable.

The fix here will unblock JuliaWeb/HTTP.jl#1213
(I'll probably do some compat shim there until this is fully released).

Thanks to @oscardssmith for rubber ducking this issue with me.

Probably most helpfully reviewed by @vtjnash.

---------

Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit ffc96bc)
(cherry picked from commit 99fd5d9)
This is the final PR in the binding partitions series (modulo bugs and
tweaks), i.e. it closes #54654 and thus closes #40399, which was the
original design sketch.

This thus activates the full designed semantics for binding partitions,
in particular allowing safe replacement of const bindings. It in
particular allows struct redefinitions. This thus closes
timholy/Revise.jl#18 and also closes #38584.

The biggest semantic change here is probably that this gets rid of the
notion of "resolvedness" of a binding. Previously, a lot of the behavior
of our implementation depended on when bindings were "resolved", which
could happen at basically an arbitrary point (in the compiler, in REPL
completion, in a different thread), making a lot of the semantics around
bindings ill- or at least implementation-defined. There are several
related issues in the bugtracker, so this closes #14055 closes #44604
closes #46354 closes #30277

It is also the last step to close #24569.
It also supports bindings for undef->defined transitions and thus closes
#53958 closes #54733 - however, this is not activated yet for
performance reasons and may need some further optimization.

Since resolvedness no longer exists, we need to replace it with some
hopefully more well-defined semantics. I will describe the semantics
below, but before I do I will make two notes:

1. There are a number of cases where these semantics will behave
slightly differently than the old semantics absent some other task going
around resolving random bindings.
2. The new behavior (except for the replacement stuff) was generally
permissible under the old semantics if the bindings happened to be
resolved at the right time.

With all that said, there are essentially three "strengths" of bindings:

1. Implicit Bindings: Anything implicitly obtained from `using Mod`, "no
binding", plus slightly more exotic corner cases around conflicts

2. Weakly declared bindings: Declared using `global sym` and nothing
else

3. Strongly declared bindings: Declared using `global sym::T`, `const
sym=val`, `import Mod: sym`, `using Mod: sym` or as an implicit strong
global declaration in `sym=val`, where `sym` is known to be global
(either by being at toplevle or as `global sym=val` inside a function).

In general, you always allowed to syntactically replace a weaker binding
by a stronger one (although the runtime permits arbitrary binding
deletion now, this is just a syntactic constraint to catch errors).
Second, any implicit binding can be replaced by other implicit bindings
as the result of changing the `using`'ed module. And lastly, any
constants may be replaced by any other constants (irrespective of type).

We do not currently allow replacing globals, but may consider changing
that in 1.13.

This is mostly how things used to work, as well in the absence of any
stray external binding resolutions. The most prominent difference is
probably this one:

```
set_foo!() = global foo = 1
```

In the above terminology, this now always declares a "strongly declared
binding", whereas before it declared a "weakly declared binding" that
would become strongly declared on first write to the global (unless of
course somebody had created a different strongly declared global in the
meantime). To see the difference, this is now disallowed:

```
julia> set_foo!() = global foo = 1
set_foo! (generic function with 1 method)

julia> const foo = 1
ERROR: cannot declare Main.foo constant; it was already declared global
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1
```

Before it would depend on the order of binding resolution (although it
just crashes on current master for some reason - whoops, probably my
fault).

Another major change is the ambiguousness of imports. In:
```
module M1; export x; x=1; end
module M2; export x; x=2; end
using .M1, .M2
```
the binding `Main.x` is now always ambiguous and will throw on access.
Before which binding you get, would depend on resolution order. To
choose one, use an explicit import (which was the behavior you would
previously get if neither binding was resolved before both imports).

(cherry picked from commit 888cf03)
@KristofferC KristofferC force-pushed the backports-release-1.12 branch from 4bb5cb3 to ae78058 Compare February 6, 2025 11:59
@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Report summary

❗ Packages that crashed

168 packages crashed only on the current version.

  • The process was aborted: 22 packages
  • Invalid LLVM IR was generated: 1 packages
  • An internal error was encountered: 129 packages
  • An unreachable instruction was executed: 2 packages
  • GC corruption was detected: 1 packages
  • A segmentation fault happened: 13 packages

4 packages crashed on the previous version too.

✖ Packages that failed

1421 packages failed only on the current version.

  • Package has syntax issues: 439 packages
  • Package fails to precompile: 460 packages
  • Illegal method overwrites during precompilation: 18 packages
  • Package has test failures: 76 packages
  • Package tests unexpectedly errored: 198 packages
  • Networking-related issues were detected: 2 packages
  • There were unidentified errors: 6 packages
  • Tests became inactive: 5 packages
  • Test duration exceeded the time limit: 212 packages
  • Test log exceeded the size limit: 5 packages

2709 packages failed on the previous version too.

✔ Packages that passed tests

36 packages passed tests only on the current version.

  • Other: 36 packages

4580 packages passed tests on the previous version too.

➖ Packages that were skipped altogether

61 packages were skipped only on the current version.

  • Package could not be installed: 61 packages

1300 packages were skipped on the previous version too.

KristofferC and others added 2 commits February 6, 2025 17:06
- Update `JuliaSyntax.jl` to v1.0.1
- Revert workaround changes, use original test case `n37134`

Fix #57223

(cherry picked from commit 97c920d)
@KristofferC

This comment was marked as outdated.

@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Report summary

❗ Packages that crashed

92 packages crashed only on the current version.

  • The process was aborted: 14 packages
  • Invalid LLVM IR was generated: 1 packages
  • An internal error was encountered: 69 packages
  • An unreachable instruction was executed: 1 packages
  • GC corruption was detected: 1 packages
  • A segmentation fault happened: 6 packages

✖ Packages that failed

1032 packages failed only on the current version.

  • Package has syntax issues: 11 packages
  • Package fails to precompile: 505 packages
  • Illegal method overwrites during precompilation: 54 packages
  • Package has test failures: 75 packages
  • Package tests unexpectedly errored: 204 packages
  • Networking-related issues were detected: 1 packages
  • There were unidentified errors: 6 packages
  • Tests became inactive: 3 packages
  • Test duration exceeded the time limit: 170 packages
  • Test log exceeded the size limit: 3 packages

81 packages failed on the previous version too.

✔ Packages that passed tests

292 packages passed tests on the previous version too.

@maleadt
Copy link
Member

maleadt commented Feb 9, 2025

CpuId-related failures (llvmcall getting interpreted) bisected and filed as #57318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Release management and versioning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.