segmentation faults tkhtml3

66 views
Skip to first unread message

Jim McNamara

unread,
Jun 27, 2015, 8:21:22 AM6/27/15
to tkh...@googlegroups.com
Hi-

I posted a question on comp.lang.tcl too.

Should the following code run? I am getting segment faults.
I was able to install the browser that is related, however.
I could see the errors in the command line.
This code just crashes Tkproe, and I am left without a clue.

thanks!

# Load the Tkhtml package
  package require Tkhtml 3.0


 # Create and populate an html widget.
 set html4 [html .toplevel253.label107 -shrink 1]
$html4 cget -defaultstyle
$html4 parse -final {
    <b>Hello <i>world<i><b> example
  }
 grid $html4  

Kaleb

unread,
Jun 29, 2015, 7:08:48 AM6/29/15
to tkh...@googlegroups.com

I believe this project is long dead

--
You received this message because you are subscribed to the Google Groups "tkhtml3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tkhtml3+u...@googlegroups.com.
To post to this group, send email to tkh...@googlegroups.com.
Visit this group at http://groups.google.com/group/tkhtml3.
For more options, visit https://groups.google.com/d/optout.

Matthias Meier

unread,
Jun 29, 2015, 9:25:44 AM6/29/15
to tkh...@googlegroups.com
Hi,

we use tkhtml in an productive enviroment.

The code you provided runs fine.
(tk8.6.1)

Although we have made some bugfixes in tkhtml.
But i think they do not have anything to do with the code you provided.

Matthias



-- 
Mit freundlichen Grüßen

Matthias Meier
FuH Entwicklungsgesellschaft mbH
Geschäftsführer Carola Fornoff
HRB Freiburg 701203, UID DE255007372
Elsässer Str. 18, D-79346 Endingen
Telefon +49 - 7642 - 92866 - 0

Ole Streicher

unread,
Jun 29, 2015, 9:35:07 AM6/29/15
to tkh...@googlegroups.com

Hi Mathias,

I am hosting a git repository of tkhtml3, and also maintain its Debian packages. The git repository

https://github.com/olebole/tkhtml3

already includes patches from you dating back to 2011:

* Fix the problem that tkhtml seems to ignore 'background-color' on tbody-tags.
* If I have a html-table like all the columns are resized if the widget ist smaller then it should be

Do you have more? If so, I would like to include them on the github page.

Best regards

Ole

Matthias Meier

unread,
Jun 29, 2015, 12:30:42 PM6/29/15
to tkh...@googlegroups.com
Hi Ole,

my colleague Stefan has send you another patch in 2013.
These have fixed the segment faults we've had bevore.

Have you included this already in the git reprository?

Best regards

Matthias





Am 29.06.2015 15:35, schrieb Ole Streicher:
>
> Hi Mathias,
>
> I am hosting a git repository of tkhtml3, and also maintain its
Debian packages. The git repository
>
> https://github.com/olebole/tkhtml3
>
> already includes patches from you dating back to 2011:
>
> * Fix the problem that tkhtml seems to ignore 'background-color' on
tbody-tags.
> * If I have a html-table like all the columns are resized if the
widget ist smaller then it should be
>
> Do you have more? If so, I would like to include them on the github page.
>
> Best regards
>
> Ole
>
>
> Am Montag, 29. Juni 2015 15:25:44 UTC+2 schrieb m.meier:
>
> Hi,
>
> we use tkhtml in an productive enviroment.
>
> The code you provided runs fine.
> (tk8.6.1)
>
> Although we have made some bugfixes in tkhtml.
> But i think they do not have anything to do with the code you
provided.
>
> Matthias
>




-------- Original-Nachricht --------
Betreff: [PATCH] to tkhtml3
Datum: Fri, 26 Apr 2013 18:55:22 +0200
Von: Ziegler, Stefan <Zie...@FuH-E.de>
Organisation: FuH Entwicklungsgesellschaft mbH
An: Ole Streicher <deb...@liska.ath.cx>

Hello Ole,

My colleague Matthias Meier had send patches in june 2011.
I also made some changes last year an this year to make tkhtml more
stable when working in the software of our company. The main part is
avoiding/deleting asserts.
If an assertion is false, our whole tcl/tk application just
crash/disappears from screen. To avoid these crashed, we made the
following changes:

Date: Fri, 26 Apr 2013 18:26:09 +0200
Subject: [PATCH] Added new function HtmlInitTreeNodeCmd and deleted/avoid
some asserts to make tkhtml a little bit more stable for
us.

---
src/html.h | 1 +
src/htmltcl.c | 26 +++++++++++++++++---------
src/htmltree.c | 15 ++++++++++++++-
3 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/html.h b/src/html.h
index c8e82bc..1f25905 100644
--- a/src/html.h
+++ b/src/html.h
@@ -913,6 +913,7 @@ void HtmlTreeAddText(HtmlTree *, HtmlTextNode *, int);
void HtmlTreeAddClosingTag(HtmlTree *, int, const char *, int);

void HtmlInitTree(HtmlTree *);
+void HtmlInitTreeNodeCmd(HtmlTree *);

void HtmlHashInit(void *, int);
HtmlTokenMap * HtmlHashLookup(void *, const char *zType);
diff --git a/src/htmltcl.c b/src/htmltcl.c
index 055213e..61f2fe5 100644
--- a/src/htmltcl.c
+++ b/src/htmltcl.c
@@ -498,6 +498,11 @@ INSTRUMENTED(callbackHandler, HTML_INSTRUMENT_CALLBACK)
HtmlNodeComputedValues(pTree->pRoot) ||
pTree->cb.pRestyle==pTree->pRoot
);
+
+ while( pTree->cb.inProgress ) {
+ usleep( 2000 );
+ }
+
HtmlCheckRestylePoint(pTree);

HtmlLog(pTree, "CALLBACK",
@@ -668,14 +673,17 @@ HtmlCallbackForce(pTree)
(!pTree->cb.inProgress)
) {
ClientData clientData = (ClientData)pTree;
- assert(!pTree->cb.isForce);
- pTree->cb.isForce++;
- callbackHandler(clientData);
- pTree->cb.isForce--;
- assert(pTree->cb.isForce >= 0);
- if (pTree->cb.flags == 0) {
- Tcl_CancelIdleCall(callbackHandler, clientData);
- }
+ if( !pTree->cb.isForce )
+ {
+ pTree->cb.isForce++;
+ callbackHandler(clientData);
+ pTree->cb.isForce--;
+ assert(pTree->cb.isForce >= 0);
+
+ if (pTree->cb.flags == 0) {
+ Tcl_CancelIdleCall(callbackHandler, clientData);
+ }
+ };
}
}

@@ -2430,7 +2438,7 @@ nodeCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument strings. */
{
- HtmlInitTree((HtmlTree *)clientData);
+ HtmlInitTreeNodeCmd((HtmlTree *)clientData);
return HtmlLayoutNode(clientData, interp, objc, objv);
}
static int
diff --git a/src/htmltree.c b/src/htmltree.c
index 079fd58..8ac300c 100644
--- a/src/htmltree.c
+++ b/src/htmltree.c
@@ -997,10 +997,23 @@ HtmlInitTree(pTree)
* document is the current node.
*/
pTree->state.pCurrent = HtmlNodeChild(pTree->pRoot, 1);
- assert(HtmlNodeTagType(pTree->state.pCurrent) == Html_BODY);
}
}

+void
+HtmlInitTreeNodeCmd(pTree)
+ HtmlTree *pTree;
+{
+ if (pTree->pRoot
+ && !pTree->state.pCurrent) {
+ /* If there is no current node, then the <body> node of the
+ * document is the current node.
+ */
+ pTree->state.pCurrent = HtmlNodeChild(pTree->pRoot, 1);
+ }
+}
+
+
static HtmlNode *
findFosterParent(pTree, ppTable)
HtmlTree *pTree;








0001-Added-new-function-HtmlInitTreeNodeCmd-and-deleted-a.patch

Ole Streicher

unread,
Jun 30, 2015, 7:28:49 AM6/30/15
to tkh...@googlegroups.com
Hi Matthias,


Am Montag, 29. Juni 2015 18:30:42 UTC+2 schrieb m.meier:
my colleague Stefan has send you another patch in 2013.
These have fixed the segment faults we've had bevore.
Have you included this already in the git reprository?
 
Yes, it is there. So, I am up to date :-)
If anyone else has a bugfix, I will happily include it.

Best regards

Ole

C Y

unread,
Jul 17, 2015, 6:16:04 AM7/17/15
to tkh...@googlegroups.com

On Tuesday, June 30, 2015 7:28 AM, Ole Streicher <deb...@liska.ath.cx> wrote:

> If anyone else has a bugfix, I will happily include it.


It might be worth checking the tkhtml in BRL-CAD. Sourceforge is down at the moment, but once it's back up our version is in src/other/tkhtml in the trunk svn branch.

Cheers,
CY
Reply all
Reply to author
Forward
0 new messages