Skip to content

don't depwarn while holding the typeinf lock#830

Closed
simeonschaub wants to merge 1 commit into
mainfrom
sds/depwarn
Closed

don't depwarn while holding the typeinf lock#830
simeonschaub wants to merge 1 commit into
mainfrom
sds/depwarn

Conversation

@simeonschaub
Copy link
Copy Markdown
Member

This causes a context switch, which I believe is illegal while holding the typeinf lock. This caused hangs in the CoolPDLP.jl test suite on Julia 1.10

This causes a context switch, which I believe is illegal while holding the typeinf lock. This caused hangs in the CoolPDLP.jl test suite on Julia 1.10
Copy link
Copy Markdown
Member

@maleadt maleadt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try #831 instead.

maleadt added a commit that referenced this pull request Jun 5, 2026
`Base.depwarn` logs through the active logger, and the I/O involved can
switch tasks. That is illegal while holding the typeinf lock, which our
`@locked` compilation entry points do on Julia 1.10/1.11, and caused
hangs (#830).

Replace it with `safe_depwarn`, which writes the warning synchronously
to `Core.stderr` like `@safe_warn` does. Caller attribution, warning
once per call site, and throwing under `--depwarn=error` still behave
like `Base.depwarn`; on 1.12+, where compilation doesn't hold the
typeinf lock, it just forwards there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maleadt maleadt closed this Jun 5, 2026
maleadt added a commit that referenced this pull request Jun 5, 2026
`Base.depwarn` logs through the active logger, and the I/O involved can
switch tasks. That is illegal while holding the typeinf lock, which our
`@locked` compilation entry points do on Julia 1.10/1.11, and caused
hangs (#830).

Replace it with `safe_depwarn`, which writes the warning synchronously
to `Core.stderr` like `@safe_warn` does. Caller attribution, warning
once per call site, and throwing under `--depwarn=error` still behave
like `Base.depwarn`; on 1.12+, where compilation doesn't hold the
typeinf lock, it just forwards there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maleadt added a commit that referenced this pull request Jun 6, 2026
`Base.depwarn` logs through the active logger, and the I/O involved can
switch tasks. That is illegal while holding the typeinf lock, which our
`@locked` compilation entry points do on Julia 1.10/1.11, and caused
hangs (#830).

Replace it with `safe_depwarn`, which writes the warning synchronously
to `Core.stderr` like `@safe_warn` does. Caller attribution, warning
once per call site, and throwing under `--depwarn=error` still behave
like `Base.depwarn`; on 1.12+, where compilation doesn't hold the
typeinf lock, it just forwards there.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants