Issue262

Title swapFiber segmentation fault in 0.5.16
Priority bug Status done-cbb
Superseder Nosy List hamilyon, kayhayen
Assigned To kayhayen Keywords standalone

Created on 2015-11-11.11:43:46 by hamilyon, last changed by marc.jofre.

Messages
msg1781 (view) Author: marc.jofre Date: 2016-01-16.17:47:31
Both issues are solved.

Nuitka module.Cython.Compiler.ExprNodes.cpp issue solved.

Pytable issue solved by updating the pytables module.
msg1753 (view) Author: marc.jofre Date: 2016-01-03.11:45:57
Hi Kay,

With the latest update the issue module.Cython.Compiler.ExprNodes.cpp is solved:

I got a compilation error scons: *** [module.wx._core.obj] Error -1073741819 using 
the --debug tool.

Aside, I already opened an issue about Nuitka:WARNING:Too large constant (<type 
'dict'> 390) encountered at D:\WinPytho
n-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\tables\_past.py:63.
msg1752 (view) Author: marc.jofre Date: 2016-01-02.09:41:55
Hi Kay,

I updated to latest nuitka 0.5.18pre2 version. The --debug standalone 
compilation fails with messages:

Nuitka:WARNING:Too large constant (<type 'dict'> 390) encountered at D:\WinPytho
n-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\tables\_past.py:63.

scons: *** [module.wx._core.obj] Error -1073741819
msg1751 (view) Author: kayhayen Date: 2016-01-01.10:19:09
Marc,

can you retry with the latest pre-release, it got a fix for the slice issue, which is not critical, only "--
debug" was finding that exception handling code was generated, although no exception can be raised. This is 
a missing optimization that was added.

Thanks,
Kay
msg1749 (view) Author: kayhayen Date: 2015-12-29.21:10:47
I have reproduced that --debug finding, and I am going to provide a hotfix for 
it soonish, as this an indication of lack of error checks, I am looking for 
other similar stuff to bundle right now, but should come soonish.

Thanks for your reporting,
Kay
msg1748 (view) Author: marc.jofre Date: 2015-12-29.18:35:10
Hi Kay,

Running with --debug, the compilation error dump is:

Nuitka:WARNING:Unresolved '__import__' call at 'D:\WinPython-64bit-2.7.6.3\pytho
n-2.7.6.amd64\Lib\site-packages\zmq\utils\jsonapi.py:25' may require use of '--r
ecurse-directory'.
cl /Fomodule.Cython.Compiler.ExprNodes.obj /c "module.Cython.Compiler.ExprNodes.
cpp" /TP /nologo /EHsc /J /Gd /W4 /wd4505 /wd4127 /wd4100 /wd4702 /wd4189 /wd421
1 /WX /Z7 /Ox /MT /D_NUITKA_FULL_COMPAT /D_NUITKA_STANDALONE /D_NUITKA_FROZEN=67
0 /D_NUITKA_MODULE_COUNT=1684 /D_NUITKA_EXE /ID:\WinPython-64bit-2.7.6.3\python-
2.7.6.amd64\include /I. /ID:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site
-packages\nuitka\build\include
module.Cython.Compiler.ExprNodes.cpp(258005) : error C2220: warning treated as e
rror - no 'object' file generated
module.Cython.Compiler.ExprNodes.cpp(258005) : warning C4102: 'try_except_handle
r_2' : unreferenced labelscons: *** [module.Cython.Compiler.ExprNodes.obj] Error
 2

Any suggestion? do not hesitate to contact me
msg1744 (view) Author: kayhayen Date: 2015-12-29.12:05:15
This must be some sort of reference count issue, which is pretty bad. Can you 
please follow my plea to run with --debug, which is most likely going to break in 
an assert statement earlier?

Thanks,
Kay
msg1743 (view) Author: marc.jofre Date: 2015-12-29.07:58:57
Hi all,

Running a compiled standalone program with nuitka 0.5.18pre1. After some time 
executing the following lines appear:

<type 'compiled_function'>
<type 'compiled_function'>
<type 'compiled_function'>
<type 'compiled_function'>

