From user-return-402-archive-asf-public=cust-asf.ponee.io@arrow.apache.org Wed Apr 29 15:50:05 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 73AE618066D for ; Wed, 29 Apr 2020 17:50:05 +0200 (CEST) Received: (qmail 17458 invoked by uid 500); 29 Apr 2020 15:50:01 -0000 Mailing-List: contact user-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@arrow.apache.org Delivered-To: mailing list user@arrow.apache.org Received: (qmail 17177 invoked by uid 99); 29 Apr 2020 15:50:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2020 15:50:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D2A1D181024 for ; Wed, 29 Apr 2020 15:50:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id QukUARZYbwUC for ; Wed, 29 Apr 2020 15:49:58 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.167.177; helo=mail-oi1-f177.google.com; envelope-from=allen.marc@gmail.com; receiver= Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 9DB8ABB802 for ; Wed, 29 Apr 2020 15:49:58 +0000 (UTC) Received: by mail-oi1-f177.google.com with SMTP id m10so2204088oie.6 for ; Wed, 29 Apr 2020 08:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=E+7ss7hSI6bM9pwAhS7ROog/21t89nWA7lCCCKvA5ao=; b=iZMMQJI35ATwUx1uFp5GBSs+ewwVRZwdxnCx2ryvf2qDixF80Va9SJKJFzQcFV+aCB JY5B1CxrpPREbH+6iIs0W+Z4yNsARk8uNdweHEBwKYb8xfgcly/qDcBA6yB2tXKiyJCG 9Rd3dWz4/sHMW0esCoqh+uxMNJQzmtMuHD/H8glyYofeKFxjDpkQkuZ3j932+8cpTqg0 6EXSbcms3SJrlAVDvh01Vnu24M+uKMoOHmcRzoydWIISuXYkN1KmNtLv6JDXN32kuNbW KI/EZ+sL56xLsSVWUyoInn9N6am811DB4RfoFt8BkVNK1Ok6ULUXTBaEbwg0JHikGP5R qk5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=E+7ss7hSI6bM9pwAhS7ROog/21t89nWA7lCCCKvA5ao=; b=dk5dFU32VsOtbP4R7QifahGiZS/GhWaOkwobwXqQ97AVEczZHKTr5Dxz1OLAJesm53 HOL0PNcIGpWyRVpV/7cdrntYFiAT3KiORrUIUL2sxaGw+7CoNXAPdQ49ytxCPnglUN21 DgECK6XMW6GP0+mDxC5rDjn0r52G0//XZJPDD/ajd/3/ZgBkNo3utICpl3hHFq/L/Sed AZoi91NxDwf4yUscDmJPlnm+6awGNZjan3mnwgMNkrkatjs85Z1K41XzicdShbG+wmKC WXwInKnUBYIhyOeZkGiy1LeJcKwhsF5H8aKcUPBszop0q2t8cEmVH6Wkhbyvn464qs2x Agmw== X-Gm-Message-State: AGi0PuYygD8KAbg0z3gGg873XZ1UojmphJps1PGfLYQq3eSP0dIM67KN 2qOmEisd9OQ1Japlf9PwCyNBnh8dLRkWtZy/P/QUzjJ8 X-Google-Smtp-Source: APiQypJpYJCs8cnsa2I4AjiyryhhHPR+W9npydJ5iO8uGw2VGUHQGHG7hyclQz0qR/dNFBTPXgfbgXpcdsEvLg4kHIc= X-Received: by 2002:aca:5716:: with SMTP id l22mr2039978oib.43.1588175391639; Wed, 29 Apr 2020 08:49:51 -0700 (PDT) MIME-Version: 1.0 From: Marc Allen Date: Wed, 29 Apr 2020 09:49:40 -0600 Message-ID: Subject: import_pyarrow() in c++ test code, segfault To: user@arrow.apache.org Content-Type: multipart/alternative; boundary="0000000000000f4d7c05a46fe68a" --0000000000000f4d7c05a46fe68a Content-Type: text/plain; charset="UTF-8" Hi all, I am debugging a segfault in c++ that populates an arrow table with the intent of returning the table back to python. This is using arrow-0.15.1. I wrote a unit test to try to isolate the issue, and I'm seeing that a segfault occurs whenever I call "arrow::py::import_pyarrow()". A short example reproduces in my environment, if I compile this and execute it from the command line: #include int main() { arrow::py::import_pyarrow(); return 0; } The backtrace looks like this: #0 0x00007ffff3fe87ff in PyList_New (size=size@entry=0) at Objects/listobject.c:179 #1 0x00007ffff40b4207 in PyImport_Import (module_name=module_name@entry=0x7ffff7f74030) at Python/import.c:1910 #2 0x00007ffff40b432c in PyImport_ImportModule (name=name@entry=0x7ffff7f73030 "datetime") at Python/import.c:1389 #3 0x00007ffff4011118 in PyCapsule_Import (name=0x7ffff6abdb60 "datetime.datetime_CAPI", no_block=0) at Objects/capsule.c:220 #4 0x00007ffff6a2f4cc in arrow::py::internal::InitDatetime() () from libarrow_python.so.15 #5 0x00007ffff6aabeaa in arrow::py::import_pyarrow() () from libarrow_python.so.15 #6 0x0000000000401f8b in main () at src/lib/data/data_main.cc:11 However, I have another similar "hello world" that works, but only if I use it from within a python context, i.e. loading and executing the function from a Python repl. This leads me to believe that perhaps it is not possible to call import_pyarrow() in a pure C++ environment that doesn't originate from Python. Is that correct? And, is there a way to check if I'm in a supported environment for using pyarrow so that I could handle this situation more gracefully in my code? -Marc --0000000000000f4d7c05a46fe68a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I am debugging a seg= fault in c++ that populates an arrow table with the intent of returning the= table back to python. This is using arrow-0.15.1. I wrote a unit test to t= ry to isolate the issue, and I'm seeing that a segfault occurs whenever= I call "arrow::py::import_pyarrow()". A short example reproduces= in my environment, if I compile this and execute it from the command line:=

#include <arrow/python/pyarrow.h>
int main() {
=C2=A0=C2=A0=C2=A0 arrow::py::import_pyarrow();=C2=A0=C2=A0=C2=A0 return 0;
}

The bac= ktrace looks like this:

#0 =C2=A00x00007ffff3fe87f= f in PyList_New (size=3Dsize@entry=3D0) at Objects/listobject.c:179
#1 = =C2=A00x00007ffff40b4207 in PyImport_Import (module_name=3Dmodule_name@entr= y=3D0x7ffff7f74030) at Python/import.c:1910
#2 =C2=A00x00007ffff40b432c = in PyImport_ImportModule (name=3Dname@entry=3D0x7ffff7f73030 "datetime= ") at Python/import.c:1389
#3 =C2=A00x00007ffff4011118 in PyCapsule= _Import (name=3D0x7ffff6abdb60 "datetime.datetime_CAPI", no_block= =3D0) at Objects/capsule.c:220
#4 =C2=A00x00007ffff6a2f4cc in arrow::py:= :internal::InitDatetime() () from libarrow_python.so.15
#5 =C2=A00x00007= ffff6aabeaa in arrow::py::import_pyarrow() () from libarrow_python.so.15#6 =C2=A00x0000000000401f8b in main () at src/lib/data/data_main.cc:11

However, I have another similar "hello world&quo= t; that works, but only if I use it from within a python context, i.e. load= ing and executing the function from a Python repl. This leads me to believe= that perhaps it is not possible to call import_pyarrow() in a pure C++ env= ironment that doesn't originate from Python. Is that correct? And, is t= here a way to check if I'm in a supported environment for using pyarrow= so that I could handle this situation more gracefully in my code?

-Marc
--0000000000000f4d7c05a46fe68a--