Crash python3 running at x86_64 54/70054/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 18 May 2016 01:37:39 +0000 (10:37 +0900)
committerDonghun Kwak <dh0128.kwak@samsung.com>
Wed, 18 May 2016 01:51:23 +0000 (18:51 -0700)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] When python excute, python's library loading failed.
[Cause & Measure] At getpath.c, python lib path is hardcoding.
fixed, lib path value set from spec file's defined value.
[Checking Method] running python excute binary.

[Team] Open Source Management and Setting Part
[Developer] dh0128.kwak
[Solution company] Samsung
[Change Type] N/A

Change-Id: Ic23ee87c8b352a013f8736a5b9491ab0deac818a
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Makefile.pre.in
Modules/getpath.c
packaging/python3-base.spec
packaging/python3.spec

index 809e1c779d9d305e537666dc1b8965873355d11e..f81c261f51ad1cd5712ee30f8bf3294cbcfb8e58 100644 (file)
@@ -128,6 +128,7 @@ BINLIBDEST= $(LIBDIR)/python$(VERSION)
 LIBDEST=       $(SCRIPTDIR)/python$(VERSION)
 INCLUDEPY=     $(INCLUDEDIR)/python$(LDVERSION)
 CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
+BASE_LIB= lib
 
 # Symbols used for using shared libraries
 SHLIB_SUFFIX=  @SHLIB_SUFFIX@
@@ -711,6 +712,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
                -DEXEC_PREFIX='"$(exec_prefix)"' \
                -DVERSION='"$(VERSION)"' \
                -DVPATH='"$(VPATH)"' \
+               -DBASE_LIB='"$(BASE_LIB)"' \
                -o $@ $(srcdir)/Modules/getpath.c
 
 Modules/python.o: $(srcdir)/Modules/python.c
index 13e3817260732d5c7b5adeec4f5bf5cfe1b8b624..3d196fc416a75af50effa2532e00adf2f0640487 100644 (file)
 #define LANDMARK L"os.py"
 #endif
 
+#ifndef BASE_LIB
+#define BASE_LIB "lib"
+#endif
+
 static wchar_t prefix[MAXPATHLEN+1];
 static wchar_t exec_prefix[MAXPATHLEN+1];
 static wchar_t progpath[MAXPATHLEN+1];
@@ -494,7 +498,7 @@ calculate_path(void)
     _pythonpath = _Py_char2wchar(PYTHONPATH, NULL);
     _prefix = _Py_char2wchar(PREFIX, NULL);
     _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL);
-    lib_python = _Py_char2wchar("lib/python" VERSION, NULL);
+    lib_python = _Py_char2wchar(BASE_LIB "/python" VERSION, NULL);
 
     if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
         Py_FatalError(
index ed92ada7ce797030729d1e98efbc9b6ba6bc4a71..b26c758e898656b43000434ba7df6f6c59f3c601 100644 (file)
@@ -258,7 +258,7 @@ target=profile-opt
 target=all
 %endif
 LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH \
-    make %{?_smp_mflags} $target
+    make %{?_smp_mflags} BASE_LIB=%{_lib} $target
 
 %check
 # SUSE's gdb breaks test_gdb by producing spurious output (zypper suggestions)
index 74c10b64ad1d710f57217bfbdd42dff1dadeb928..a082080f7aa35a1209fd8706998042cc28bb06ea 100644 (file)
@@ -177,7 +177,7 @@ touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h Objects/typeslots.in
     --with-ensurepip=no \
     --enable-loadable-sqlite-extensions
 
-make %{?_smp_mflags} # DESTDIR=$RPM_BUILD_ROOT
+make %{?_smp_mflags} BASE_LIB=%{_lib}
 
 %check
 # Limit virtual memory to avoid spurious failures