Then operation stops with the attach debugging dump:

kernel32.dll!SwitchToFiber()  + 0x20 bytes	
 	wampserver.exe!000000013f5a2c69() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for 
wampserver.exe]	
 	python27.dll!000000001e0a5f94() 	
 	wampserver.exe!0000000142d9f77d() 	
 	wampserver.exe!0000000142dad1e8() 	
 	wampserver.exe!0000000142daef07() 	
 	python27.dll!000000001e08bfc5() 	
 	python27.dll!000000001e1123bd() 	
 	python27.dll!000000001e11614f() 	
 	python27.dll!000000001e110f78() 	
 	python27.dll!000000001e112954() 	
 	python27.dll!000000001e116074() 	
 	python27.dll!000000001e110f78() 	
 	python27.dll!000000001e112954() 	
 	python27.dll!000000001e116074() 	
 	python27.dll!000000001e117879() 	
 	python27.dll!000000001e0b3c93() 	
 	python27.dll!000000001e08bfc5() 	
 	python27.dll!000000001e09a4f1() 	
 	python27.dll!000000001e08bfc5() 	
 	python27.dll!000000001e110d78() 	
 	python27.dll!000000001e062d33() 	
 	python27.dll!000000001e14be65() 	
 	msvcr90.dll!_endthreadex()  + 0x47 bytes	
 	msvcr90.dll!_endthreadex()  + 0xe8 bytes	
 	kernel32.dll!BaseThreadInitThunk()  + 0xd bytes	
 	ntdll.dll!RtlUserThreadStart()  + 0x21 bytes
msg1687 (view) Author: kayhayen Date: 2015-11-11.12:39:57
Hello there,

nothing changed in regards to this between releases. I suspect you are having some form of 
reference loss there to a generator. 

Please execute with --debug and see if it asserts something, then --debugger to get the stack 
trace.

Thanks,
Kay
msg1686 (view) Author: hamilyon Date: 2015-11-11.11:43:46
In standalone mode, program crashes on start. I am running linux, 64 bit.
Application does heavy use generators in tornado.

Here is bt of crashing compiled program

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000001728640 in _swapFiber ()
#2  0x00000000017288c8 in _swapFiber ()
#3  0x0000000001728a28 in _swapFiber ()
#4  0x0000000001728a9a in _swapFiber ()
#5  0x00007ffff76a0bed in PyEval_EvalFrameEx () from libpython3.4m.so.1.0


Here is strace

close(4)                                = 0
open(" ... launcher.dist/libmpdec.so.2", O_RDONLY|O_CLOEXEC) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`P\0\0\0\0\0\0"..., 832) 
= 832
fstat(4, {st_mode=S_IFREG|0644, st_size=215664, ...}) = 0
mmap(NULL, 2310832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 
0x7f370b966000
mprotect(0x7f370b99a000, 2093056, PROT_NONE) = 0
mmap(0x7f370bb99000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x33000) = 0x7f370bb99000
close(4)                                = 0
mprotect(0x7f370bb99000, 4096, PROT_READ) = 0
mprotect(0x7f370bdbb000, 4096, PROT_READ) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV (core dumped) +++

Does not reproduce on 0.5.15 for me.
History
Date User Action Args
2016-01-16 17:47:31marc.jofresetstatus: chatting -> done-cbb
messages: + msg1781
2016-01-03 11:45:57marc.jofresetmessages: + msg1753
2016-01-02 09:41:55marc.jofresetmessages: + msg1752
2016-01-01 10:19:09kayhayensetmessages: + msg1751
2015-12-29 21:10:47kayhayensetmessages: + msg1749
2015-12-29 18:35:10marc.jofresetmessages: + msg1748
2015-12-29 12:05:15kayhayensetmessages: + msg1744
2015-12-29 07:58:57marc.jofresetmessages: + msg1743
2015-11-11 12:39:57kayhayensetstatus: unread -> chatting
assignedto: kayhayen
messages: + msg1687
nosy: + kayhayen
2015-11-11 11:43:46hamilyoncreate