Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Python error: deallocating None #178

Open
zesoo opened this issue May 21, 2024 · 13 comments
Open

Fatal Python error: deallocating None #178

zesoo opened this issue May 21, 2024 · 13 comments

Comments

@zesoo
Copy link

zesoo commented May 21, 2024

There is a fatal error when I execute ./examples/transmit_canfd_example.py in WIN10 environment.

Message #414 NetID: 0x1 ArbID: 0x243 Data: ['0x48', '0x0', '0x1', '0x0', '0x0', '0x28', '0x26', '0x47']
Message #415 NetID: 0x1 ArbID: 0x533 Data: ['0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0']
Fatal Python error: deallocating None
Python runtime state: initialized

Current thread 0x00000c1c (most recent call first):
File ".\transmit_canfd_example.py", line 115 in receive_can
File ".\transmit_canfd_example.py", line 132 in
Message #416

How can I fix it?

@drebbe-intrepid
Copy link
Collaborator

@zesoo Can you provide me details of the following:

  1. Python Version (3.11)
  2. Python architecture (32-bit or 64-bit)
  3. python_ics version (914.x)
  4. icsneo40.dll version (3.9.x.x)
  5. Intrepid hardware in use (ValueCAN4-2, FIRE2, etc.)

@zesoo
Copy link
Author

zesoo commented May 23, 2024

@zesoo Can you provide me details of the following:

  1. Python Version (3.11)
  2. Python architecture (32-bit or 64-bit)
  3. python_ics version (914.x)
  4. icsneo40.dll version (3.9.x.x)
  5. Intrepid hardware in use (ValueCAN4-2, FIRE2, etc.)
  1. python 3.8.10
  2. 64bit
  3. python-ics 914.14.post1
  4. how can I get this version?
  5. ValueCAN4-2

@drebbe-intrepid
Copy link
Collaborator

@zesoo C:\Windows\System32\icsneo40.dll is the typical location. You can right click on it and go to properties to grab the version information.

@zesoo
Copy link
Author

zesoo commented May 27, 2024

@zesoo C:\Windows\System32\icsneo40.dll is the typical location. You can right click on it and go to properties to grab the version information.

The version is:3.9.15.14

@drebbe-intrepid
Copy link
Collaborator

@zesoo Thank you, I'm looking at it now to see if I can reproduce it.

@drebbe-intrepid
Copy link
Collaborator

@zesoo I can't reproduce this here but it looks like its crashing due to use of ExtraDataPtr (It shouldn't). Whatever Message #416 is, is creating the crash.

Can you change line 115 that reads this:

data = m.Data if not m.ExtraDataPtr else m.ExtraDataPtr

to this:

data = m.Data if not m.ExtraDataPtrEnabled else m.ExtraDataPtr

please and report back?

python .\examples\transmit_canfd_example.py
Found 2 connected device(s)...
Opening Device ValueCAN 4-2 V20673 (Open Client handles: 0)...
Opened Device ValueCAN 4-2 V20673.
Opening Device neoVI FIRE 3 ON0390 (Open Client handles: 0)...
Opened Device neoVI FIRE 3 ON0390.
================================================================================
Transmitted Messages on ValueCAN 4-2 V20673
================================================================================
Message #1      NetID: 0x1      ArbID: 0x1      Data: ['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7', '0x8', '0x9', '0xa', '0xb', '0xc', '0xd', '0xe', '0xf', '0x10', '0x11', '0x12', '0x13', '0x14', '0x15', '0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f', '0x20', '0x21', '0x22', '0x23', '0x24', '0x25', '0x26', '0x27', '0x28', '0x29', '0x2a', '0x2b', '0x2c', '0x2d', '0x2e', '0x2f', '0x30', '0x31', '0x32', '0x33', '0x34', '0x35', '0x36', '0x37', '0x38', '0x39', '0x3a', '0x3b', '0x3c', '0x3d', '0x3e', '0x3f']      Errors Present: False

================================================================================
Received Messages on neoVI FIRE 3 ON0390
================================================================================
Received 4 messages with 0 errors.
Message #1      NetID: 0x0      ArbID: 0x162    Data: ['0x1', '0x2', '0x1', '0x5d', '0x0', '0xff']
Message #2      NetID: 0x0      ArbID: 0x162    Data: ['0x0', '0x0', '0x0', '0x8', '0x2', '0xff']
Message #3      NetID: 0x0      ArbID: 0x162    Data: ['0x0', '0x0', '0x0', '0xc', '0x2', '0xff']
Message #4      NetID: 0x216    ArbID: 0x1      Data: ['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7', '0x8', '0x9', '0xa', '0xb', '0xc', '0xd', '0xe', '0xf', '0x10', '0x11', '0x12', '0x13', '0x14', '0x15', '0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f', '0x20', '0x21', '0x22', '0x23', '0x24', '0x25', '0x26', '0x27', '0x28', '0x29', '0x2a', '0x2b', '0x2c', '0x2d', '0x2e', '0x2f', '0x30', '0x31', '0x32', '0x33', '0x34', '0x35', '0x36', '0x37', '0x38', '0x39', '0x3a', '0x3b', '0x3c', '0x3d', '0x3e', '0x3f']
Finished.

@zesoo
Copy link
Author

zesoo commented Jun 6, 2024

@zesoo I can't reproduce this here but it looks like its crashing due to use of ExtraDataPtr (It shouldn't). Whatever Message #416 is, is creating the crash.

Can you change line 115 that reads this:

data = m.Data if not m.ExtraDataPtr else m.ExtraDataPtr

