RegexpParser crashes Python 3.8.6 kernel in JupyterLab - python-3.x

I am parsing chunks of pos-tagged text in JupyterLabs.
NLTK can run on Python<3.5 and >3.8 according to its faq.
I can return pos-tagged text just fine. But when I want to return parsed chunks, it crashes python.
I am running MacOS 11.1, Python 3.8.6, Jupyterlab 3.0.0, and nltk 3.5
from nltk import *
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
sentence_re = r'''(?x)
([A-Z])(\.[A-Z])+\.?
| \w+(-\w+)*
| \$?\d+(\.\d+)?%?
| \.\.\.
| [][.,;"'?():-_`]
'''
grammar = r"""
NBAR:
{<NN.*|JJ>*<NN.*>} # Nouns and Adjectives, terminated with Nouns
NP:
{<NBAR>}
{<NBAR><IN><NBAR>} # Above, connected with in/of/etc...
"""
chunker = RegexpParser(grammar)
toks = word_tokenize(text)
postoks = pos_tag(toks)
All is fine until I want to parse the chunks with RegexpParser. At which point, it crashes the kernel.
chunker.parse(postoks)
beginning of the crash report:
Process: Python [1549]
Path: /usr/local/Cellar/python#3.8/3.8.6_2/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
Identifier: org.python.python
Version: 3.8.6 (3.8.6)
Code Type: X86-64 (Native)
Parent Process: Python [1522]
Responsible: Terminal [416]
User ID: 501
Date/Time: 2020-12-29 15:34:13.546 -0500
OS Version: macOS 11.1 (20C69)
Report Version: 12
Anonymous UUID: 8EEE2257-0986-3569-AA83-52641AF02282
Time Awake Since Boot: 1200 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
end of the crash report:
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 4
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: 4785
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=835.0M resident=0K(0%) swapped_out_or_unallocated=835.0M(100%)
Writable regions: Total=1.5G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.5G(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 1
Dispatch continuations 64.0M 1
Kernel Alloc Once 8K 1
MALLOC 150.1M 37
MALLOC guard page 24K 5
MALLOC_MEDIUM (reserved) 960.0M 8 reserved VM address space (unallocated)
STACK GUARD 72K 18
Stack 86.6M 18
VM_ALLOCATE 182.5M 359
VM_ALLOCATE (reserved) 128.0M 2 reserved VM address space (unallocated)
__DATA 16.1M 460
__DATA_CONST 11.8M 200
__DATA_DIRTY 509K 87
__FONT_DATA 4K 1
__LINKEDIT 506.1M 241
__OBJC_RO 60.5M 1
__OBJC_RW 2452K 2
__TEXT 329.5M 432
__UNICODE 588K 1
mapped file 51.5M 9
shared memory 40K 4
=========== ======= =======
TOTAL 2.5G 1888
TOTAL, minus reserved VM space 1.4G 1888
Model: iMac18,2, BootROM 429.60.3.0.0, 4 processors, Quad-Core Intel Core i7, 3.6 GHz, 32 GB, SMC 2.40f1
Graphics: kHW_AMDRadeonPro560Item, Radeon Pro 560, spdisplays_pcie_device, 4 GB
Memory Module: BANK 0/DIMM0, 16 GB, DDR4 SO-DIMM, 2400 MHz, 0x802C, 0x313641544632473634485A2D3247334232202020
Memory Module: BANK 1/DIMM0, 16 GB, DDR4 SO-DIMM, 2400 MHz, 0x802C, 0x313641544632473634485A2D3247334232202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x16E), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1675.1)
Bluetooth: Version 8.0.2f9, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
USB Device: USB 3.0 Bus
USB Device: AS2105
USB Device: USB 2.0 BILLBOARD
USB Device: Bluetooth USB Host Controller
USB Device: FaceTime HD Camera (Built-in)
USB Device: Scarlett 2i4 USB
USB Device: My Passport 0827
Thunderbolt Bus: iMac, Apple Inc., 41.4

Related

Kamene causing python3 segmentation fault

