edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] jex debugger prints return values
@ 2015-09-29 17:32 Karl Dahlke
  2015-09-29 20:57 ` Kevin Carhart
  2015-09-30  9:37 ` [Edbrowse-dev] Stack smashing detected in jsrt Kevin Carhart
  0 siblings, 2 replies; 7+ messages in thread
From: Karl Dahlke @ 2015-09-29 17:32 UTC (permalink / raw)
  To: Edbrowse-dev

I can't believe how useful this feature is!
Been using it to find and fix other problems.
But as promised, I got tired of typing alert all the time,
so my latest push makes it more like a js shell.
If the expression has a return value, it is printed.
No need for alert.
Bear in mind, an expression like
c = 3
has a return value, namely 3.
It's just like other computer languages.

Karl Dahlke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Edbrowse-dev] jex debugger prints return values
  2015-09-29 17:32 [Edbrowse-dev] jex debugger prints return values Karl Dahlke
@ 2015-09-29 20:57 ` Kevin Carhart
  2015-09-30  9:37 ` [Edbrowse-dev] Stack smashing detected in jsrt Kevin Carhart
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Carhart @ 2015-09-29 20:57 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev



On Tue, 29 Sep 2015, Karl Dahlke wrote:

> I can't believe how useful this feature is!
> Been using it to find and fix other problems.

Yesss!!  That's what I anticipated - that it might
become..... "a way of life" if you will.  Like
"stepping" and "placing a watch" and "breakpoints",
when I compile an edbrowse without it, I have
itchy fingers.

Nice when something like that is also very little code.
Hooray!

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Edbrowse-dev] Stack smashing detected in jsrt
  2015-09-29 17:32 [Edbrowse-dev] jex debugger prints return values Karl Dahlke
  2015-09-29 20:57 ` Kevin Carhart
@ 2015-09-30  9:37 ` Kevin Carhart
  2015-09-30 10:27   ` Karl Dahlke
  1 sibling, 1 reply; 7+ messages in thread
From: Kevin Carhart @ 2015-09-30  9:37 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev



FYI, I get an error message of "stack smashing detected"
when I compile the latest and then run the jsrt, on
ubuntu.  Here are the recent messages from just before
it happens.  Maybe it doesn't represent anything real,
or maybe it does, in which case we can talk about it more.


testing selector colors 536 5
> get [0]
js read 72
js read 14
< 0x7f5aa31642b0
> get defaultSelected
js read 72
js read 1
< 0
> get selected
js read 72
js read 1
< 0
> get text
js read 72
js read 3
< red
> get value
js read 72
js read 1
< r
> get [1]
js read 72
js read 14
< 0x7f5aa3164310
> get defaultSelected
js read 72
js read 1
< 0
> get selected
js read 72
js read 1
< 0
> get text
js read 72
js read 6
< orange
> get value
js read 72
js read 1
< o
> get [2]
js read 72
js read 14
< 0x7f5aa3164370
> get defaultSelected
js read 72
js read 1
< 0
> get selected
js read 72
js read 1
< 0
> get text
js read 72
js read 6
< yellow
> get value
js read 72
js read 1
< y
> get [3]
js read 72
js read 14
< 0x7f5aa31643d0
> get defaultSelected
js read 72
js read 1
< 1
> get selected
js read 72
js read 1
< 1
> get text
js read 72
js read 5
< green
> get value
js read 72
js read 1
< g
> get [4]
js read 72
js read 14
< 0x7f5aa3164430
> get defaultSelected
js read 72
js read 1
< 1
> get selected
js read 72
js read 1
< 1
> get text
js read 72
js read 5
< white
> get value
js read 72
js read 1
< w
> call onload(0)
js read 72
< ok
> call onload(0)
doc loader attached
js read 72
< ok
> call onload(0)
body loading
js read 72
< ok
> call onload(0)
form questionnaire loading
js read 72
js read 151
< side effects
l{a|0x7f5aa313cdf0,body 0x7f5aa31840c0,text 0x0, `~@}
l{c|0x7f5aa3184100,script 0x0, 0x0, `~@}
l{a|0x7f5aa313cdf0,body 0x7f5aa3184100,script 0x0, `~@}
< ok
*** stack smashing detected ***: edbrowse terminated
Aborted (core dumped)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Edbrowse-dev] Stack smashing detected in jsrt
  2015-09-30  9:37 ` [Edbrowse-dev] Stack smashing detected in jsrt Kevin Carhart
@ 2015-09-30 10:27   ` Karl Dahlke
  2015-09-30 20:43     ` Kevin Carhart
  2015-10-01 23:25     ` Kevin Carhart
  0 siblings, 2 replies; 7+ messages in thread
From: Karl Dahlke @ 2015-09-30 10:27 UTC (permalink / raw)
  To: Edbrowse-dev

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

This is a serious problem, though it doesn't happen to me, so not sure how to proceed.
The next line in the log should have been:

Generated {<P>Onclose <A href='javascript:document.body.onunload()'>Body</A><br><P>Onclose <A href='javascript:document.forms[0].onunload()'>Form</A><br></body>

somewhere between finishing the selector audit in rebuildSelectors()
and managing the document.write string, something goes wrong,
or perhaps went wrong earlier and is detected at this point.

Karl Dahlke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Edbrowse-dev] Stack smashing detected in jsrt
  2015-09-30 10:27   ` Karl Dahlke
@ 2015-09-30 20:43     ` Kevin Carhart
  2015-09-30 23:13       ` Karl Dahlke
  2015-10-01 23:25     ` Kevin Carhart
  1 sibling, 1 reply; 7+ messages in thread
From: Kevin Carhart @ 2015-09-30 20:43 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev



Yes, I'll do this a little later and send more information.


On Wed, 30 Sep 2015, Karl Dahlke wrote:

> This is a serious problem, though it doesn't happen to me, so not sure how to proceed.
> The next line in the log should have been:
>
> Generated {<P>Onclose <A href='javascript:document.body.onunload()'>Body</A><br><P>Onclose <A href='javascript:document.forms[0].onunload()'>Form</A><br></body>
>
> somewhere between finishing the selector audit in rebuildSelectors()
> and managing the document.write string, something goes wrong,
> or perhaps went wrong earlier and is detected at this point.
>
> Karl Dahlke
>

--------
Kevin Carhart * 415 225 5306 * The Ten Ninety Nihilists

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Edbrowse-dev]  Stack smashing detected in jsrt
  2015-09-30 20:43     ` Kevin Carhart
@ 2015-09-30 23:13       ` Karl Dahlke
  0 siblings, 0 replies; 7+ messages in thread
From: Karl Dahlke @ 2015-09-30 23:13 UTC (permalink / raw)
  To: Edbrowse-dev

That should fix it.

Karl Dahlke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Edbrowse-dev] Stack smashing detected in jsrt
  2015-09-30 10:27   ` Karl Dahlke
  2015-09-30 20:43     ` Kevin Carhart
@ 2015-10-01 23:25     ` Kevin Carhart
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Carhart @ 2015-10-01 23:25 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev



Here is some more on jsrt crashing on Ubuntu.
I can even make this happen on a tiny, 6-line file, which is rather 
strange.
I kept taking things away and got it down to this.


<html>
<body>
<form onunload>
</form>
</body>
</html>

OR

<html>
<body>
<form onunload=formUnload(this.name)>
</form>
</body>
</html>

Regardless of whether or not there is a formUnload routine to go to.

Backtrace is included below.

In htmlParse, it is calling runOnload
The crash happens in runOnload.
I wasn't able to add any printf's to runOnload.
I think it's happening immediately upon entry into runOnload.

thanks
Kevin

xxxxxx

(gdb) bt
#0  0x00007fd8bd133f77 in __GI_raise (sig=sig@entry=6)
     at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007fd8bd1375e8 in __GI_abort () at abort.c:90
#2  0x00007fd8bd1714fb in __libc_message (do_abort=do_abort@entry=1,
     fmt=fmt@entry=0x7fd8bd282f10 "*** %s ***: %s terminated\n")
     at ../sysdeps/unix/sysv/linux/libc_fatal.c:199
#3  0x00007fd8bd20f08c in __GI___fortify_fail (msg=<optimized out>,
     msg@entry=0x7fd8bd282ef8 "stack smashing detected") at 
fortify_fail.c:37
#4  0x00007fd8bd20f030 in __stack_chk_fail () at stack_chk_fail.c:28
#5  0x000000000042dc69 in runOnload () at html.c:2008
#6  0x000000000042a805 in htmlParse (buf=0x243cb20 "", remote=0) at 
html.c:711
#7  0x00000000004152a8 in browseCurrentBuffer () at buffers.c:5328
#8  0x000000000041459a in runCommand (line=0x68e520 <line2.8236> 
"jsrt_crash")
     at buffers.c:4992
#9  0x0000000000414cee in edbrowseCommand (
     line=0x68c6a0 <line.8800> "b jsrt_crash", script=0 '\000')
     at buffers.c:5164
#10 0x0000000000406988 in main (argc=0, argv=0x7ffe2a9f2f10) at 
main.c:1364


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-01 23:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-29 17:32 [Edbrowse-dev] jex debugger prints return values Karl Dahlke
2015-09-29 20:57 ` Kevin Carhart
2015-09-30  9:37 ` [Edbrowse-dev] Stack smashing detected in jsrt Kevin Carhart
2015-09-30 10:27   ` Karl Dahlke
2015-09-30 20:43     ` Kevin Carhart
2015-09-30 23:13       ` Karl Dahlke
2015-10-01 23:25     ` Kevin Carhart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).