to this:

data = m.Data if not m.ExtraDataPtrEnabled else m.ExtraDataPtr

please and report back?

python .\examples\transmit_canfd_example.py
Found 2 connected device(s)...
Opening Device ValueCAN 4-2 V20673 (Open Client handles: 0)...
Opened Device ValueCAN 4-2 V20673.
Opening Device neoVI FIRE 3 ON0390 (Open Client handles: 0)...
Opened Device neoVI FIRE 3 ON0390.
================================================================================
Transmitted Messages on ValueCAN 4-2 V20673
================================================================================
Message #1      NetID: 0x1      ArbID: 0x1      Data: ['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7', '0x8', '0x9', '0xa', '0xb', '0xc', '0xd', '0xe', '0xf', '0x10', '0x11', '0x12', '0x13', '0x14', '0x15', '0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f', '0x20', '0x21', '0x22', '0x23', '0x24', '0x25', '0x26', '0x27', '0x28', '0x29', '0x2a', '0x2b', '0x2c', '0x2d', '0x2e', '0x2f', '0x30', '0x31', '0x32', '0x33', '0x34', '0x35', '0x36', '0x37', '0x38', '0x39', '0x3a', '0x3b', '0x3c', '0x3d', '0x3e', '0x3f']      Errors Present: False

================================================================================
Received Messages on neoVI FIRE 3 ON0390
================================================================================
Received 4 messages with 0 errors.
Message #1      NetID: 0x0      ArbID: 0x162    Data: ['0x1', '0x2', '0x1', '0x5d', '0x0', '0xff']
Message #2      NetID: 0x0      ArbID: 0x162    Data: ['0x0', '0x0', '0x0', '0x8', '0x2', '0xff']
Message #3      NetID: 0x0      ArbID: 0x162    Data: ['0x0', '0x0', '0x0', '0xc', '0x2', '0xff']
Message #4      NetID: 0x216    ArbID: 0x1      Data: ['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7', '0x8', '0x9', '0xa', '0xb', '0xc', '0xd', '0xe', '0xf', '0x10', '0x11', '0x12', '0x13', '0x14', '0x15', '0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f', '0x20', '0x21', '0x22', '0x23', '0x24', '0x25', '0x26', '0x27', '0x28', '0x29', '0x2a', '0x2b', '0x2c', '0x2d', '0x2e', '0x2f', '0x30', '0x31', '0x32', '0x33', '0x34', '0x35', '0x36', '0x37', '0x38', '0x39', '0x3a', '0x3b', '0x3c', '0x3d', '0x3e', '0x3f']
Finished.

@zesoo zesoo closed this as completed Jun 6, 2024
@zesoo
Copy link
Author

zesoo commented Jun 6, 2024

@drebbe-intrepid Thanks a lot,it worked,I wondering how to get the exact timestamp of the message.

 timeHw=m.TimeHardware|m.TimeHardware2<<32
 timeSys=m.TimeSystem|m.TimeSystem2<<32

@zesoo zesoo reopened this Jun 6, 2024
@drebbe-intrepid
Copy link
Collaborator

@drebbe-intrepid Thanks a lot,it worked,I wondering how to get the exact timestamp of the message.

 timeHw=m.TimeHardware|m.TimeHardware2<<32
 timeSys=m.TimeSystem|m.TimeSystem2<<32

try this:

https://python-ics.readthedocs.io/en/master/index.html#ics.ics.get_timestamp_for_msg

@drebbe-intrepid
Copy link
Collaborator

Also you can keep this open, I'll update the examples to resolve this issue.

@zesoo
Copy link
Author

zesoo commented Jun 6, 2024

@drebbe-intrepid Thanks a lot,it worked,I wondering how to get the exact timestamp of the message.

 timeHw=m.TimeHardware|m.TimeHardware2<<32
 timeSys=m.TimeSystem|m.TimeSystem2<<32

try this:

https://python-ics.readthedocs.io/en/master/index.html#ics.ics.get_timestamp_for_msg

HI:
I use the API get_timestamp_for_msg to get timestamp,

ts=ics.get_timestamp_for_msg(device,m)

but the result was 37 years off from the actual value.

================================================================================
Received Messages on ValueCAN 4-2 V2B290
================================================================================
Received 95 messages with 0 errors.
Msg:#1 Ts:550056817.0359169 NetID: 0x1	ArbID: 0x175	Data: ['0xff', '0xff', '0xff', '0xff', '0xff', '0xfe', '0x1', '0x0']
Msg:#2 Ts:550056817.0369124 NetID: 0x1	ArbID: 0x101	Data: ['0x8d', '0xa8', '0x7', '0x11', '0x42', '0x7c', '0xd9', '0xd4']
Msg:#3 Ts:550056817.0382698 NetID: 0x1	ArbID: 0x310	Data: ['0x55', '0x95', '0xa1', '0xa', '0x91', '0x41', '0x1e', '0xa5']
Msg:#4 Ts:550056817.0386523 NetID: 0x1	ArbID: 0x107	Data: ['0x75', '0x30', '0x75', '0x30', '0x0', '0x0', '0x0', '0x0']

@drebbe-intrepid
Copy link
Collaborator

@zesoo sorry for the late reply, ValueCAN4-2 doesn't have a battery for the RTC so you need to set the RTC when you open. See https://python-ics.readthedocs.io/en/master/index.html#ics.ics.set_rtc

@drebbe-intrepid
Copy link
Collaborator

Also the intrepid epoch is 1-1-2007.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants