Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to reinitailze null array causes core dump #256

Open
rbiro opened this issue Jun 10, 2020 · 0 comments
Open

Failure to reinitailze null array causes core dump #256

rbiro opened this issue Jun 10, 2020 · 0 comments

Comments

@rbiro
Copy link

rbiro commented Jun 10, 2020

Under some rare circumstances, it appears postgres will modify the contents of the nulls array. Multicorn assumes that's not the case and will dump core. The patch below fixes the problem.

I was not able to find where postgres was modifying the array. But I had crashes that went away with this change, came back when I removed it, and went away again when I put it back. Not 100% conclusive given the nature of the crash. But pretty close.

diff --git a/src/python.c b/src/python.c
index 394236f..f63445b 100644
--- a/src/python.c
+++ b/src/python.c
@@ -1210,6 +1210,8 @@ pythonDictToTuple(PyObject *p_value,

	if (cinfos[cinfo_idx] == NULL)
	{
  •   	values[i] = (Datum) NULL;
    
  •   	nulls[i] = true; 
      	continue;
      }
      key = cinfos[cinfo_idx]->attrname;
    
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

No branches or pull requests

1 participant