Bug 705816 - couchjs segfaults
Summary: couchjs segfaults
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: couchdb
Version: 15
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Peter Lemenkov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-18 15:09 UTC by Thomas Vander Stichele
Modified: 2011-05-31 07:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 709251 (view as bug list)
Environment:
Last Closed: 2011-05-31 06:58:34 UTC


Attachments (Terms of Use)
sample input (8.93 KB, application/octet-stream)
2011-05-18 15:09 UTC, Thomas Vander Stichele
no flags Details
latest js 1.8.5 patch (12.80 KB, patch)
2011-05-30 12:42 UTC, Martin Stransky
no flags Details | Diff

Description Thomas Vander Stichele 2011-05-18 15:09:19 UTC
Description of problem:

https://issues.apache.org/jira/browse/COUCHDB-1169

Version-Release number of selected component (if applicable):

1.0.2-2


How reproducible:

always

Steps to Reproduce:
1. download view.input
2. couchjs /usr/share/couchdb/server/main.js < view.input 
3.
  
Actual results:

segfault

Expected results:

it should work

Additional info:

Comment 1 Thomas Vander Stichele 2011-05-18 15:09:59 UTC
Created attachment 499620 [details]
sample input

Comment 2 Thomas Vander Stichele 2011-05-18 15:13:30 UTC
Rolling back to couchdb-1.0.2-1 and js-1.70-13 makes the example work.

I think the update to js 1.85 was too hasty.

Comment 3 Peter Lemenkov 2011-05-18 15:52:52 UTC
(In reply to comment #2)
> Rolling back to couchdb-1.0.2-1 and js-1.70-13 makes the example work.
> 
> I think the update to js 1.85 was too hasty.

Yes, indeed - that was quite unwise move. Anyway I'm working on fixing this right now.

As a temporary solution - you'd better to stay with js-1.70 until I do something with this mess.

Comment 4 Pavel Alexeev 2011-05-18 19:24:07 UTC
>Yes, indeed - that was quite unwise move. Anyway I'm working on fixing this
right now.
Indeed. My suggestion about provide it as separate version stimulation with 1-70 was ignored.

Comment 5 Martin Stransky 2011-05-19 13:21:36 UTC
It would be wise to add some tests to test/etap. The patch we provided for new js 1.8.5 passes all tests there.

Comment 6 Peter Lemenkov 2011-05-19 13:30:46 UTC
(In reply to comment #5)
> It would be wise to add some tests to test/etap. The patch we provided for new
> js 1.8.5 passes all tests there.

Yes, sure.

Unfortunately there is also JS test set (called Futon) which could be run only in a web-browser (Firefox). If someone is using a fresh couchdb installation (empty /var/lib/couchdb and untouched /etc/couchdb/* ) then he should type

# /etc/init.d/couchdb start

and then open in a browser the following link:

http://127.0.0.1:5984/_utils/

Martin, could you please help me debugging this? Btw I almost isolated issue in Rawhide (couchdb-1.3.0-0.1). Rawhide's couchdb build fails to pass the only single test case in Futon after a fresh installation as described above - I hope this is exactly the same what causes failures in F-15.

Comment 7 Martin Stransky 2011-05-19 13:49:11 UTC
Ahh, okay. We didn't know about the Futon test suite, will check it.

The F15 failure is caused by NULL pointer crash in js_XDRFunctionObject() (GET_FUNCTION_PRIVATE(cx, *objp) is NULL there). I guess it's because of some wrong object definition or so, I'm looking at it right now. A debug version of js engine is pretty helpful here.

Comment 8 Martin Stransky 2011-05-25 15:43:01 UTC
Looks like a bug in js. An emitted object is marked as a function, but it is a common object. We need to provide a testcase w/o couchdb.

Comment 9 Martin Stransky 2011-05-27 15:51:09 UTC
It crashes because sandbox (evalcx() function) uses JSOPTION_COMPILE_N_GO option for script evaluation and the script is not supposed to be shared between contexts/global objects. It's new js 1.8.5 feature, will provide a patch for it.

Comment 10 Thomas Vander Stichele 2011-05-30 11:39:19 UTC
FWIW, this is breaking upgrades of all other packages:

[root@level ~]# yum upgrade
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Setting up Upgrade Process
Resolving Dependencies
--> Running transaction check
---> Package couchdb.x86_64 0:1.0.2-1.fc15 will be updated
---> Package couchdb.x86_64 0:1.0.2-5.fc15 will be an update
--> Processing Dependency: libmozjs185.so.1.0()(64bit) for package: couchdb-1.0.2-5.fc15.x86_64
--> Finished Dependency Resolution
Error: Package: couchdb-1.0.2-5.fc15.x86_64 (updates)
           Requires: libmozjs185.so.1.0()(64bit)
 You could try using --skip-broken to work around the problem

Comment 11 Martin Stransky 2011-05-30 12:41:11 UTC
Peter, can you test this package? 

http://koji.fedoraproject.org/koji/taskinfo?taskID=3100196

It should fix the crash. Unfortunately I can't test it, my system is completely broken and the package does not even build locally.

Comment 12 Martin Stransky 2011-05-30 12:42:14 UTC
Created attachment 501791 [details]
latest js 1.8.5 patch

Comment 13 Martin Stransky 2011-05-30 13:13:10 UTC
Peter, there's another couchdb bug (packaging one?). If you have installed a system couchdb package and you are building another one locally, tests performed by rpm package are run against the system couchdb, not the recently built one. So the tests can fail when the built version is fixed.

Comment 14 Peter Lemenkov 2011-05-30 13:53:41 UTC
Great! It passed all tests finally:

http://koji.fedoraproject.org/koji/taskinfo?taskID=3100311

(In reply to comment #13)
> Peter, there's another couchdb bug (packaging one?). If you have installed a
> system couchdb package and you are building another one locally, tests
> performed by rpm package are run against the system couchdb, not the recently
> built one. So the tests can fail when the built version is fixed.

Yes, I'm aware of it. I didn't try to fix it yet but I will.

Comment 15 Fedora Update System 2011-05-30 14:06:59 UTC
couchdb-1.0.2-6.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/couchdb-1.0.2-6.fc15

Comment 16 Martin Stransky 2011-05-30 14:34:38 UTC
Please remove the package from update queue, I added it to the js-1.8.5 update.

Comment 17 Peter Lemenkov 2011-05-30 14:45:19 UTC
(In reply to comment #16)
> Please remove the package from update queue, I added it to the js-1.8.5 update.

Done.


Note You need to log in before you can comment on or make changes to this bug.