Closed ojura closed 3 years ago
Thanks for reporting! I’ll have a look. Does it happen when you do something in particular? It seems to be called from open_file
, does it always happen when you open a file? Or maybe when the slide is reloaded (i.e. if it’s modified on disk)?
Added a debug print. lower_bound
was a string with the content title
. I can trigger it by just going left and right on slides (mashing left and right on the keyboard).
Here are some debug prints:
# there should not be synonymous sections, correct the page here to a better guess
if page in index:
lower_bound = max(index)
print ("debug 1 index='{}', lower_bound='{}'".format(index, lower_bound))
find = index[lower_bound]
print ("debug 2 find='{}'".format(find))
while 'children' in find:
lower_bound = max(find)
print ("debug 3 lower_bound='{}'".format(lower_bound))
find = find[lower_bound]
print ("debug 4 find='{}'".format(find))
try:
page = min(number for number, label in enumerate(self.page_labels)
if label == self.page_labels[page] and number > lower_bound)
except ValueError: # empty iterator
page = lower_bound + 1
except TypeError:
print("crash: lower_bound is {}!!".format(lower_bound))
raise
And the trace:
debug 1 index='{5: {'title': 'Laser perception - SLAM'}}', lower_bound='5'
debug 2 find='{'title': 'Laser perception - SLAM'}'
debug 1 index='{5: {'title': 'Laser perception - SLAM'}, 6: {'title': 'Graph SLAM'}}', lower_bound='6'
debug 2 find='{'title': 'Graph SLAM'}'
debug 1 index='{5: {'title': 'Introduction', 'children': {5: {'title': 'Laser perception - SLAM'}, 6: {'title': 'Graph SLAM'}, 7: {'title': 'Spatio-temporal map segmentation - submaps'}}}}', lower_bound='5'
debug 2 find='{'title': 'Introduction', 'children': {5: {'title': 'Laser perception - SLAM'}, 6: {'title': 'Graph SLAM'}, 7: {'title': 'Spatio-temporal map segmentation - submaps'}}}'
debug 3 lower_bound='title'
debug 4 find='Introduction'
crash: lower_bound is title!!
Reading this without really trying to understand it much, I think you meant
lower_bound = max(find['children'])
instead of
lower_bound = max(find)
?
Anyway, it looks like a simple typo but can't currently decipher the intent. I'm sure you'll know how to fix it immediately :)
You’ve solved it :) the correct code is indeed:
while 'children' in find:
lower_bound = max(find['children'].keys())
find = find['children'][lower_bound]
Describe the bug Occasional crash.
To Reproduce Unfortunately, I have no reliable steps to reproduce. It is sporadic.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots Not crash :)
Environment (please complete the following information): Ubuntu/Windows
Debug information (see below for file locations) Here's a traceback, it might be apparent how this could happen:
Here's the (very much incomplete) presentation. It's missing media though. frontier_detection.pdf
Additional context If you need anything else, feel free to ask. I'm currently trying to get that presentation done :)