Skip to content

Conversation

Tishj
Copy link
Collaborator

@Tishj Tishj commented Sep 24, 2024

This PR fixes the issue mentioned in #195 (comment)

Fix found by Mario.

I don't think we quite understand why this caused a crash/bad access violation on Mac but Linux was unaffected.
either way this is now fixed

Some debugging:

(lldb) p scan_global_state->m_output_columns_ids.size()
(std::map<unsigned long long, unsigned long long>::size_type) 2
(lldb) p scan_global_state->m_read_columns_ids.size()
(std::map<unsigned long long, unsigned long long>::size_type) 3

I imagine this wrote to memory we do own, and is managed by duckdb, containing a pointer value that got overwritten, when it gets dereferenced it segfaults because the address is bogus
The difference in system allocators likely caused this problem to fly under the radar on Linux

@mkaruza mkaruza self-requested a review September 24, 2024 17:44
Copy link
Collaborator

@JelteF JelteF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like should be doing some valgrind testing before release. There might be more of such similiar issues.

@JelteF JelteF mentioned this pull request Sep 24, 2024
@JelteF JelteF changed the title [Dev] Allocate for enough data in the 'values' Datum array Allocate for enough data in the 'values' Datum array Sep 25, 2024
@JelteF
Copy link
Collaborator

JelteF commented Sep 25, 2024

@Tishj fyi we (JD, Joe, Boasz, Yves and me) had in person discussion about PR workflows and a bunch of other stuff, and decided we won't put tags like [Dev] or feat: in PR titles. So I removed them from yours.

@Tishj Tishj merged commit 7433c7a into main Sep 26, 2024
3 checks passed
@Tishj Tishj deleted the insert_tuple_into_chunk_fix branch September 26, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants