Segfault while running django tests in parallel mode on macOS

1

When i running test in regular mode there is no problem. But if i trying to run test with --parallel flag i'm always getting segmentation fault in my system after processing half of my tests. I have ~7000 tests in my project and segmentation fault happened always when ~3500 test passed)

I've tried to use OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES environment variable to solve this problem but it doesn't help me.

Here is some system trace of my error:

Process:               Python [21265]
Path:                  /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.6.8 (3.6.8)
Code Type:             X86-64 (Native)
Parent Process:        Python [21222]
Responsible:           pycharm [342]
User ID:               501

Date/Time:             2021-03-01 17:22:25.997 +0200
OS Version:            macOS 11.2.1 (20D74)
Report Version:        12
Bridge OS Version:     3.0 (14Y908)
Anonymous UUID:        61E9A706-0C04-8107-68D7-088455564AD6


Time Awake Since Boot: 24000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [21265]

VM Regions Near 0x8:
--> 
    __TEXT                      10d915000-10d916000    [    4K] r-x/rwx SM=COW  /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python

Application Specific Information:
*** multi-threaded process forked ***
crashed on child side of fork pre-exec

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation        0x00007fff205afaf6 _CFGetNonObjCTypeID + 10
1   com.apple.CoreFoundation        0x00007fff204a6536 CFNotificationCenterAddObserver + 55
2   com.apple.CoreFoundation        0x00007fff204a62f5 __CFNotificationCenterGetLocalCenter_block_invoke + 167
3   libdispatch.dylib               0x00007fff202427c7 _dispatch_client_callout + 8
4   libdispatch.dylib               0x00007fff2024396b _dispatch_once_callout + 20
5   com.apple.CoreFoundation        0x00007fff204a624c CFNotificationCenterGetLocalCenter + 42
6   com.apple.CoreText              0x00007fff21a93d2c _CTFontCollectionCreated(__CTFontCollection const*) + 64
7   com.apple.CoreText              0x00007fff21ad3585 TCFRef<CTCollection*> TCFBase_NEW<CTCollection, __CFArray const*&, __CFDictionary const*&>(__CFArray const*&, __CFDictionary const*&) + 95
8   com.apple.CoreText              0x00007fff21a9c775 CTFontCollectionCreateFromAvailableFonts + 177
9   libpangocairo-1.0.0.dylib       0x000000010f22c328 pango_core_text_font_map_init + 152
10  libgobject-2.0.0.dylib          0x000000010ecb5cdd g_type_create_instance + 845
11  libgobject-2.0.0.dylib          0x000000010eca2ef3 g_object_new_internal + 51
12  libgobject-2.0.0.dylib          0x000000010eca273c g_object_new + 252
13  libpangocairo-1.0.0.dylib       0x000000010f227b59 pango_cairo_font_map_get_default + 41
14  libpangocairo-1.0.0.dylib       0x000000010f225a24 pango_cairo_create_context + 20
15  libpangocairo-1.0.0.dylib       0x000000010f225ac1 pango_cairo_create_layout + 17
16  libffi.dylib                    0x00007fff2da2b8e5 ffi_call_unix64 + 85
17  libffi.dylib                    0x00007fff2da2b22a ffi_call_int + 692
18  libffi.dylib                    0x00007fff2da2b22a ffi_call_int + 692
...
510 libffi.dylib                    0x00007fff2da2b22a ffi_call_int + 692
511 libffi.dylib                    0x00007fff2da2b22a ffi_call_int + 692

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x91b9acdaff56007c  rbx: 0x00007fff802b96d0  rcx: 0x00007fff802b96d0  rdx: 0x00007fff20587c82
  rdi: 0x0000000000000000  rsi: 0x000000000000007b  rbp: 0x00007ffee22d5350  rsp: 0x00007ffee22d5350
   r8: 0x0000000000000000   r9: 0x000000000000000e  r10: 0x00007fff203bbc5a  r11: 0x0000000000000202
  r12: 0x000000000000000e  r13: 0x0000000000000000  r14: 0x000000000000007b  r15: 0x0000000000000000
  rip: 0x00007fff205afaf6  rfl: 0x0000000000010246  cr2: 0x0000000000000008
  
Logical CPU:     5
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14

Thread 0 instruction stream:
  00 84 c9 74 2c e8 a2 64-06 00 66 83 f9 14 75 07  ...t,..d..f...u.
  b8 01 00 00 00 eb 1a 48-8b 35 a4 9d 4a 68 5d ff  .......H.5..Jh].
  25 0d a0 b5 5f b8 2a 00-00 00 eb 05 b8 07 00 00  %..._.*.........
  00 5d c3 0f 1f 00 b5 ff-ff ff e1 ff ff ff f6 ff  .]..............
  ff ff fb ff ff ff da ff-ff ff da ff ff ff ef ff  ................
  ff ff 90 90 c3 90 55 48-89 e5 40 f6 c7 01 75 11  ......UH..@...u.
 [48]8b 47 08 c1 e8 08 25-ff 03 00 00 e9 87 00 00  H.G....%........ <==
  00 48 8b 05 b2 9f b5 5f-8b 00 31 f8 89 c2 d1 ea  .H....._..1.....
  be 07 00 00 00 21 f2 c1-e8 04 0f b6 c8 48 83 c1  .....!.......H..
  08 39 f2 48 0f 45 ca 66-83 f9 06 77 34 b8 16 00  .9.H.E.f...w4...
  00 00 48 8d 15 51 00 00-00 48 63 0c 8a 48 01 d1  ..H..Q...Hc..H..
  ff e1 48 bf ff ff ff ff-01 09 e3 07 e8 75 10 07  ..H..........u..
  
Thread 0 last branch register state not available.

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 43439
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=689.1M resident=0K(0%) swapped_out_or_unallocated=689.1M(100%)
Writable regions: Total=483.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=483.7M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
Dispatch continuations            64.0M        1 
Kernel Alloc Once                    8K        1 
MALLOC                           402.2M     1100 
MALLOC guard page                   16K        4 
MALLOC_LARGE (reserved)            256K        2         reserved VM address space (unallocated)
STACK GUARD                          4K        1 
Stack                             16.5M        2 
Stack Guard                          4K        1 
VM_ALLOCATE                         12K        3 
__DATA                            12.6M      356 
__DATA_CONST                      11.1M      172 
__DATA_DIRTY                       502K       86 
__FONT_DATA                          4K        1 
__LINKEDIT                       494.8M       96 
__OBJC_RO                         60.6M        1 
__OBJC_RW                         2449K        2 
__TEXT                           194.4M      349 
__UNICODE                          588K        1 
mapped file                       4516K        6 
shared memory                       40K        4 
===========                     =======  ======= 
TOTAL                              1.2G     2190 
TOTAL, minus reserved VM space     1.2G     2190 
python
django
multithreading
macos
segmentation-fault

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0