FuelLabs/sway · error
non-configurable found in configurables region of the data s
Error message
non-configurable found in configurables region of the data section
What it means
This panic fires during bytecode finalization in to_bytecode while building the map of configurable names to their absolute offsets. Every entry in data_section.configurables must carry an EntryName::Configurable; if the let-else pattern fails, an entry whose name is a different variant (e.g. a blob or non-configurable datum) ended up in the configurables region, meaning the data section was constructed incorrectly upstream (entries placed in the wrong region).
Source
Thrown at sway-core/src/asm_generation/finalized_asm.rs:323
for (i, entry) in data_section.iter_all_entries().enumerate() {
let entry_offset = data_section.absolute_idx_to_offset(i);
print_entry(indentation, offset + entry_offset, &entry);
}
println!(";; --- END OF TARGET BYTECODE ---\n");
}
assert_eq!(half_word_ix * 4, offset_to_data_section_in_bytes as usize);
assert_eq!(bytecode.len(), offset_to_data_section_in_bytes as usize);
let named_data_section_entries_offsets = data_section
.configurables
.iter()
.enumerate()
.map(|(id, entry)| {
let EntryName::Configurable(name) = &entry.name else {
panic!("non-configurable found in configurables region of the data section");
};
(
name.clone(),
offset_to_data_section_in_bytes
+ data_section.data_id_to_offset(&DataId {
idx: id as u32,
region: DataSectionRegion::Configurables,
}) as u64,
)
})
.collect::<BTreeMap<String, u64>>();
let mut data_section = data_section.serialize_to_bytes();
bytecode.append(&mut data_section);
CompiledBytecode {
bytecode,
named_data_section_entries_offsets,View on GitHub (pinned to dad95cc42b)
Solutions
- Fix data section construction so only entries named EntryName::Configurable are pushed into the configurables region
- Audit the code paths that build DataSection.configurables (e.g. configurables collection during codegen) and ensure region assignment matches the entry name variant
- Add a debug assertion or validation when entries are inserted into the configurables region so the mismatch is caught earlier with a better diagnostic
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at sway-core/src/asm_generation/finalized_asm.rs:323 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of FuelLabs/sway@dad95cc42b (2026-09-04).
Data as JSON: /api/errors/3a0e01d7e82c56c1.
Report an issue: GitHub.