So apparently the issue is about copying memory — the line is the same buffer that get overrides again and again, so the entries are all pointers to the same location which get change with the loop.
To solve the issue, I used:
while (try file_reader.readUntilDelimiterOrEof(buffer, '\n')) |line| {
const new_line: []u8 = try gpa.alloc(u8, line.len);
@memcpy(new_line, line);
try lines.append(new_line);
}
Which copy the line into another memory buffer.