Skip to content

Assigned interior causes a bad allocation error  #465

@CousinRicky

Description

@CousinRicky

Summary

Declaring an interior, and then assigning it to another variable causes POV-Ray to halt with a bad allocation error.

POV-Ray Version

  • Incarnation: POV-Ray for Unix
  • Affected build version: 3.8.0-beta.2.unofficial (self-compiled)
  • Known working build version: 3.7.0.10

Runtime Environment

  • Operating system: openSUSE 15.3 GNU/Linux
  • Hardware: Lenovo Ideapad Slim 7
  • Hardware architecture: x86-64
  • CPU model: Intel Core i7

Scene

#version max (3.5, min (3.8, version));
global_settings { assumed_gamma 1 }
#declare Int = interior { ior 1.5 }
#declare myInt = Int

Expected Behavior

Scene renders to completion. (This minimal scene has no objects.)

Actual Behavior

The render halts during the parsing phase.

Output

==== [Parsing...] ==========================================================
File 'tmp.pov' line 4: Parse Error: std::bad_alloc
Fatal error in parser: Cannot parse input.
Render failed

Additional context

This bug was first reported in povray.beta-test: Assigning an interior crashes 3.8 beta 2.

Workaround

Wrapping the right-hand identifier with an interior block avoids the crash. In the example, replace line 4 with #declare myInt = interior { Int }

Suggested Solution

See wfpokorny’s analysis in the p.beta-test thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug?reported as bug; triage pending

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions