wesgarland/gpsee

core dump on exception exit when attempting to redefine 'module'

Closed this issue · 9 comments

Hello,

a core dump occurs when something like the following occurs:

QUnit = require('..../qunit.js').QUnit;
module = QUnit.module;
module('foo');

I'm not sure if that will do it however, I can't quite make a reduced test 
case.  However it is 100% 
reproducable.  I can make a debug version of gpsee and re-core, if this is not 
enough detail.

env-js/test/specs/console/spec.js:6: module is not a function

    in env-js/test/specs/console/spec.js at 6 

gsr(35682,0x7fff70877be0) malloc: *** error for object 0x1003418e0: pointer 
being freed was 
not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap


#0  0x00007fff852a9886 in kill ()
#1  0x00007fff85261a75 in free ()
#2  0x000000010020c6a1 in gpsee_reportUncaughtException (cx=0x101000000, 
exval=4324975040, dumpStack=1) at gpsee_util.c:744
#3  0x0000000100002026 in prmain (argc=4, argv=0x7fff5fbff680) at gsr.c:711
#4  0x00000001001d3d8b in PR_Initialize ()
#5  0x00000001000020ed in main (argc=4, argv=0x7fff5fbff680) at gsr.c:732

Original issue reported on code.google.com by nickgsup...@gmail.com on 4 Apr 2010 at 4:49

I take it '..../qunit.js' is a typo?

Where can I get the code to repro?

Original comment by wes%page...@gtempaccount.com on 4 Apr 2010 at 4:25

  • Added labels: Milestone-Release0.2, Priority-High
  • Removed labels: Priority-Medium
Ok, attached should be a tar.gz file.

tar -xzvf dumper.tar.gz
gsr -f dumper/consoletest.js

BOOM

it's maybe 10 lines of code total, and it look like it involves gpsee.include.



// This throws an error but no core dump                                        

//module('coredump');                                                           


// THIS CORE DUMPS                                                              

require('gpsee').include('dumper/spec.js');

spec.js is one line "module('anything');"

Original comment by nickgsup...@gmail.com on 4 Apr 2010 at 7:29

Attachments:

I'm having a hard time reproducing your results. First I had to change 
GPSEE_PATH so
that dumper/*.js would work with require(). With that change I only got this 
output
which tells me I still have more work to do to get to where you are:

JS strict warning #162 in qunit.js at line 396 - reference to undefined property
window.location
JS strict warning #162 in qunit.js at line 493 - reference to undefined property
window.jQuery
JS strict warning #162 in qunit.js at line 310 - reference to undefined property
window.setTimeout

Uncaught exception in dumper/spec.js:2: module is not a function

I'd guess I'm missing env.js, but you don't seem to include it anywhere. 
Ohhh... are
you running this in Firefox?

Original comment by donny.vi...@gmail.com on 5 Apr 2010 at 2:18

nick: can you post

 - exact command line to launch
 - version of envjs etc
 - hg revision for tracemonkey
 - hg revision for gpsee

Original comment by wes%page...@gtempaccount.com on 5 Apr 2010 at 2:41


 rebuilding on new machine, then I will tell all!

--nickg

Original comment by nickgsup...@gmail.com on 5 Apr 2010 at 2:55

and of course, at work I cannot reproduce it.

When I'm home I will do a wipe and redo and report back.  I was very 
consistently getting the core dump over the 
weekend.

sigh.

Original comment by nickgsup...@gmail.com on 5 Apr 2010 at 3:00

sorry no update on reproducing this yet.... will try again tonight.

Original comment by nickgsup...@gmail.com on 7 Apr 2010 at 3:08

any luck? maybe we should chalk this one up to pebkac?

Original comment by aberande...@gmail.com on 13 Apr 2010 at 12:11

Marking Invalid.  Suspect something like out-of-sync DSOs.

Please re-open if this re-occurs.

Original comment by wes%page...@gtempaccount.com on 7 May 2010 at 10:51

  • Changed state: Invalid