Skip to content

build-namelist hangs (infinite loop) on #-commented line in user_nl_cam #1701

Open

Description

@jtruesdal

What happened?

A line in user_nl_cam commented with # instead of ! causes build-namelist to hang with no output when it follows a variable assignment. Found on cam6_4_203.

What are the steps to reproduce the bug?

&a x=1
#y = 'f.nc'
/

Passing this through Build::Namelist->new never returns. In _parse_next (bld/perl5lib/Build/Namelist.pm), in the varorvalue state neither the variable nor the value regex consumes the # line, and $expect is never set to error, so _parse loops on the same text indefinitely.

If the # line is instead the first line after the group name, a clean "expect a variable" error is raised, so the expected behavior is the same error in the varorvalue case. Under CIME this appears as case.build stalling at "Create namelist for component cam."

What CAM tag were you using?

my stormspeed branch based off of cam6_4_203

What machine were you running CAM on?

CISL machine (e.g. derecho)

What compiler were you using?

Intel

Path to a case directory, if applicable

No response

Will you be addressing this bug yourself?

Any CAM SE can do this

Extra info

I was running on my StormSPEED branch but haven't modified any of the perl code.

Activity

  1. added
    bugSomething isn't working correctly
    on Oct 2, 2026
  2. jimmielin commented on Oct 2, 2026

    @jimmielin
    Collaborator

    +1 Echoing that this has also happened to me. Seems like malformed user_nl files will hang preview_namelists (and thus also case.submit)

  3. aherring-ucar commented on Oct 6, 2026

    @aherring-ucar

    build-namelist also hangs indefinitely if you don't close a fincl variable properly(e.g, 'PREC vs. 'PREC'). I think it occurs for any namelist string that isn't closed with a '.

  4. added
    misc tagissue or PR candidate for upcoming misc tag
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Must have CESM3bugSomething isn't working correctlymisc tagissue or PR candidate for upcoming misc tag

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions