Robert-N7 / abmatt

ANoob's Brres Material Tool for Mario Kart Wii
GNU General Public License v3.0
14 stars 3 forks source link

SIGSEGV (Address boundary error) #29

Open Heath123 opened 3 years ago

Heath123 commented 3 years ago

When replacing a model, I get SIGSEGV (Address boundary error) I'm on Linux, and as the latest releases have no Linux version I'm doing PYTHONPATH=./ python3 ./abmatt/gui/main_window.py from the command line in the git repo Steps to reproduce:

  1. Open the course_model.brres file of Luigi Circuit
  2. Expand it, right-click on course and select Replace, and open the linked DAE file

DAE file and textures: https://drive.google.com/file/d/1fPR8lll5iK-dEPh6m27LuG9NGL2Gxm-O/view?usp=sharing This doesn't happen with the same model as an OBJ but the file is still unusable due to #28

Heath123 commented 3 years ago

I imagine the reason why I'm having so many problems is that I use Blender and from your custom track pages it looks like you use Sketchup and 3DS Max? So maybe they export models differently

Robert-N7 commented 3 years ago

I'll see if I can create a linux release when I get the newest update. While I do not use Blender I did test with it once before. It could be causing some issues, but hopefully we can work through them

Robert-N7 commented 3 years ago

This one may take longer to fix, it seems to happen intermittently

Heath123 commented 3 years ago

Ah, thank you

Heath123 commented 3 years ago

I still get this after updating...

Heath123 commented 3 years ago

I tried using gdb:

$ PYTHONPATH=./ gdb python3
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...
(No debugging symbols found in python3)
(gdb) run ./abmatt/gui/main_window.py
Starting program: /usr/bin/python3 ./abmatt/gui/main_window.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 145340]
[New Thread 0x7fffeec4b700 (LWP 145341)]
[New Thread 0x7fffec44a700 (LWP 145342)]
[New Thread 0x7fffebc49700 (LWP 145343)]
[New Thread 0x7fffe2b10700 (LWP 145344)]
[New Thread 0x7fffe1471700 (LWP 145345)]
[New Thread 0x7fffdb50a700 (LWP 145347)]
[New Thread 0x7fffdad09700 (LWP 145348)]
[New Thread 0x7fffda508700 (LWP 145349)]
[New Thread 0x7fffd9aaa700 (LWP 145351)]
[New Thread 0x7fffd9087700 (LWP 145354)]
[New Thread 0x7fffbffff700 (LWP 145356)]
[New Thread 0x7fffb7fff700 (LWP 145357)]
QLayout: Attempting to add QLayout "" to Tex0WidgetGroup "", which already has a layout
[Thread 0x7fffebc49700 (LWP 145343) exited]
[Thread 0x7fffec44a700 (LWP 145342) exited]
[Thread 0x7fffeec4b700 (LWP 145341) exited]
[Detaching after fork from child process 145359]
[New Thread 0x7fffebc49700 (LWP 145376)]
[New Thread 0x7fffec44a700 (LWP 145377)]
[New Thread 0x7fffeec4b700 (LWP 145378)]
[New Thread 0x7fffbdb19700 (LWP 145379)]
[New Thread 0x7fffb58f4700 (LWP 145380)]
[New Thread 0x7fffb50f3700 (LWP 145381)]
[New Thread 0x7fffb48f2700 (LWP 145382)]
[New Thread 0x7fff97fff700 (LWP 145383)]
[New Thread 0x7fff977fe700 (LWP 145384)]
[New Thread 0x7fff96ffd700 (LWP 145386)]
[Thread 0x7fffb50f3700 (LWP 145381) exited]
[Thread 0x7fffec44a700 (LWP 145377) exited]
[Thread 0x7fffd9aaa700 (LWP 145351) exited]
[Thread 0x7fff97fff700 (LWP 145383) exited]
[Thread 0x7fff977fe700 (LWP 145384) exited]
[Thread 0x7fffeec4b700 (LWP 145378) exited]
[Thread 0x7fffb58f4700 (LWP 145380) exited]
[Thread 0x7fffebc49700 (LWP 145376) exited]
[Thread 0x7fffb48f2700 (LWP 145382) exited]
[Detaching after fork from child process 145393]
[New Thread 0x7fffb48f2700 (LWP 145399)]
[New Thread 0x7fffebc49700 (LWP 145400)]
[New Thread 0x7fffb58f4700 (LWP 145401)]
[New Thread 0x7fffeec4b700 (LWP 145402)]
[New Thread 0x7fffd9aaa700 (LWP 145403)]
[New Thread 0x7fffb50f3700 (LWP 145404)]
[New Thread 0x7fff97fff700 (LWP 145405)]
[New Thread 0x7fff977fe700 (LWP 145406)]
[New Thread 0x7fff73fff700 (LWP 145407)]
[New Thread 0x7fff737fe700 (LWP 145408)]
[New Thread 0x7fff72ffd700 (LWP 145409)]
[New Thread 0x7fff727fc700 (LWP 145410)]
[New Thread 0x7fff71ffb700 (LWP 145411)]
[Thread 0x7fff72ffd700 (LWP 145409) exited]
[Thread 0x7fff71ffb700 (LWP 145411) exited]
[Thread 0x7fff727fc700 (LWP 145410) exited]
[Thread 0x7fff73fff700 (LWP 145407) exited]
[Thread 0x7fff97fff700 (LWP 145405) exited]
[Thread 0x7fff977fe700 (LWP 145406) exited]
[Thread 0x7fffbdb19700 (LWP 145379) exited]
[Thread 0x7fffb50f3700 (LWP 145404) exited]
[Thread 0x7fff737fe700 (LWP 145408) exited]
[New Thread 0x7fff737fe700 (LWP 145417)]
[Thread 0x7fffd9aaa700 (LWP 145403) exited]
Converting /home/heath/luigi/dae2/course.dae... 
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x00007ffff3372998 in QStandardItem::child(int, int) const () from /home/heath/.local/lib/python3.8/site-packages/PyQt5/Qt/lib/libQt5Gui.so.5
(gdb) backtrace
#0  0x00007ffff3372998 in QStandardItem::child(int, int) const () at /home/heath/.local/lib/python3.8/site-packages/PyQt5/Qt/lib/libQt5Gui.so.5
(gdb)
Heath123 commented 3 years ago

So it seems like it's caused by PyQt5 maybe?

This one may take longer to fix, it seems to happen intermittently

I can reproduce it every time, if that helps

Heath123 commented 3 years ago

Possibly related?

Heath123 commented 3 years ago

I tried doing this to get something like a backtrace and the few linea executed are apparently:

 --- modulename: convert_lib, funcname: __eq__
convert_lib.py(202):         return type(self) == type(other) and self.brres is other.brres and self.mdl0 is other.mdl0 \
convert_lib.py(202):         return type(self) == type(other) and self.brres is other.brres and self.mdl0 is other.mdl0 \
converter.py(46):         for x in self.queue:
converter.py(50):         self.queue.append(converter)
converter.py(51):         return True
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(135):                 message = self.queue.pop(0)
autofix.py(136):                 message.send(self.pipe)
 --- modulename: autofix, funcname: send
autofix.py(93):             message = self.message
autofix.py(94):             print(message)
Converting /home/heath/luigi/dae2/course.dae... 
autofix.py(95):             if pipe:
autofix.py(96):                 pipe.info(message)
 --- modulename: logger_pipe, funcname: info
logger_pipe.py(12):         if not self.signalsBlocked():
logger_pipe.py(13):             self.info_sig.emit(message)
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
 --- modulename: main_window, funcname: info
main_window.py(431):         self.emit(message, '<p style="color:Blue;">', '</p>')
 --- modulename: main_window, funcname: emit
main_window.py(223):         message = message.replace('\n', '<br/>').replace(' ', '&nbsp;')
main_window.py(224):         if head:
main_window.py(225):             message = head + message
main_window.py(226):         if tail:
main_window.py(227):             message += tail
main_window.py(228):         self.logger.appendHtml(message)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
autofix.py(133):             sleep(0.01)
autofix.py(134):             if len(self.queue):
autofix.py(132):         while self.is_running:
Heath123 commented 3 years ago

Maybe the logged messages are too long and this crashes it? That would explain why the error is thrown in Qt

Heath123 commented 3 years ago

Commenting out this line: https://github.com/Robert-N7/abmatt/blob/c8582ed40aaa392ae6f92cebc29a85092037a010/abmatt/gui/main_window.py#L431 fixes the issue

Heath123 commented 3 years ago

Well, the messages aren't too long, maybe they contain something invalid

Heath123 commented 3 years ago

No, changing the message to just "test" still crashes it

Heath123 commented 3 years ago

What does fix the issue:

What doesn't fix the issue:

Heath123 commented 3 years ago

The issue just stopped happening after I changed my icon theme to something else and back again (???)

Heath123 commented 3 years ago

Wait, no, it's happening again

Heath123 commented 3 years ago

Now it happens intermittently like it did for you?