Code "disappeares" during runtime
Code "disappeares" during runtime
Hi
This is a bit odd problem. What I see is that FE a class with inheritance loses all the methods it inherits from initializing to when it is used. If I, however, move the initialization close to where it's used it works just fine.
I also see a list that is initialized during the __init__ phase and only, from what I can see read once, and when it read sometimes it is gone. it no longer registers as a list.
How do I debug this? I seem to me like code is getting overwritten during runtime.
Regards
This is a bit odd problem. What I see is that FE a class with inheritance loses all the methods it inherits from initializing to when it is used. If I, however, move the initialization close to where it's used it works just fine.
I also see a list that is initialized during the __init__ phase and only, from what I can see read once, and when it read sometimes it is gone. it no longer registers as a list.
How do I debug this? I seem to me like code is getting overwritten during runtime.
Regards
Re: Code "disappeares" during runtime
Please tell us, which port and Version you use. If you have a short example which fails, please show that as well.
Re: Code "disappeares" during runtime
It this one, I'm trying to start again
viewtopic.php?f=2&t=11795
Just move over here because I think it belongs here.
I do not have a small code that fails, since I can't get my code to fail unless I run their entire application. If I just run that code part it works just fine.
that is why I would like to know who to debug the C code.
Where do I find a version number.? It's a custom port it runs on a NIOS II software core processor.
viewtopic.php?f=2&t=11795
Just move over here because I think it belongs here.
I do not have a small code that fails, since I can't get my code to fail unless I run their entire application. If I just run that code part it works just fine.
that is why I would like to know who to debug the C code.
Where do I find a version number.? It's a custom port it runs on a NIOS II software core processor.
Re: Code "disappeares" during runtime
version number by ctrl-b in REPL or uos.uname().
Re: Code "disappeares" during runtime
Hi
I've made some debugging on my missing List variable.
The list is created in the __init__ method
And later used in a class function:
I have around this code made an try/exception handler which triggers on TypeError
The printouts when the exception is triggered are following:
print(te) -> "object of type '' has no len()"
print(type(self.gen_io_vic_int)) -> "(nil)"
print(self.gen_io_vic_int) -> "<>"
print(self.__dict__) -> {........, 'gen_io_vic_int': <>, ......... }
As I can see the variable is still in the __dict__. but something has happened to it.
I know I could just move the constant values to the method and this might fix the problem. but I'm interested in the underlying cause since I have other similar problems
Regards
I've made some debugging on my missing List variable.
The list is created in the __init__ method
Code: Select all
self.gen_io_vic_int = [0x00000020, 0x00000040, 0x00000080, 0x00000100, 0x00000200,
0x00002000, 0x00004000, 0x00008000, 0x00010000, 0x00020000
Code: Select all
for mask in reversed(self.gen_io_vic_int):
....
Code: Select all
try:
for mask in reversed(self.gen_io_vic_int):
if vic_int & mask:
gen_io_int = (gen_io_int << 1) | 1
else:
gen_io_int = gen_io_int << 1
except TypeError as te:
print(te)
print(type(self.gen_io_vic_int))
print(self.gen_io_vic_int)
print(self.__dict__)
raise te
print(te) -> "object of type '' has no len()"
print(type(self.gen_io_vic_int)) -> "(nil)"
print(self.gen_io_vic_int) -> "<>"
print(self.__dict__) -> {........, 'gen_io_vic_int': <>, ......... }
As I can see the variable is still in the __dict__. but something has happened to it.
I know I could just move the constant values to the method and this might fix the problem. but I'm interested in the underlying cause since I have other similar problems
Regards
Re: Code "disappeares" during runtime
I can also see that one list out of two also gets messed up.
In the __init__ method I have the following code.
When I get the exception I print out the entire __dict__
and the two lists looks as following
the first one is correct however the other looks like
but should have looked like this
I looks more and more like some data is getting overwritten I just do not know how.
In the __init__ method I have the following code.
Code: Select all
self._int_status_offset = list()
for offset in range(256, 256 + 32 * 16, 16):
self._int_status_offset.append(offset)
self._int_setup_offset = list()
for offset in range(1280, 1280 + 32 * 16, 16):
self._int_setup_offset.append(offset)
and the two lists looks as following
Code: Select all
'_int_status_offset': [256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512, 528, 544, 560, 576, 592, 608, 624, 640, 656, 672, 688, 704, 720, 736, 752],
the first one is correct however the other looks like
Code: Select all
'_int_setup_offset': [(nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil)],
but should have looked like this
Code: Select all
'_int_setup_offset': [1280, 1296, 1312, 1328, 1344, 1360, 1376, 1392, 1408, 1424, 1440, 1456, 1472, 1488, 1504, 1520, 1536, 1552, 1568, 1584, 1600, 1616, 1632, 1648, 1664, 1680, 1696, 1712, 1728, 1744, 1760, 1776],
I looks more and more like some data is getting overwritten I just do not know how.
Re: Code "disappeares" during runtime
So I tried making the class a singleton. and this somehow worked. It's not a memory problem because only 20% of memory is used at the point in time.
It would really be helpful with some insight. or an idea on how to debug this issue.
Regards
It would really be helpful with some insight. or an idea on how to debug this issue.
Regards