I have a basic python3 script for running a ping sweep using kamene with two main issues. I'm not sure if they are related so I'll add them both in the same post.
Where in here is the main issue and what have I done wrong?
First issue...
When I import IP and ICMP from kamena.all I have an error as below...
No name 'IP' in module 'kamene.all'pylint(no-name-in-module)
No name 'ICMP' in module 'kamene.all'pylint(no-name-in-module)
Second issue...
When I run the program, I get an IPv6 error and then a segmentation fault with a warning from OSX to say that python has stopped.
python3 pingsweep.py
WARNING: No route found for IPv6 destination :: (no default route?). This affects only IPv6
Segmentation fault: 11
This is my script code...
from kamene.all import sr1,IP,ICMP
for ip in range(1, 8):
packet = IP(dst="192.168.0." + str(ip), ttl=20) / ICMP()
reply = sr1(packet, timeout=2)
if not (reply is None):
print(reply.dst)
I have installed kamene with...
pip3 install kamene
Lastly, the crash report from OSX...
Process: Python [13831]
Path: /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 3.7.1 (3.7.1)
Code Type: X86-64 (Native)
Parent Process: bash [10827]
Responsible: Python [13831]
User ID: 501
Date/Time: 2019-03-29 15:45:33.205 +0000
OS Version: Mac OS X 10.14.4 (18E226)
Report Version: 12
Anonymous UUID: D6F17B07-49F0-ACAE-B5D6-25ABF231369D
Sleep/Wake UUID: AAE0878E-9596-4A63-BAD9-7146B5F303F5
Time Awake Since Boot: 28000 seconds
Time Since Wake: 16000 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 0x0000000000000014
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [13831]
VM Regions Near 0x14:
-->
__TEXT 000000010197b000-000000010197c000 [ 4K] r-x/rwx SM=COW /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libpcap.A.dylib 0x00007fff72b9041f pcap_get_selectable_fd + 4
1 _ctypes.cpython-37m-darwin.so 0x00000001027001d7 ffi_call_unix64 + 79
2 _ctypes.cpython-37m-darwin.so 0x0000000102700a38 ffi_call + 872
3 _ctypes.cpython-37m-darwin.so 0x00000001026fb9fb _ctypes_callproc + 891
4 _ctypes.cpython-37m-darwin.so 0x00000001026f5af0 PyCFuncPtr_call + 1040
5 org.python.python 0x00000001019a08b1 _PyObject_FastCallKeywords + 433
6 org.python.python 0x0000000101a602f4 call_function + 420
7 org.python.python 0x0000000101a5d4a7 _PyEval_EvalFrameDefault + 25351
8 org.python.python 0x00000001019a0ed0 function_code_fastcall + 128
9 org.python.python 0x0000000101a60432 call_function + 738
10 org.python.python 0x0000000101a5d3ec _PyEval_EvalFrameDefault + 25164
11 org.python.python 0x0000000101a60f56 _PyEval_EvalCodeWithName + 2422
12 org.python.python 0x00000001019a063b _PyFunction_FastCallDict + 523
13 org.python.python 0x00000001019a190f _PyObject_Call_Prepend + 143
14 org.python.python 0x00000001019efe91 slot_tp_init + 145
15 org.python.python 0x00000001019eb7e9 type_call + 297
16 org.python.python 0x00000001019a08b1 _PyObject_FastCallKeywords + 433
17 org.python.python 0x0000000101a602f4 call_function + 420
18 org.python.python 0x0000000101a5d54d _PyEval_EvalFrameDefault + 25517
19 org.python.python 0x0000000101a60f56 _PyEval_EvalCodeWithName + 2422
20 org.python.python 0x00000001019a0a61 _PyFunction_FastCallKeywords + 257
21 org.python.python 0x0000000101a60432 call_function + 738
22 org.python.python 0x0000000101a5d54d _PyEval_EvalFrameDefault + 25517
23 org.python.python 0x0000000101a60f56 _PyEval_EvalCodeWithName + 2422
24 org.python.python 0x0000000101a570c4 PyEval_EvalCode + 100
25 org.python.python 0x0000000101a94591 PyRun_FileExFlags + 209
26 org.python.python 0x0000000101a93e0a PyRun_SimpleFileExFlags + 890
27 org.python.python 0x0000000101ab219b pymain_main + 6827
28 org.python.python 0x0000000101ab26ea _Py_UnixMain + 58
29 libdyld.dylib 0x00007fff73c1b3d5 start + 1
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x00007ffeee283290 rcx: 0x00000001019a0373 rdx: 0x00007ffeee283110
rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x00007ffeee283160 rsp: 0x00007ffeee283160
r8: 0x00007ffeee283110 r9: 0x00000001019a01e8 r10: 0x00007ffeee2830c0 r11: 0x00007fff72b9041b
r12: 0x00007ffeee2830c0 r13: 0x0000000000000001 r14: 0x0000000102700a60 r15: 0x00007fffa6c14070
rip: 0x00007fff72b9041f rfl: 0x0000000000010246 cr2: 0x0000000000000014
Logical CPU: 0
Error Code: 0x00000004
Trap Number: 14
Binary Images:
0x10197b000 - 0x10197bfff +org.python.python (3.7.1 - 3.7.1) <4B030EC4-815E-34B7-90E7-D0720C31E072> /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
0x10197f000 - 0x101b57fff +org.python.python (3.7.1, [c] 2001-2018 Python Software Foundation. - 3.7.1) <977C0919-F108-3AC9-8796-F42032694A62> /Library/Frameworks/Python.framework/Versions/3.7/Python
0x101f25000 - 0x101f2eff7 +_socket.cpython-37m-darwin.so (0) <0BA1CC79-DBFC-332D-9DEE-7A81A6654023> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_socket.cpython-37m-darwin.so
0x101f7b000 - 0x101f7cfff +_heapq.cpython-37m-darwin.so (0) <E8B35F18-1B5A-3C9E-B1F4-0BE0432459A2> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_heapq.cpython-37m-darwin.so
0x101f80000 - 0x101f84fff +math.cpython-37m-darwin.so (0) <E18B0A65-B44F-3F1D-96A8-C29A7F794019> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/math.cpython-37m-darwin.so
0x101f8b000 - 0x101f8dfff +select.cpython-37m-darwin.so (0) <869F8AE3-73B4-35C4-82CA-3D954FD00F78> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/select.cpython-37m-darwin.so
0x1021e6000 - 0x1021e8ff7 +_hashlib.cpython-37m-darwin.so (0) <13B96FDE-C671-3396-B89D-2ACB4F56A05B> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_hashlib.cpython-37m-darwin.so
0x1021ed000 - 0x10222eff7 +libssl.1.1.dylib (0) <E00648A8-30F5-3638-8774-6EE461AB8CAC> /Library/Frameworks/Python.framework/Versions/3.7/lib/libssl.1.1.dylib
0x10224f000 - 0x10242cc6f +libcrypto.1.1.dylib (0) <4E4019C3-04B3-3DA5-8504-57FF0E7C5600> /Library/Frameworks/Python.framework/Versions/3.7/lib/libcrypto.1.1.dylib
0x1024ac000 - 0x1024b1ff7 +_blake2.cpython-37m-darwin.so (0) <5D4A9B1B-FE9F-34EA-BD75-7B3CDDBB7CD0> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_blake2.cpython-37m-darwin.so
0x1024b6000 - 0x1024c6ff7 +_sha3.cpython-37m-darwin.so (0) <78945AB7-D4B8-3DCE-8496-EE83FDA05E0D> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_sha3.cpython-37m-darwin.so
0x1024cc000 - 0x1024ccff7 +_bisect.cpython-37m-darwin.so (0) <A4FCF31A-2AA6-3EAC-AF46-2F2D10EC1AB1> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_bisect.cpython-37m-darwin.so
0x1024cf000 - 0x1024d0ff7 +_random.cpython-37m-darwin.so (0) <CE043712-0C0E-3DA4-AAF2-35654CC67C6D> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_random.cpython-37m-darwin.so
0x1024d4000 - 0x1024d8fff +_struct.cpython-37m-darwin.so (0) <2379780F-4AB4-394B-B5AB-55A517D6627E> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_struct.cpython-37m-darwin.so
0x102521000 - 0x102522ff7 +_posixsubprocess.cpython-37m-darwin.so (0) <11920A4C-3AD4-3C87-95E5-418D30950610> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_posixsubprocess.cpython-37m-darwin.so
0x102526000 - 0x102527fff +fcntl.cpython-37m-darwin.so (0) <ADADACC0-C00C-3386-9709-CCB56A7C95E0> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/fcntl.cpython-37m-darwin.so
0x10252b000 - 0x10252eff7 +zlib.cpython-37m-darwin.so (0) <CB41B121-E928-3213-92CE-7A26C3F668BF> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/zlib.cpython-37m-darwin.so
0x102534000 - 0x102539ff7 +array.cpython-37m-darwin.so (0) <B594CECF-180C-348D-B9DA-11275D232042> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/array.cpython-37m-darwin.so
0x102654000 - 0x102667fff +_pickle.cpython-37m-darwin.so (0) <2F30BDA6-A35E-38F0-9096-72DDCA1030B6> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_pickle.cpython-37m-darwin.so
0x1026f3000 - 0x102703ff7 +_ctypes.cpython-37m-darwin.so (0) <78FCD5A2-0B47-331E-A406-2876C1289C15> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
0x102755000 - 0x102756ff7 +_bz2.cpython-37m-darwin.so (0) <732D55D3-F86E-31E0-95B9-DB921419F7B2> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_bz2.cpython-37m-darwin.so
0x10275a000 - 0x10278aff7 +_lzma.cpython-37m-darwin.so (0) <91D1CDE2-5956-3869-87A0-29726C9D4C60> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_lzma.cpython-37m-darwin.so
0x102794000 - 0x102794fff +grp.cpython-37m-darwin.so (0) <9C889B5E-65A3-339F-8F34-E10FF20A6ED9> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/grp.cpython-37m-darwin.so
0x102797000 - 0x10279cff7 +libdnet.dylib (0) <BD67BA1C-F58B-3ABF-89DE-35B09579779F> /usr/local/lib/libdnet.dylib
0x1027e1000 - 0x1027e3ffb +netifaces.cpython-37m-darwin.so (0) <0DCF0A83-6515-3E4E-902C-2E0E7FF24E13> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/netifaces.cpython-37m-darwin.so
0x102d04000 - 0x102d48ff7 +_decimal.cpython-37m-darwin.so (0) <C94BD9E0-CEBA-3930-AB10-15E1FEFAA244> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_decimal.cpython-37m-darwin.so
0x102db0000 - 0x102db1ff7 +_queue.cpython-37m-darwin.so (0) <C457E118-139B-352D-A6F9-DA76389AE74E> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_queue.cpython-37m-darwin.so
0x103b9f000 - 0x103c096ef dyld (655.1.1) <F217F7F8-A795-3109-B77F-B1E2277F3E3B> /usr/lib/dyld
0x7fff47769000 - 0x7fff47bacfff com.apple.CoreFoundation (6.9 - 1570.16) <F3DFF269-6705-35AD-9F01-66D77DD1B518> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff705a0000 - 0x7fff705a1ffb libDiagnosticMessagesClient.dylib (107) <B5675E8C-2F34-3E0A-B7E8-6F2373589038> /usr/lib/libDiagnosticMessagesClient.dylib
0x7fff709df000 - 0x7fff709e0ffb libSystem.B.dylib (1252.250.1) <72841192-B0C9-36A0-8E55-ED651EADEF08> /usr/lib/libSystem.B.dylib
0x7fff70c14000 - 0x7fff70c21fff libbz2.1.0.dylib (38.200.3) <62019AC3-20C9-3DDC-9C83-189C1F258073> /usr/lib/libbz2.1.0.dylib
0x7fff70c22000 - 0x7fff70c75ff7 libc++.1.dylib (400.9.4) <446DAE5E-4E97-3E4B-B2A3-AC0A74C0E453> /usr/lib/libc++.1.dylib
0x7fff70c76000 - 0x7fff70c8bff7 libc++abi.dylib (400.17) <A2D1FDAD-E10F-3E53-958F-CB6BC8485767> /usr/lib/libc++abi.dylib
0x7fff71898000 - 0x7fff71af8ff3 libicucore.A.dylib (62123.0.1) <3936C798-1978-3C6C-9050-3BBD57CDA53E> /usr/lib/libicucore.A.dylib
0x7fff723d9000 - 0x7fff72b5efdf libobjc.A.dylib (756.2) <4F86FC7C-496B-3E68-8A74-1EA2BA22FBCC> /usr/lib/libobjc.A.dylib
0x7fff72b77000 - 0x7fff72bacfff libpcap.A.dylib (79.250.1) <FA490ABF-6C15-336A-818F-0C14A8C090DB> /usr/lib/libpcap.A.dylib
0x7fff732af000 - 0x7fff732c1ff7 libz.1.dylib (70.200.4) <FDF169F3-F992-3E8E-B3F7-D4134FEBAE41> /usr/lib/libz.1.dylib
0x7fff73a9e000 - 0x7fff73aa2ff3 libcache.dylib (81) <9A8C27B0-49C9-337F-8BE2-37171ED2D8EE> /usr/lib/system/libcache.dylib
0x7fff73aa3000 - 0x7fff73aadff3 libcommonCrypto.dylib (60118.250.2) <17C4F395-9FF0-331F-8167-5E85AA3588E9> /usr/lib/system/libcommonCrypto.dylib
0x7fff73aae000 - 0x7fff73ab5ff7 libcompiler_rt.dylib (63.4) <8CB2B2B6-2C55-3733-9842-0E037AE3F46A> /usr/lib/system/libcompiler_rt.dylib
0x7fff73ab6000 - 0x7fff73abfff7 libcopyfile.dylib (146.250.1) <24905E41-9E2F-3DD1-A255-5A17F9FCDAD7> /usr/lib/system/libcopyfile.dylib
0x7fff73ac0000 - 0x7fff73b44fc7 libcorecrypto.dylib (602.250.23) <3A6CBD41-AFFE-3E06-B1EC-3E95BC79BAC5> /usr/lib/system/libcorecrypto.dylib
0x7fff73bcb000 - 0x7fff73c04ff7 libdispatch.dylib (1008.250.7) <50235FCE-B399-3319-90DC-88F530D4FC5C> /usr/lib/system/libdispatch.dylib
0x7fff73c05000 - 0x7fff73c31ff7 libdyld.dylib (655.1.1) <54C6B494-4A3D-3EEC-B083-636A76AAD649> /usr/lib/system/libdyld.dylib
0x7fff73c32000 - 0x7fff73c32ffb libkeymgr.dylib (30) <BEA04E04-FCF1-3A70-810F-08D0FF54CA36> /usr/lib/system/libkeymgr.dylib
0x7fff73c40000 - 0x7fff73c40ff7 liblaunch.dylib (1336.251.2) <30E6424E-4640-3DBA-9B64-D5F725263C6E> /usr/lib/system/liblaunch.dylib
0x7fff73c41000 - 0x7fff73c46fff libmacho.dylib (927.0.2) <D8515A20-ED7B-3B13-9ADA-4BD7E19E38C4> /usr/lib/system/libmacho.dylib
0x7fff73c47000 - 0x7fff73c49ffb libquarantine.dylib (86.220.1) <8A9BF971-DB7D-311A-B131-6C5025E82F8F> /usr/lib/system/libquarantine.dylib
0x7fff73c4a000 - 0x7fff73c4bff7 libremovefile.dylib (45.200.2) <950036B7-B91E-3B5D-853C-8C551E5B6A32> /usr/lib/system/libremovefile.dylib
0x7fff73c4c000 - 0x7fff73c63ff3 libsystem_asl.dylib (356.200.4) <16F632AD-FADA-3DE9-85E8-EBC7D619A1DA> /usr/lib/system/libsystem_asl.dylib
0x7fff73c64000 - 0x7fff73c64ff7 libsystem_blocks.dylib (73) <0CD6861B-EC5F-3345-9C24-B21EEB85E44F> /usr/lib/system/libsystem_blocks.dylib
0x7fff73c65000 - 0x7fff73cecfff libsystem_c.dylib (1272.250.1) <F3AA9047-EEDD-3D80-8CC1-023FB312EC8B> /usr/lib/system/libsystem_c.dylib
0x7fff73ced000 - 0x7fff73cf0ffb libsystem_configuration.dylib (963.250.1) <02C7A973-014A-31D7-B7D2-247D384CB0D2> /usr/lib/system/libsystem_configuration.dylib
0x7fff73cf1000 - 0x7fff73cf4ff7 libsystem_coreservices.dylib (66) <4CF1C89B-FA6C-3DF3-B1F8-79F549849534> /usr/lib/system/libsystem_coreservices.dylib
0x7fff73cf5000 - 0x7fff73cfbfff libsystem_darwin.dylib (1272.250.1) <6983A268-20F4-3F98-A3F5-D63848933B02> /usr/lib/system/libsystem_darwin.dylib
0x7fff73cfc000 - 0x7fff73d02ff7 libsystem_dnssd.dylib (878.250.4) <9FC5724C-DD03-3E14-A6E1-2DD009D79E0A> /usr/lib/system/libsystem_dnssd.dylib
0x7fff73d03000 - 0x7fff73d4effb libsystem_info.dylib (517.200.9) <F617D3CF-5A4A-36D0-8CBB-4A7C7CDB67AF> /usr/lib/system/libsystem_info.dylib
0x7fff73d4f000 - 0x7fff73d77ff7 libsystem_kernel.dylib (4903.251.3) <84EF0290-6CB5-36E5-A273-692A7E437B36> /usr/lib/system/libsystem_kernel.dylib
0x7fff73d78000 - 0x7fff73dc3ff7 libsystem_m.dylib (3158.200.7) <33105665-CCC3-36D5-82C9-9B21730CB3DF> /usr/lib/system/libsystem_m.dylib
0x7fff73dc4000 - 0x7fff73de8fff libsystem_malloc.dylib (166.251.2) <90DA09E3-1276-3FCF-8F5F-C9AA61AB9B6D> /usr/lib/system/libsystem_malloc.dylib
0x7fff73de9000 - 0x7fff73df3ff7 libsystem_networkextension.dylib (767.250.2) <4575D797-B793-3D18-9E93-8696CF0B133B> /usr/lib/system/libsystem_networkextension.dylib
0x7fff73df4000 - 0x7fff73dfbfff libsystem_notify.dylib (172.200.21) <679E9132-1A46-326E-9A11-D3FF9C86041C> /usr/lib/system/libsystem_notify.dylib
0x7fff73dfc000 - 0x7fff73e05fef libsystem_platform.dylib (177.250.1) <3CC59141-5365-3848-94C3-D65E6FCA1E74> /usr/lib/system/libsystem_platform.dylib
0x7fff73e06000 - 0x7fff73e10ff7 libsystem_pthread.dylib (330.250.2) <4344198A-A1A3-3C52-97B4-F168D56E9789> /usr/lib/system/libsystem_pthread.dylib
0x7fff73e11000 - 0x7fff73e14ff7 libsystem_sandbox.dylib (851.250.12) <66E91015-F62A-3365-BB81-AA88707E8F12> /usr/lib/system/libsystem_sandbox.dylib
0x7fff73e15000 - 0x7fff73e17ff3 libsystem_secinit.dylib (30.220.1) <F054DCB0-68CE-35E7-8B8C-D648C42124EC> /usr/lib/system/libsystem_secinit.dylib
0x7fff73e18000 - 0x7fff73e1fff3 libsystem_symptoms.dylib (820.257.1) <C8517F35-E9DA-3649-B07D-2B38349C6730> /usr/lib/system/libsystem_symptoms.dylib
0x7fff73e20000 - 0x7fff73e35fff libsystem_trace.dylib (906.250.5) <AE77ACC7-488F-3AE1-BB0C-1ACFC7E1CE77> /usr/lib/system/libsystem_trace.dylib
0x7fff73e37000 - 0x7fff73e3cffb libunwind.dylib (35.4) <8F0BC197-B97C-3DDC-92B0-6A7D3CB72FD8> /usr/lib/system/libunwind.dylib
0x7fff73e3d000 - 0x7fff73e6cff7 libxpc.dylib (1336.251.2) <49138829-09C8-355C-B558-97E070B84EC5> /usr/lib/system/libxpc.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
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: 15008
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=246.6M resident=0K(0%) swapped_out_or_unallocated=246.6M(100%)
Writable regions: Total=65.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=65.1M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Kernel Alloc Once 8K 1
MALLOC 48.3M 22
MALLOC guard page 16K 4
MALLOC_LARGE (reserved) 384K 2 reserved VM address space (unallocated)
STACK GUARD 4K 1
Stack 16.0M 1
VM_ALLOCATE 4K 1
__DATA 5684K 74
__LINKEDIT 223.1M 29
__TEXT 23.5M 71
__UNICODE 564K 1
shared memory 12K 3
=========== ======= =======
TOTAL 317.5M 210
TOTAL, minus reserved VM space 317.1M 210
Model: MacBookPro11,1, BootROM 151.0.0.0.0, 2 processors, Intel Core i5, 2.6 GHz, 8 GB, SMC 2.16f68
Graphics: kHW_IntelIrisItem, Intel Iris, spdisplays_builtin
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x02FE, -
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x02FE, -
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x112), Broadcom BCM43xx 1.0 (7.77.61.2 AirPortDriverBrcmNIC-1305.8)
Bluetooth: Version 6.0.11f4, 3 services, 18 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0256F, 251 GB
USB Device: USB 3.0 Bus
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: USB Optical Mouse
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.2
I cannot reproduce your issues with Scapy, so I'll assume that's only related to Kamene (I have edited your question to reflect that).
You can either try using the "real" Scapy (https://github.com/secdev/scapy), or report this issue to the Kamene project.
This happens due to permissions issue with mac. The python program is not able to get write to the packet on to network. I had a similar issue and using sudo resolved the issue.

Managing interrupts from custom hardware

I am working on a driver for a custom piece of hardware (Xilinx FPGA based) and am having difficulty picking up the interrupt it is sending. The old system ran uCOS-II and just registered the interrupt ID 94. When I register that interrupt in Linux, it never triggers even though I know the hardware is sending the signal.
Is there something besides calling register_irqthat I need to do?
Is there a way for me to see all interrupt signals sent to the CPU even if nothing has registered for them?
/proc/interrupts:
CPU0 CPU1
16: 0 0 GIC-0 43 Level ttc_clockevent
17: 9383808 10190941 GIC-0 29 Edge twd
20: 68 0 GIC-0 82 Level xuartps
21: 0 0 GIC-0 45 Level f8003000.ps7-dma
22: 0 0 GIC-0 46 Level f8003000.ps7-dma
23: 0 0 GIC-0 47 Level f8003000.ps7-dma
24: 0 0 GIC-0 48 Level f8003000.ps7-dma
25: 0 0 GIC-0 49 Level f8003000.ps7-dma
26: 0 0 GIC-0 72 Level f8003000.ps7-dma
27: 0 0 GIC-0 73 Level f8003000.ps7-dma
28: 0 0 GIC-0 74 Level f8003000.ps7-dma
29: 0 0 GIC-0 75 Level f8003000.ps7-dma
33: 33759 0 GIC-0 54 Level eth0
35: 16184 0 GIC-0 56 Level mmc0
36: 0 0 GIC-0 57 Level cdns-i2c
37: 15117 0 GIC-0 58 Level e0006000.spi
38: 9 0 GIC-0 81 Level e0007000.spi
39: 204 0 GIC-0 40 Level f8007000.devcfg
40: 43 0 GIC-0 39 Level f8007100.xadc
41: 0 0 GIC-0 89 Edge 7c400000.dma
42: 0 0 GIC-0 88 Edge 7c420000.dma
94: 0 0 zynq-gpio 48 Level my_int_handle
IPI1: 0 0 Timer broadcast interrupts
IPI2: 25906 23777 Rescheduling interrupts
IPI3: 37 17 Function call interrupts
IPI4: 0 0 CPU stop interrupts
IPI5: 0 0 IRQ work interrupts
IPI6: 0 0 completion interrupts
Err: 0
Boot Log:
EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
* Will now restart
þeboot: Restarting system
U-Boot 2015.07-03600-g7bcb6ed (Dec 22 2015 - 12:24:30 +0200)
Model: Zynq PicoZed SDR2 Board
I2C: ready
DRAM: ECC disabled 1 GiB
MMC: zynq_sdhci: 0
Invalid bus 0 (err=-1)
*** Warning - spi_flash_probe() failed, using default environment
In: serial
Out: serial
Err: serial
Model: Zynq PicoZed SDR2 Board
Net: Gem.e000b000
Hit any key to stop autoboot: 0
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SS08G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
679 bytes read in 10 ms (65.4 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Running uenvcmd ...
Setting clocks
Copying Linux from SD to RAM...
reading uImage
3946384 bytes read in 380 ms (9.9 MiB/s)
reading devicetree.dtb
8768 bytes read in 46 ms (185.5 KiB/s)
reading uramdisk.image.gz
** Unable to read file uramdisk.image.gz **
## Booting kernel from Legacy Image at 03000000 ...
Image Name: Linux-4.9.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3946320 Bytes = 3.8 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
Booting using the fdt blob at 0x2a00000
Loading Kernel Image ... OK
Loading Device Tree to 1fffa000, end 1ffff23f ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.9.0 (root#analog) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #2 SMP PREEMPT Tue Feb 27 22:37:50 UTC 2018
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: ags,FMC
bootconsole [earlycon0] enabled
cma: Reserved 128 MiB at 0x38000000
Memory policy: Data cache writealloc
percpu: Embedded 13 pages/cpu #ef7d5000 s23744 r8192 d21312 u53248
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260608
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 900532K/1048576K available (5249K kernel code, 231K rwdata, 1696K rodata, 260K init, 154K bss, 16972K reserved, 131072K cma-reserved, 131072K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0528a24 (5251 kB)
.init : 0xc0701000 - 0xc0742000 ( 260 kB)
.data : 0xc0742000 - 0xc077bd80 ( 232 kB)
.bss : 0xc077bd80 - 0xc07a27b4 ( 155 kB)
Preemptible hierarchical RCU implementation.
Build-time adjustment of leaf fanout to 32.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to f0802000
slcr mapped to f0804000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0804100
Zynq clock init
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
sched_clock: 16 bits at 54kHz, resolution 18432ns, wraps every 603975816ns
timer #0 at f080c000, irq=16
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x82c0 - 0x8318
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource ttc_clocksource
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=30 max_order=18 bucket_order=0
jitterentropy: Initialization failed with host not compliant with requirements: 2
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.ps7-dma: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.ps7-dma: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.uart: ttyPS0 at MMIO 0xe0001000 (irq = 20, base_baud = 6249999) is a xuartps
àconsole [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f0871000
[drm] Initialized
brd: module loaded
loop: module loaded
spidev spi32766.0: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f61645e ]---
spidev spi32765.0: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f61645f ]---
spidev spi32765.1: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f616460 ]---
spidev spi32765.2: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f616461 ]---
MACsec IEEE 802.1AE
libphy: Fixed MDIO Bus: probed
libphy: mdio_driver_register: xgmiitorgmii
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
libphy: XEMACPS mii bus: probed
[Firmware Warn]: /amba#0/eth#e000b000/phy#0: Whitelisted compatible string. Please remove
xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 33
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 36
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
gspca_main: v2.14.0 registered
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
hidraw: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
cf_axi_adc 79020000.cf-ad9361-lpc: could not find spi node
OF: /fpga-axi#0/cf-ad9361-dds-core-lpc#79024000: could not find phandle
ERROR: could not get clock /fpga-axi#0/cf-ad9361-dds-core-lpc#79024000:sampl_clk(0)
cf_axi_dds: probe of 79024000.cf-ad9361-dds-core-lpc failed with error -2
NET: Registered protocol family 17
zynq_pm_remap_ocm: no compatible node found for 'xlnx,zynq-ocmc-1.0'
zynq_pm_suspend_init: Unable to map OCM.
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address aaaa
mmcblk0: mmc0:aaaa SS08G 7.40 GiB
mmcblk0: p1 p2 p3
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 260K (c0701000 - c0742000)
This architecture does not have kernel memory protection.
random: fast init done
Mount failed for selinuxfs on /sys/fs/selinux: No such file or directory
init: hwclock main process (799) terminated with status 1
Adding 511996k swap on /swapfile. Priority:-1 extents:1 across:511996k SS
* Setting up X socket directories... [ OK ]
Setting default sampling frequency to 2.1 MSPS
/etc/rcS.d/S99default-sdr: line 3: /sys/bus/iio/devices/iio:device1/in_voltage_sampling_frequency: No such file or directory
Loading default filter
/etc/rcS.d/S99default-sdr: line 7: /sys/bus/iio/devices/iio:device1/filter_fir_config: No such file or directory
* STARTDISTCC is set to false in /etc/default/distcc
* /usr/bin/distccd not starting
* Starting NTP server ntpd [ OK ]
* Starting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
*
* Starting IIO Daemon iiod [ OK ]
Last login: Thu Jan 1 21:40:23 UTC 1970 from 169.254.212.36 on pts/1
Welcome to Linaro 14.04 (GNU/Linux 4.9.0 armv7l)
Which driver are you using, your custom driver or Xilinx GPIO?
As I understand you hardcoded Linux IRQ number 94 in register irq?
94: 0 0 zynq-gpio 48 Level my_int_handle
I would say that you have to declare your GPIO node as interrupt controller in the device tree with appropiate interrupt property, because driver uses that information for interrupt:
gpio->irq = platform_get_irq(pdev, 0);
I'm not sure of the exact IRQ number mapping.
Device tree node for GPIO controller on Zynq looks like this:
gpio#e000a000 {
#gpio-cells = <2>;
#interrupt-cells = <2>;
compatible = "xlnx,zynq-gpio-1.0";
clocks = <&&clkc 42>;
gpio-controller;
interrupt-controller;
interrupt-parent = <&&intc>;
interrupts = <0 20 4>;
interrupt-controller;
#interrupt-cells = <2>;
reg = <0xe000a000 0x1000>;
};
If you use hardcoded Linux IRQ number instead of device tree, you can try to find it with probe_irq_on/off();

Read errors after an UBIFS update

I am encountering the messages below after creating an UBIFS filesystem in
a new UBI volume on an existing UBI partition.
This happens while reading all the files on the UBI fs via tar -cf /dev/null *:
UBIFS error (pid 1810): ubifs_read_node: bad node type (255 but expected 1)
UBIFS error (pid 1810): ubifs_read_node: bad node at LEB 33:967120, LEB mapping status 0
Not a node, first 24 bytes:
00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
CPU: 0 PID: 1810 Comm: tar Tainted: P O 3.18.80 #3
Backtrace:
[<8001b664>] (dump_backtrace) from [<8001b880>] (show_stack+0x18/0x1c)
r7:00000000 r6:00000000 r5:80000013 r4:80566cbc
[<8001b868>] (show_stack) from [<801d77e0>] (dump_stack+0x88/0xa4)
[<801d7758>] (dump_stack) from [<80171608>] (ubifs_read_node+0x1fc/0x2b8)
r7:00000021 r6:00000712 r5:000ec1d0 r4:bd59d000
[<8017140c>] (ubifs_read_node) from [<8018b654>](ubifs_tnc_read_node+0x88/0x124)
r10:00000000 r9:b4f9fdb0 r8:bd59d264 r7:00000001 r6:b71e6000 r5:bd59d000
r4:b6126148
[<8018b5cc>] (ubifs_tnc_read_node) from [<80174690>](ubifs_tnc_locate+0x108/0x1e0)
r7:00000001 r6:b71e6000 r5:00000001 r4:bd59d000
[<80174588>] (ubifs_tnc_locate) from [<80168200>] (do_readpage+0x1c0/0x39c)
r10:bd59d000 r9:000005b1 r8:00000000 r7:bd258710 r6:a5914000 r5:b71e6000
r4:be09e280
[<80168040>] (do_readpage) from [<80169398>] (ubifs_readpage+0x44/0x424)
r10:00000000 r9:00000000 r8:bd59d000 r7:be09e280 r6:00000000 r5:bd258710
r4:00000000
[<80169354>] (ubifs_readpage) from [<80089654>](generic_file_read_iter+0x48c/0x5d8)
r10:00000000 r9:00000000 r8:00000000 r7:be09e280 r6:bd2587d4 r5:bd5379e0
r4:00000000
[<800891c8>] (generic_file_read_iter) from [<800bbd60>](new_sync_read+0x84/0xa8)
r10:00000000 r9:b4f9e000 r8:80008e24 r7:bd6437a0 r6:bd5379e0 r5:b4f9ff80
r4:00001000
[<800bbcdc>] (new_sync_read) from [<800bc85c>] (__vfs_read+0x20/0x54)
r7:b4f9ff80 r6:7ec2d800 r5:00001000 r4:800bbcdc
[<800bc83c>] (__vfs_read) from [<800bc91c>] (vfs_read+0x8c/0xf4)
r5:00001000 r4:bd5379e0
[<800bc890>] (vfs_read) from [<800bc9cc>] (SyS_read+0x48/0x80)
r9:b4f9e000 r8:80008e24 r7:00001000 r6:7ec2d800 r5:bd5379e0 r4:bd5379e0
[<800bc984>] (SyS_read) from [<80008c80>] (ret_fast_syscall+0x0/0x3c)
r7:00000003 r6:7ec2d800 r5:00000008 r4:00082a08
UBIFS error (pid 1811): do_readpage: cannot read page 0 of inode 1457, error -22
Mounting looks like this:
UBI-0: ubi_attach_mtd_dev:default fastmap pool size: 190
UBI-0: ubi_attach_mtd_dev:default fastmap WL pool size: 25
UBI-0: ubi_attach_mtd_dev:attaching mtd3 to ubi0
UBI-0: scan_all:scanning is finished
UBI-0: ubi_attach_mtd_dev:attached mtd3 (name "data", size 3824 MiB)
UBI-0: ubi_attach_mtd_dev:PEB size: 1048576 bytes (1024 KiB), LEB size: 1040384 bytes
UBI-0: ubi_attach_mtd_dev:min./max. I/O unit sizes: 4096/4096, sub-page size 4096
UBI-0: ubi_attach_mtd_dev:VID header offset: 4096 (aligned 4096), data offset: 8192
UBI-0: ubi_attach_mtd_dev:good PEBs: 3816, bad PEBs: 8, corrupted PEBs: 0
UBI-0: ubi_attach_mtd_dev:user volume: 6, internal volumes: 1, max. volumes count: 128
UBI-0: ubi_attach_mtd_dev:max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1362948729
UBI-0: ubi_attach_mtd_dev:available PEBs: 2313, total reserved PEBs: 1503, PEBs reserved for bad PEB handling: 72
UBI-0: ubi_thread:background thread "ubi_bgt0d" started, PID 419
UBIFS: mounted UBI device 0, volume 6, name "slot1", R/O mode
UBIFS: LEB size: 1040384 bytes (1016 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
UBIFS: FS size: 259055616 bytes (247 MiB, 249 LEBs), journal size 12484608 bytes (11 MiB, 12 LEBs)
UBIFS: reserved for root: 4952683 bytes (4836 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID 92C7B251-2666-4717-B735-5539900FE749, small LPT model
The rate of reproduction is one in about 20 sequences of: ubirmvol,
ubimkvol (256MB), unpack a rootfs.tgz (20MB, 40MB unpacked) in the
mounted UBIFS, umount, ubidetach, sync, reboot. There are no xattrs
created. No power cuts happen during the tests.
The board runs a 3.18.80 kernel on an ARM board. I tested other
identical test boards where only the NAND chip manufacturer was
different.
I had CONFIG_MTD_UBI_FASTMAP enabled when the error occured, but I
used no explicit fastmap boot cmdline option. I tried mounting the
ubifs with a rebuilt kernel that had the config option disabled after
the issue reproduced, but the read error still occured.
I also tried mounting with a kernel that had "ubifs: Fix journal
replay w.r.t. xattr nodes" patch [1] applied, after reading older similar error reports, but once reproduced on a NAND, the read error
persisted.
[1] https://patchwork.ozlabs.org/patch/713213/
Is there some special requirement except just umount, ubidetach and
sync before running reboot, or regarding free space fixup ? Would
creating the fs image offline with mkfs.ubifs instead of unpacking it
via tar make a difference here ? Would it help to test with
cherry picked commits from linux v4.14 that touch
fs/ubifs ?

FTDI D2XX FT_DEVICE_LIST_INFO_NODE structure is all zeros

I am trying to get a Matlab MEX to run in Linux. It uses FTDI's D2XX library v1.3.6 (Documentation).
FT_CreateDeviceInfoList(&ftdi_count) gives me an ftdi_count of 1, so the FTDI chip is detected.
However, when iterating through the device list from FT_GetDeviceInfoList(device_list, &ftdi_count), my FT_DEVICE_LIST_INFO_NODE structure is all zeros, so obviously the code cannot find the device with the description it is looking for:
(gdb) p *p_device
$3 = {Flags = 1, Type = 3, ID = 0, LocId = 0, SerialNumber = '\000' <repeats 15 times>,
Description = '\000' <repeats 63 times>, ftHandle = 0x0}
My first guess was that udev wasn't set up. But the problem persists with
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}="6014", MODE="0666"
lsusb -v has access to the values:
Bus 001 Device 012: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6014 FT232H Single HS USB-UART/FIFO IC
bcdDevice 9.00
iManufacturer 1 FTDI
iProduct 2 [company that provided me with their] Kit v3
iSerial 3 FT266WVA
bNumConfigurations 1
[...]
What can I do to make the FTDI functions work?
The problem is that Linux automatically loads the VCP driver (ftdi_sio).
In the Question How can I get Linux device with FTDI D2XX driver API, Akira shows a udev script to from A blog unload that driver. I modified it to work with my FT232H chip, which has only one port:
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", RUN+="/bin/sh -c 'echo -n $kernel:1.0 > /sys/bus/usb/drivers/ftdi_sio/unbind;'"

CPU stalling in SMP

We are facing an issue on which we need some help.
Brief write-up :
We have enabled SMP in Linux 2.6.39.4 kernel and cross compiled it for PPC-476. After booting, kernel is able to map both the processors (2 cores at h/w). The problem we are facing is, while running modprobe command repeatedly, one of the cpu goes into stall state. We have tried to dump stack of all active cpus (using sysrq) while one of the cpu is in stall state. The stack dump showed both the processors were executing same process (with same PID) i.e. modprobe.
Question :
1. is it possible for both the processors to be executing same process at a movement with same PID.
2. Is the execution of both process simultaneously give rise to some race condition which is causing either of CPU to go in stall state.
LOGS===============================================
SysRq : Show backtrace of all active CPUs
CPU0:
NIP: 701786c4 LR: 701752f0 CTR: 00000004
REGS: 9fb4fdc0 TRAP: 0501 Not tainted (2.6.39.4)
MSR: 00029000 <EE,ME,CE> CR: 44002048 XER: 00000000
TASK = 8f868ae0[827] 'modprobe' THREAD: 9fb48000 CPU: 0
GPR00: 08101820 9fb4fe70 8f868ae0 22222222 0002374d 00000002 00849ffc 00000000
GPR08: a2bb3a8c 00000810 a2c2aac4 00000148 44002088
NIP [701786c4] __sw_hweight32+0x50/0x58
LR [701752f0] __bitmap_weight+0x54/0xc0
Call Trace:
[9fb4fe70] [20000000] 0x20000000 (unreliable)
[9fb4fe90] [7006b1cc] sys_init_module+0x11a8/0x1ca4
[9fb4ff40] [7000f1b8] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0x10050e38
LR = 0x100a6708
Instruction dump:
7c634838 7c004838 7c001a14 5409e13e 7c090214 3d200f0f 61290f0f 7c004838
5409c23e 7c090214 5409843e 7c090214 <5403063e> 4e800020 5460f87e 70005555
CPU1:
NIP: 700a9678 LR: 700a964c CTR: 7012b0f8
REGS: 9fb4fe30 TRAP: 0501 Not tainted (2.6.39.4)
MSR: 00029000 <EE,ME,CE> CR: 80008022 XER: 20000000
TASK = 8f868ae0[827] 'modprobe' THREAD: 9fb48000 CPU: 1
GPR00: 00000000 9fb4fee0 8f868ae0 9efb9f20 9efb9f20 9fb4fee8 1004d6d0 0002d000
GPR08: 9efb9d68 9f8eee00 9efb9f20 00000000 20002022
NIP [700a9678] do_munmap+0x114/0x314
LR [700a964c] do_munmap+0xe8/0x314
Call Trace:
[9fb4fee0] [00000014] 0x14 (unreliable)
[9fb4ff20] [700aa7c8] sys_munmap+0x44/0x74
[9fb4ff40] [7000f1b8] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0x100510a8
LR = 0x10022088
Instruction dump:
4bffe461 7c641b79 41820010 80040004 7f9d0040 419d01d4 83210008 2e190000
41920200 83d9000c 801f0074 2f800000 <419e00f8> 2f9e0000 419e00f0 801e0004
Call Trace:
[9ffaff00] [70008654] show_stack+0x6c/0x1a4 (unreliable)
[9ffaff40] [70192d30] showacpu+0x84/0xcc
[9ffaff60] [700679bc] generic_smp_call_function_single_interrupt+0x100/0x18c
[9ffaff90] [7000ff6c] call_function_single_action+0x10/0x24
[9ffaffa0] [7006f7f4] handle_irq_event_percpu+0xa0/0x21c
[9ffaffe0] [700728d8] handle_percpu_irq+0x88/0xb8
[9ffafff0] [7000e038] call_handle_irq+0x18/0x28
[9fb4fdf0] [700044b0] do_IRQ+0xe8/0x1a0
[9fb4fe20] [7000f81c] ret_from_except+0x0/0x18
--- Exception: 501 at do_munmap+0x114/0x314
LR = do_munmap+0xe8/0x314
[9fb4fee0] [00000014] 0x14 (unreliable)
[9fb4ff20] [700aa7c8] sys_munmap+0x44/0x74
[9fb4ff40] [7000f1b8] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0x100510a8
=============================================================
Both questions of yours are False. There is no possibility that two cores run the same task at the same moment.
From the OOPS/panic trace, we can know that kernel panic on CPU 0 first, then it triggered the SysRq to "Show backtrace of all active CPUs". That is to say, CPU 1 works good at the time CPU 0 panic, but CPU 0 exception triggered to dump the backtrace of CPU 1.
Now let us analysis why CPU 0 panic: from the backtrace, it happened during "modprobe", so please analysis the kernel modules on your system to locate the one that trigger the panic.

Resources