我的 JVM 一直在 libzip.so 处持续不断地意外崩溃。我已经向 Oracle 提交了这个错误,但决定看看这里是否有人遇到过这个问题,如果有,你是如何处理的?这是一个正在运行的网络应用程序
Linux 2.6.34-gentoo-r6 #1 SMP Fri Sep 24 00:15:06 EDT 2010 i686 Intel(R) Xeon(R) CPU X5460 @ 3.16GHz GenuineIntel GNU/Linux
Tomcat 7.0.14 with jsvc.
我在下面包含了错误报告的快照。它是一个独立的服务器,没有人在运行时访问任何 tomcat 的 jar 或任何其他 jar,并且它不是从 NFS 托管的。
SIGSEGV (0xb) at pc=0xb6a72295, pid=19470, tid=241171312
JRE version: 6.0_29-b11 Java VM: Java HotSpot(TM) Server VM (20.4-b02 mixed mode linux-x86 )
Problematic frame: C [libzip.so+0x5295] double+0x45
If you would like to submit a bug report, please visit: http://java.sun.com/webapps/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug.
--------------- T H R E A D ---------------
Current thread (0x1044dc00): JavaThread "catalina-exec-177" daemon [_thread_in_native, id=21423, stack(0x0e5af000,0x0e600000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=2 (SEGV_ACCERR), si_addr=0x10dfc000
Registers: EAX=0x10d00018, EBX=0xb6a7dabc, ECX=0x000fbfe6, EDX=0x00000000 ESP=0x0e5febf0, EBP=0x0e5fec18, ESI=0x0eadc098, EDI=0x10458800 EIP=0xb6a72295, EFLAGS=0x00010246, CR2=0x10dfc000
Top of Stack: (sp=0x0e5febf0) 0x0e5febf0: b7869118 00000000 0ef2e648 b6a71216 0x0e5fec00: 13d1f690 10c492b0 0000bfe1 b6a7dabc 0x0e5fec10: 10458800 0ef2e648 0e5fec48 b6a7134d 0x0e5fec20: 10458800 00000004 0e5fec48 b77b727c 0x0e5fec30: 00000007 3d4af570 ffffffff b6a7dabc 0x0e5fec40: 31fe9ad0 1044dd20 0e5feca8 b6a6f585 0x0e5fec50: 0ef2e648 00000004 00000002 00000000 0x0e5fec60: 10b59810 3d5cff58 00000002 00004114
Instructions: (pc=0xb6a72295) 0xb6a72275: 05 01 00 00 0f 86 79 03 00 00 83 fa 02 76 41 8b 0xb6a72285: 57 40 8b 4f 50 8b 47 30 8b 77 38 d3 e2 8b 4f 64 0xb6a72295: 0f b6 44 01 02 31 c2 8b 47 4c 21 c2 8b 47 2c 89 0xb6a722a5: 57 40 21 c1 8b 47 3c 0f b7 04 50 89 45 f0 66 89
Register to memory mapping:
EAX=0x10d00018 is an unknown value EBX=0xb6a7dabc: <offset 0x10abc> in /usr/local/jdk1.6.0_29/jre/lib/i386/libzip.so at 0xb6a6d000 ECX=0x000fbfe6 is an unknown value EDX=0x00000000 is an unknown value ESP=0x0e5febf0 is pointing into the stack for thread: 0x1044dc00 EBP=0x0e5fec18 is pointing into the stack for thread: 0x1044dc00 ESI=0x0eadc098 is an unknown value EDI=0x10458800 is an unknown value
Stack: [0x0e5af000,0x0e600000], sp=0x0e5febf0, free space=318k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libzip.so+0x5295] double+0x45 C [libzip.so+0x434d] double+0x10d C [libzip.so+0x2585] Java_java_util_zip_Deflater_deflateBytes+0x355 J java.util.zip.Deflater.deflateBytes(J[BII)I
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J java.util.zip.Deflater.deflateBytes(J[BII)I J java.util.zip.GZIPOutputStream.finish()V J org.apache.coyote.http11.Http11NioProcessor.actionInternal(Lorg/apache/coyote/ActionCode;Ljava/lang/Object;)V J org.apache.coyote.http11.AbstractHttp11Processor.action(Lorg/apache/coyote/ActionCode;Ljava/lang/Object;)V J org.apache.catalina.connector.Response.finishResponse()V J org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V J org.apache.coyote.http11.Http11NioProcessor.process(Lorg/apache/tomcat/util/net/NioChannel;)Lorg/apache/tomcat/util/net/AbstractEndpoint$Handler$SocketState; J org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run()V J java.util.concurrent.ThreadPoolExecutor$Worker.run()V j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub
感谢任何提示。
最佳答案
这是补丁类,有点像夜间构建,需要对其进行测试。
JGZipOutputStream 类可以在这里找到:
Creating gzip file using jzlib
JZlib 可以在 http://www.jcraft.com/jzlib/
您可以通过在 Bootstrap 路径中添加一个小 jar (-Xbootclasspath/a:) 或解压/jar tomcat 本身来修补它。
额外的好处是 java 实现。实际上比 native 代码更快。
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.coyote.http11.filters;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.GZIPOutputStream;
import org.apache.coyote.OutputBuffer;
import org.apache.coyote.Response;
import org.apache.coyote.http11.OutputFilter;
import org.apache.tomcat.util.buf.ByteChunk;
import bestsss.util.JGZipOutputStream;
import com.jcraft.jzlib.JZlib;
/**
* Gzip output filter.
*
* @author Remy Maucherat
*/
public class GzipOutputFilter implements OutputFilter {
/**
* Logger.
*/
protected static org.apache.juli.logging.Log log =
org.apache.juli.logging.LogFactory.getLog(GzipOutputFilter.class);
// ----------------------------------------------------- Instance Variables
/**
* Next buffer in the pipeline.
*/
protected OutputBuffer buffer;
/**
* Compression output stream.
*/
protected OutputStream compressionStream = null;
/**
* Fake internal output stream.
*/
protected OutputStream fakeOutputStream = new FakeOutputStream();
// --------------------------------------------------- OutputBuffer Methods
/**
* Write some bytes.
*
* @return number of bytes written by the filter
*/
@Override
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
if (compressionStream == null) {
compressionStream = new JGZipOutputStream(fakeOutputStream, new byte[Math.min(32768, Math.max(2048, Integer.highestOneBit(chunk.getLength()-1)<<1))]);
}
compressionStream.write(chunk.getBytes(), chunk.getStart(),
chunk.getLength());
return chunk.getLength();
}
@Override
public long getBytesWritten() {
return buffer.getBytesWritten();
}
// --------------------------------------------------- OutputFilter Methods
/**
* Added to allow flushing to happen for the gzip'ed outputstream
*/
public void flush() {
if (compressionStream != null) {
try {
if (log.isDebugEnabled()) {
log.debug("Flushing the compression stream!");
}
compressionStream.flush();
} catch (IOException e) {
if (log.isDebugEnabled()) {
log.debug("Ignored exception while flushing gzip filter", e);
}
}
}
}
/**
* Some filters need additional parameters from the response. All the
* necessary reading can occur in that method, as this method is called
* after the response header processing is complete.
*/
@Override
public void setResponse(Response response) {
// NOOP: No need for parameters from response in this filter
}
/**
* Set the next buffer in the filter pipeline.
*/
@Override
public void setBuffer(OutputBuffer buffer) {
this.buffer = buffer;
}
/**
* End the current request. It is acceptable to write extra bytes using
* buffer.doWrite during the execution of this method.
*/
@Override
public long end()
throws IOException {
if (compressionStream == null) {
compressionStream = new JGZipOutputStream(fakeOutputStream, new byte[128]);
}
compressionStream.close();
return ((OutputFilter) buffer).end();
}
/**
* Make the filter ready to process the next request.
*/
@Override
public void recycle() {
// Set compression stream to null
compressionStream = null;
}
// ------------------------------------------- FakeOutputStream Inner Class
protected class FakeOutputStream
extends OutputStream {
protected ByteChunk outputChunk = new ByteChunk();
protected byte[] singleByteBuffer = new byte[1];
@Override
public void write(int b)
throws IOException {
// Shouldn't get used for good performance, but is needed for
// compatibility with Sun JDK 1.4.0
singleByteBuffer[0] = (byte) (b & 0xff);
outputChunk.setBytes(singleByteBuffer, 0, 1);
buffer.doWrite(outputChunk, null);
}
@Override
public void write(byte[] b, int off, int len)
throws IOException {
outputChunk.setBytes(b, off, len);
buffer.doWrite(outputChunk, null);
}
@Override
public void flush() throws IOException {/*NOOP*/}
@Override
public void close() throws IOException {/*NOOP*/}
}
}
关于crash - JVM 在 libzip.so 处崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8405641/
为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar
当我在Rails控制台中按向上或向左箭头时,出现此错误:irb(main):001:0>/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in`blockin_rl_dispatch_subseq':invalidbytesequenceinUTF-8(ArgumentError)我使用rvm来管理我的ruby安装。我正在使用=>ruby-2.0.0-p247[x86_64]我使用bundle来管理我的gem,并且我有rb-readline(0.4.2)(人们推荐的最少
代码:threads=[]Thread.abort_on_exception=truebegin#throwexceptionsinthreadssowecanseethemthreadseputs"EXCEPTION:#{e.inspect}"puts"MESSAGE:#{e.message}"end崩溃:.rvm/gems/ruby-2.1.3@req/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:478:inload_missing_constant':自动加载常量MyClass时检测到循环依赖稍加研究后,
任何人都可以解释为什么当对方法的调用看起来像这样时我可能会看到这个堆栈(由HTTParty::post请求引起):beginresponse=HTTParty::post(url,options)rescuelogger.warn("Couldnotpostto#{url}")rescueTimeout::Errorlogger.warn("Couldnotpostto#{url}:timeout")end堆栈:/usr/local/lib/ruby/1.8/timeout.rb:64:in`timeout'/usr/local/lib/ruby/1.8/net/protocol.rb
我使用vim编辑ruby文件,但是当我输入“.”时它崩溃了。我发现它是由AutoComplPop插件引起的。我该怎么办? 最佳答案 我找到了一种使用autocomplpop和filetype=ruby来防止vim崩溃的方法。将以下行放入您的.vimrcletg:acp_behaviorRubyOmniMethodLength=-1这将防止在您键入“.”时触发autocomplpop。(期间)这不是解决办法。(我不是vim插件程序员)祝你好运! 关于ruby-vim使用AutoComp
我正在尝试编写一个Ruby扩展,而且我一整天都在成功编译我的nmatrix.so共享对象文件。但是,突然之间,它开始生成nmatrix.bundle,而根本没有任何.so文件。它没有给我任何链接器错误,所以我无法想象为什么会这样。我也没有更改myMakefileorextconf.rb中的任何内容.我一直通过rvm使用Ruby1.9.3p0。我已经尝试对当天的工作执行gitstashsave并编译一些我知道应该没有链接器错误的东西(产生.so的东西)更早。不幸的是,这也会生成一个.bundle文件。很明显,我做了一些事情——可能是无意中安装了一些东西——这改变了一些关键的GCC设置。这
我在Rails5项目的app/services文件夹下有多个加载/需要类的问题,我开始放弃这个问题。首先要明确的是,services/是我在整个项目中使用的简单PORO类,用于从Controller、模型等中抽象出大部分业务逻辑。树看起来像这样app/services/my_service/base.rbfunny_name.rbmy_service.rbmodels/funny_name.rb失败#1首先,当我尝试使用MyService.const_get('FunnyName')时,它从我的模型目录中获取了FunnyName。当我直接执行MyService::FunnyName时,
我正在尝试按短语区分两个字符串,类似于StackOverflow在版本编辑页面上区分两个字符串的方式。执行此操作的算法是什么?是否有gems或其他标准库可以实现此目的?编辑:我见过其他差异算法(Differ与Ruby),它们似乎导致以下结果:>>o='nowisthetimewhenallgoodmen.'>>p='nowsometimethementimewhenallgoodmen.'>>Differ.diff_by_word(o,p).format_as(:html)=>"nowsomeistimethementimewhenallgoodmen."请注意每个单词的单词是如何区分
我正在从Ruby2.3.1升级到Ruby2.4.1,这样做之后,Unicorn似乎与新版本不兼容。我收到以下错误。我正在使用Unicorn5.1.0并尝试过Unicorn5.3.1无济于事。我是否需要使用不同的库而不是XCode工具进行编译?我在使用foremanstart和Procfile启动服务器后立即收到错误:webpack:bin/webpack-dev-servergulp:gulpredis:./scripts/start_redis_server.shsidekiq:bundleexecsidekiq-Cconfig/sidekiq.ymlannotations_serv
我不确定这是否是Rails特有的问题,因此我也将其标记为ruby。我正在通过部分呈现一组event记录。但是,我发现以不同方式渲染部分会导致性能差异显着。两个版本使用完全相同的数据,唯一不同的是用于渲染局部的代码。为什么一个版本总是比另一个版本快4倍?让我想知道我正在接受哪些其他性能影响......慢速版本(总请求时间950毫秒):#LogoutputRenderedevents/_event.html.erb(1.1ms)Renderedevents/_event.html.erb(1.1ms)...更快的版本(总请求时间为250毫秒):#LogoutputRenderedevent