Skip to content

Long init strings make hal crash #546

@kraemv

Description

@kraemv

Hello everyone,
HAL can not handle setting too long init strings. When setting an init string of character length 64, hal accepts the string and crashes when selecting the respective gate.

To reproduce this:
Open a netlist that contains at least one LUT6_2 element.
Get the gate with: gate = netlist.get_gate_by_id(x);
Set a long init string with: gate.set_init_data(["1000100110001001100010011000100110001001100010011000100110001001"])
This returns true, so the init string was set.
When clicking on the gate, hal crashes.
The error message is:
[21.12.2023 14:52:41] [python] [info] Python console execute: "gate.set_init_data(["1000100110001001100010011000100110001001100010011000100110001001"])". [21.12.2023 14:52:41] [python] [info] True terminate called after throwing an instance of 'std::out_of_range' what(): stoull

I guess the best fix would be to reject INIT strings that do not meet the expected length of the specified gate. Note that the above could happen when someone tries to set the INIT string in binary representation

  • OS: Ubuntu
  • Version 20.04
  • Hal version: 4.2.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions