crash with signal SIGSEGV during loading html into HtmlFrame
I use TkinterWeb to show email with html, which generally works very well. Loading the attached html text (crash_SIGSEGV) with load_html() from the HtmlFrame class I get the signal interrupt SIGSEGV (11), for which I can't find the reason. I hope, you can reproduce this error and have an idea? I work with Python 3.10.12 running on Linux Mint 21.2 Cinnamon. I'm not very familiar with HTML, so I add another very similar html which does not create a crash, perhaps this helps.
Hi! It seems that the first occurrence of <table role="presentation" border="0" cellpadding="0" cellspacing="0" class="mobile-width-100" width="292" align="left" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> is causing the crash. Even replacing it with <table> causes the crash. Are you sure all of the tables/table rows/cells are properly formatted?
Sorry, I don't know, if the html is defined correctly. I've got this HTML as part of an email, and I must say, that I don't know enough about HTML to answer your question. Firefox has no problem with this HTML-file, and shows it perfectly. So, I think, there is perhaps something in the definition regarding Webpage Compatibility, which crashes Tkhtml?
Hi! I tried simplifying the code to the basic structure of table, td, and tr tags and TkinterWeb still crashes. I noticed, though, that the code has many issues, such as tags that are never closed, end tags that close tags that don't exist, table cells outside of tables, tables inside table rows instead of cells, etc.
For example, <table><tr><table></table></tr> causes a crash. I could add some code that would correct the code by inserting a <td> tag between the <tr> and the nested <table> tag as a workaround, but this would slow down the loading of other webpages that are properly formatted. It is probably best that this is done on your end before passing the code to TkinterWeb.
It seems that Firefox automatically repairs the code when displaying. I agree that the crashes are neither ideal nor the expected behaviour, but the crashes are occurring in the underlying Tkhtml3 HTML engine and fixing that is beyond the scope of this project. I suggest cleaning up the code before passing it to TkinterWeb. The HTML provided is quite deformed, but there are plenty of HTML cleaners in Python that might do the trick.
Sorry I couldn't be more helpful here.