Skip to content

[3.02rc regression] output/codeview: don't panic when there is not code section#221

Open
kasper93 wants to merge 1 commit intonetwide-assembler:masterfrom
kasper93:fix-cv-empty-code
Open

[3.02rc regression] output/codeview: don't panic when there is not code section#221
kasper93 wants to merge 1 commit intonetwide-assembler:masterfrom
kasper93:fix-cv-empty-code

Conversation

@kasper93
Copy link
Copy Markdown

@kasper93 kasper93 commented Mar 30, 2026

Simply skip the tables that require code section and source information.

Fixes: #216
Fixes: #178 (comment)

Simply skip the tables that require code section and source information.

Fixes: netwide-assembler#216
Fixes: netwide-assembler#178 (comment)
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
@kasper93 kasper93 force-pushed the fix-cv-empty-code branch from 79a1e21 to 9164a44 Compare March 30, 2026 17:08
@kasper93 kasper93 changed the title output/codeview: don't panic when there is not code section [3.02rc regression] output/codeview: don't panic when there is not code section Mar 30, 2026
BtbN pushed a commit to FFmpeg/FFmpeg that referenced this pull request Mar 30, 2026
The use of code section (.text) was forced by the unreleased NASM
3.02rc3 which made the issue worse, but preventing assambling anything
without code section, including when only data was present.

This works fine for the most part, but using code (.text) section with
IMAGE_COMDAT_SELECT_ANY causes issues with lib.exe after stripping such
object:
fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x2

Esentially it makes our workaround not work in all cases, and while
string could be disabled like it already is for MSVC/ICL builds, it used
to work so let's preserve that state.

This make it not compatible with NASM 3.02rc3 when CV debug info is
generated, but hopefully the upstream fix will be merged before release,
to avoid this regression:
netwide-assembler/nasm#221

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
perise pushed a commit to perise/FFmpeg that referenced this pull request Mar 31, 2026
The use of code section (.text) was forced by the unreleased NASM
3.02rc3 which made the issue worse, but preventing assambling anything
without code section, including when only data was present.

This works fine for the most part, but using code (.text) section with
IMAGE_COMDAT_SELECT_ANY causes issues with lib.exe after stripping such
object:
fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x2

Esentially it makes our workaround not work in all cases, and while
string could be disabled like it already is for MSVC/ICL builds, it used
to work so let's preserve that state.

This make it not compatible with NASM 3.02rc3 when CV debug info is
generated, but hopefully the upstream fix will be merged before release,
to avoid this regression:
netwide-assembler/nasm#221

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
richardpl pushed a commit to librempeg/librempeg that referenced this pull request Mar 31, 2026
The use of code section (.text) was forced by the unreleased NASM
3.02rc3 which made the issue worse, but preventing assambling anything
without code section, including when only data was present.

This works fine for the most part, but using code (.text) section with
IMAGE_COMDAT_SELECT_ANY causes issues with lib.exe after stripping such
object:
fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x2

Esentially it makes our workaround not work in all cases, and while
string could be disabled like it already is for MSVC/ICL builds, it used
to work so let's preserve that state.

This make it not compatible with NASM 3.02rc3 when CV debug info is
generated, but hopefully the upstream fix will be merged before release,
to avoid this regression:
netwide-assembler/nasm#221

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
@hpax
Copy link
Copy Markdown
Member

hpax commented Apr 10, 2026

Could you comment on how this would affect or interact with #183 ? I'm not a Codeview expert...

@kasper93
Copy link
Copy Markdown
Author

Me neither. I've only focused on patching the panic that we sometimes get when generating debug info. Maybe @SEt-t can comment. But I think at least this PR is a bugfix and relatively safe.

@SEt-t
Copy link
Copy Markdown
Contributor

SEt-t commented Apr 10, 2026

This PR looks good to me. It was an unhandled case and still is with my update.

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.

[CodeView] panic: empty.asm: assertion cv8_state.source_files != NULL failed at output/codeview.c:515

3 participants