
| Key: |
VWR-1322
|
| Type: |
Bug
|
| Status: |
Fix Pending
|
| Priority: |
Normal
|
| Assignee: |
Unassigned
|
| Reporter: |
Dale Glass
|
| Votes: |
1
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
| Last Triaged: |
26/Mar/09 01:51 PM
|
| Linden Lab Issue ID: |
DEV-24157
|
| Linden Lab Internal Branch: |
viewer/viewer_1-23
|
When uploading a 16x16 texture, the viewer crashes with "LLImageBase::allocateData called with bad dimentions: 0x0x0"
This seems to be a bug in OpenJPEG with handling small images. The same image, when rescaled to 32x32 uploads fine.
Backtrace:
#0 0x0925e64c in LLError::crashAndLoop (message=@0xff94337c)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llcommon/llerror.cpp:1063
#1 0x08eb35fc in errorCallback (error_string=@0xff94337c)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:6610
#2 0x0926029c in LLError::Log::flush (out=0x9d55d00, site=@0x9bea400)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llcommon/llerror.cpp:991
#3 0x08fc6e34 in LLImageBase::allocateData (this=0xd017bd0, size=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimage.cpp:134
#4 0x08fc70f2 in LLImageFormatted::allocateData (this=0xd017bd0, size=-789)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimage.cpp:1383
#5 0x08fc3760 in LLImageFormatted::copyData (this=0xd017bd0, data=0x1aa93000 "ÿOÿQ", size=-789)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimage.cpp:1428
#6 0x08fd17ac in LLImageJ2COJ::encodeImpl (this=0x14a68770, base=@0xd017bd0, raw_image=@0xceb67c8, comment_text=0x0, encode_time=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimagej2coj/llimagej2coj.cpp:302
#7 0x08fca38a in LLImageJ2C::encode (this=0xd017bd0, raw_imagep=0xceb67c8, comment_text=0x0, encode_time=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimagej2c.cpp:275
#8 0x08fca3eb in LLImageJ2C::encode (this=0xd017bd0, raw_imagep=0xceb67c8, encode_time=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimagej2c.cpp:268
#9 0x08ba3ea7 in LLViewerImageList::convertToUploadFile (raw_image=@0xff946f70)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewerimagelist.cpp:1113
#10 0x08ba4372 in LLViewerImageList::createUploadFile (filename=@0x11bd3b20, out_filename=@0xff9573d0, codec=4 '\004')
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewerimagelist.cpp:1088
#11 0x08c37dc3 in upload_new_resource (src_filename=@0x11bd3b20, name=@0xff957640, desc=@0xff957634, compression_info=0,
destination_folder_type=LLAssetType::AT_NONE, inv_type=LLInventoryType::IT_NONE, next_owner_perm=0, display_name=@0x99c1608, callback=0, userdata=0x0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewermenufile.cpp:537
#12 0x083e8e63 in LLFloaterNameDesc::onBtnOK (userdata=0x11bd38c0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llfloaternamedesc.cpp:215
#13 0x0904503b in LLButton::handleMouseUp (this=0xb8629c0, x=70, y=12, mask=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llui/llbutton.cpp:360
#14 0x08d24901 in LLViewerWindow::handleMouseUp (this=0x9d477e0, window=0x9e29d80, pos=@0xff957848, mask=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewerwindow.cpp:841
#15 0x08f6c70d in LLWindowSDL::gatherInput (this=0x9e29d80)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llwindow/llwindowsdl.cpp:2074
#16 0x08ec303c in check_for_events () at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:1775
#17 0x08eccf3b in main_loop () at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:1800
#18 0x08ed2176 in main (argc=1, argv=0xff958104) at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:1704
Debugging the viewer revealed that the crash happens because LLImageBase tries to allocate memory for a 0x0 texture. This happens because the size argument to the function is negative. The function then tries using mWidth and mHeight, which are 0, and crashes.
The size parameter comes from LLImageJ2COJ::encodeImpl, from llimagej2coj/llimagej2coj.cpp line 300:
codestream_length = cio_tell(cio);
base.copyData(cio->buffer, codestream_length);
cio_tell for some reason returns a negative number (-789). According to the OpenJPEG documentation, cio_tell returns the position in a byte stream, where a negative number makes no sense.
The image that causes the crash is attached
|
|
Description
|
When uploading a 16x16 texture, the viewer crashes with "LLImageBase::allocateData called with bad dimentions: 0x0x0"
This seems to be a bug in OpenJPEG with handling small images. The same image, when rescaled to 32x32 uploads fine.
Backtrace:
#0 0x0925e64c in LLError::crashAndLoop (message=@0xff94337c)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llcommon/llerror.cpp:1063
#1 0x08eb35fc in errorCallback (error_string=@0xff94337c)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:6610
#2 0x0926029c in LLError::Log::flush (out=0x9d55d00, site=@0x9bea400)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llcommon/llerror.cpp:991
#3 0x08fc6e34 in LLImageBase::allocateData (this=0xd017bd0, size=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimage.cpp:134
#4 0x08fc70f2 in LLImageFormatted::allocateData (this=0xd017bd0, size=-789)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimage.cpp:1383
#5 0x08fc3760 in LLImageFormatted::copyData (this=0xd017bd0, data=0x1aa93000 "ÿOÿQ", size=-789)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimage.cpp:1428
#6 0x08fd17ac in LLImageJ2COJ::encodeImpl (this=0x14a68770, base=@0xd017bd0, raw_image=@0xceb67c8, comment_text=0x0, encode_time=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimagej2coj/llimagej2coj.cpp:302
#7 0x08fca38a in LLImageJ2C::encode (this=0xd017bd0, raw_imagep=0xceb67c8, comment_text=0x0, encode_time=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimagej2c.cpp:275
#8 0x08fca3eb in LLImageJ2C::encode (this=0xd017bd0, raw_imagep=0xceb67c8, encode_time=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llimage/llimagej2c.cpp:268
#9 0x08ba3ea7 in LLViewerImageList::convertToUploadFile (raw_image=@0xff946f70)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewerimagelist.cpp:1113
#10 0x08ba4372 in LLViewerImageList::createUploadFile (filename=@0x11bd3b20, out_filename=@0xff9573d0, codec=4 '\004')
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewerimagelist.cpp:1088
#11 0x08c37dc3 in upload_new_resource (src_filename=@0x11bd3b20, name=@0xff957640, desc=@0xff957634, compression_info=0,
destination_folder_type=LLAssetType::AT_NONE, inv_type=LLInventoryType::IT_NONE, next_owner_perm=0, display_name=@0x99c1608, callback=0, userdata=0x0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewermenufile.cpp:537
#12 0x083e8e63 in LLFloaterNameDesc::onBtnOK (userdata=0x11bd38c0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llfloaternamedesc.cpp:215
#13 0x0904503b in LLButton::handleMouseUp (this=0xb8629c0, x=70, y=12, mask=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llui/llbutton.cpp:360
#14 0x08d24901 in LLViewerWindow::handleMouseUp (this=0x9d477e0, window=0x9e29d80, pos=@0xff957848, mask=0)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/llviewerwindow.cpp:841
#15 0x08f6c70d in LLWindowSDL::gatherInput (this=0x9e29d80)
at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/llwindow/llwindowsdl.cpp:2074
#16 0x08ec303c in check_for_events () at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:1775
#17 0x08eccf3b in main_loop () at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:1800
#18 0x08ed2176 in main (argc=1, argv=0xff958104) at /home/dale/tmp/home/dale/svk/avatarscanner/indra/i686-linux-client-releasenoopt/newview/viewer.cpp:1704
Debugging the viewer revealed that the crash happens because LLImageBase tries to allocate memory for a 0x0 texture. This happens because the size argument to the function is negative. The function then tries using mWidth and mHeight, which are 0, and crashes.
The size parameter comes from LLImageJ2COJ::encodeImpl, from llimagej2coj/llimagej2coj.cpp line 300:
codestream_length = cio_tell(cio);
base.copyData(cio->buffer, codestream_length);
cio_tell for some reason returns a negative number (-789). According to the OpenJPEG documentation, cio_tell returns the position in a byte stream, where a negative number makes no sense.
The image that causes the crash is attached |
Show » |
|
Error and stack trace:
2007-06-26T05:10:50Z ERROR: LLImageBase::allocateData called with bad dimentions: 16x16x0
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1105209680 (LWP 2938)]
LLError::crashAndLoop (message=@0x41dffd00) at x86_64-linux-client-release/llcommon/llerror.cpp:1063
1063 *crash = 0;
(gdb) bt
#0 LLError::crashAndLoop (message=@0x41dffd00) at x86_64-linux-client-release/llcommon/llerror.cpp:1063
#1 0x000000000152b331 in LLError::Log::flush (out=<value optimized out>, site=@0x2016d40) at x86_64-linux-client-release/llcommon/llerror.cpp:991
#2 0x00000000012d14b8 in LLImageBase::allocateData (this=0xa06a900, size=0) at x86_64-linux-client-release/llimage/llimage.cpp:134
#3 0x00000000012d1799 in LLImageRaw::allocateData (this=0x41dffd00, size=68893904) at x86_64-linux-client-release/llimage/llimage.cpp:242
#4 0x00000000012cef9b in LLImageRaw::resize (this=0xa06a900, width=16, height=16, components=0 '\0')
at x86_64-linux-client-release/llimage/llimage.cpp:272
#5 0x00000000012de6a8 in LLImageJ2COJ::decodeImpl (this=<value optimized out>, base=<value optimized out>, raw_image=@0xa06a900,
decode_time=<value optimized out>, first_channel=4, max_channel_count=4) at x86_64-linux-client-release/llimagej2coj/llimagej2coj.cpp:169
#6 0x00000000012d6218 in LLImageJ2C::decode (this=0x889b9f0, raw_imagep=0xa06a900, decode_time=0.100000001, first_channel=4, max_channel_count=4)
at x86_64-linux-client-release/llimage/llimagej2c.cpp:248
#7 0x00000000012ddef0 in LLImageWorker::doWork (this=0x64e8c30, param=4) at x86_64-linux-client-release/llimage/llimageworker.cpp:118
#8 0x0000000001556ebf in LLWorkerThread::WorkRequest::processRequest (this=0x587e890)
at x86_64-linux-client-release/llcommon/llworkerthread.cpp:161
#9 0x00000000015376ff in LLQueuedThread::processNextRequest (this=0x2580d60) at x86_64-linux-client-release/llcommon/llqueuedthread.cpp:419
#10 0x00000000015379e0 in LLQueuedThread::run (this=0x2580d60) at x86_64-linux-client-release/llcommon/llqueuedthread.cpp:491
#11 0x000000000154fd69 in LLThread::staticRun (apr_threadp=<value optimized out>, datap=0x41b3cd0)
at x86_64-linux-client-release/llcommon/llthread.cpp:70
#12 0x00000030ebe061c5 in start_thread () from /lib64/libpthread.so.0
#13 0x00000030e9ed062d in clone () from /lib64/libc.so.6