keeleysam / tenfourfox

Automatically exported from code.google.com/p/tenfourfox
0 stars 0 forks source link

Snappy Compress is endian-challenged #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Uplift from 
http://tenfourfox.tenderapp.com/discussions/problems/350-unable-to-load-kindle-c
loud-reader-on-tenfourfox-17-19

On 20 internal, Kindle Cloud DCHECKs(), and probably has DCHECKed on all 17+ 
debug versions except we never looked at it before. The crash is suppressed in 
17+ but the database can't store, hence the issue reported by the user. Mozilla 
did not use snappy compression in 10, which is on its face endian wrong and 
explains why 10.x is unaffected. Backtrace from debugger:

Redirecting call to abort() to mozalloc_abort

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
[Switching to process 4464 thread 0xce4b]
0x00039e28 in mozalloc_abort (msg=<value temporarily unavailable, due to 
optimizations>) at 
/Volumes/BruceDeuce/src/mozilla-20b/memory/mozalloc/mozalloc_abort.cpp:30
30          MOZ_CRASH();
(gdb) bt
#0  0x00039e28 in mozalloc_abort (msg=<value temporarily unavailable, due to 
optimizations>) at 
/Volumes/BruceDeuce/src/mozilla-20b/memory/mozalloc/mozalloc_abort.cpp:30
#1  0x07c77b50 in snappy::LogMessageCrash::~LogMessageCrash () at 
/Volumes/BruceDeuce/src/mozilla-20b/other-licenses/snappy/src/snappy.cc:54
#2  0x07c77dc0 in snappy::internal::CompressFragment (input=0x3272f400 "", 
input_size=0, op=0x3e8 <Address 0x3e8 out of bounds>, table=0x1b1a7000, 
table_size=1) at 
/Volumes/BruceDeuce/src/mozilla-20b/other-licenses/snappy/src/snappy.cc:200
#3  0x07c78754 in snappy::Compress (reader=0xf11f1840, writer=0xf11f1838) at 
/Volumes/BruceDeuce/src/mozilla-20b/other-licenses/snappy/src/snappy.cc:892
#4  0x07c79230 in RawCompress (input=<value temporarily unavailable, due to 
optimizations>, input_length=<value temporarily unavailable, due to 
optimizations>, compressed=<value temporarily unavailable, due to 
optimizations>, compressed_length=0xf11f18c4) at 
/Volumes/BruceDeuce/src/mozilla-20b/other-licenses/snappy/src/snappy.cc:1050
#5  0x06994700 in DoDatabaseWork (this=0x32934310, aConnection=0x2e4ee500) at 
/Volumes/BruceDeuce/src/mozilla-20b/dom/indexedDB/IDBObjectStore.cpp:2871
#6  0x0694c814 in mozilla::dom::indexedDB::AsyncConnectionHelper::Run 
(this=0x32934310) at 
/Volumes/BruceDeuce/src/mozilla-20b/dom/indexedDB/AsyncConnectionHelper.cpp:302
#7  0x069dbb04 in 
mozilla::dom::indexedDB::TransactionThreadPool::TransactionQueue::Run 
(this=0x3332f120) at 
/Volumes/BruceDeuce/src/mozilla-20b/dom/indexedDB/TransactionThreadPool.cpp:639
#8  0x07bec1b4 in nsThreadPool::Run (this=0xf11f1b38) at 
/Volumes/BruceDeuce/src/mozilla-20b/xpcom/threads/nsThreadPool.cpp:194
#9  0x07be6130 in nsThread::ProcessNextEvent (this=0x0, mayWait=<value 
temporarily unavailable, due to optimizations>, result=0x0) at 
/Volumes/BruceDeuce/src/mozilla-20b/xpcom/threads/nsThread.cpp:627
#10 0x07b4a8b0 in NS_ProcessNextEvent_P (thread=<value temporarily unavailable, 
due to optimizations>, mayWait=<value temporarily unavailable, due to 
optimizations>) at 
/Volumes/BruceDeuce/src/mozilla-20b/obj-ff-dbg/xpcom/build/nsThreadUtils.cpp:238
#11 0x07be5960 in nsThread::ThreadFunc (arg=0x302dadc0) at 
/Volumes/BruceDeuce/src/mozilla-20b/xpcom/threads/nsThread.cpp:265
#12 0x0062cbd4 in _pt_root (arg=0x362eb5d0) at 
/Volumes/BruceDeuce/src/mozilla-20b/nsprpub/pr/src/pthreads/ptthread.c:156
#13 0x9002b908 in _pthread_body ()

Because this affects all use of IndexedDB, other sites are probably affected as 
well, as well as other big-endian Firefox builds.

Original issue reported on code.google.com by classi...@floodgap.com on 10 Mar 2013 at 4:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Mozilla never added a bigendian switch to the code. A simple #define 
WORDS_BIGENDIAN to the .h fixes the crash and there are no more asserts. Kindle 
Cloud Reader now starts correctly in 20 without crashing.

This should be upstreamed; it's a big oversight.

Original comment by classi...@floodgap.com on 10 Mar 2013 at 6:07

GoogleCodeExporter commented 9 years ago
Able to purchase and read books in 20. This should apply cleanly to 17 as well.

Original comment by classi...@floodgap.com on 10 Mar 2013 at 6:21

GoogleCodeExporter commented 9 years ago
Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=849598

Original comment by classi...@floodgap.com on 10 Mar 2013 at 6:28

GoogleCodeExporter commented 9 years ago

Original comment by classi...@floodgap.com on 10 Mar 2013 at 11:54

GoogleCodeExporter commented 9 years ago
Landed in 20 and 17.0.5

Original comment by classi...@floodgap.com on 29 Mar 2013 at 10:02

GoogleCodeExporter commented 9 years ago
Verified fixed by original reporter.

Original comment by classi...@floodgap.com on 29 Mar 2013 at 11:31