A-A+

sybase Stack overflow detected

2016年07月26日 Sybase 暂无评论 阅读 608 次

sybase stack 错误,sybase自保终止进程。

Stack overflow detected: limit: 0x000000016b6fb380, sp: 0x000000016b6fb6e8

这里可以看到,发生了Stack overflow ,Stack 设置的参数为16进制0x000000016b6fb380

16b6fb380de 十进制为 1560947163358/1024/1024/1024=5M

stack pointer: 0x000000016b6fb6e8 超过了Stack 设置的限制,发生溢出。

12:00000:01064:2016/07/26 10:55:01.22 kernel *** Stack guardword corrupted.
12:00000:01064:2016/07/26 10:55:01.25 kernel pc: 0x0000000100355e80 .pcstkwalk+0x88()
12:00000:01064:2016/07/26 10:55:01.25 kernel pc: 0x0000000100356538 .ucstkgentrace+0x238()
12:00000:01064:2016/07/26 10:55:01.25 kernel pc: 0x00000001003552c8 .ucbacktrace+0x78()
12:00000:01064:2016/07/26 10:55:01.25 kernel pc: 0x00000001001fec1c .ucstackcrash+0xac()
12:00000:01064:2016/07/26 10:55:01.25 kernel pc: 0x000000010021c000 .upsleepgeneric[8]+0x160()
12:00000:01064:2016/07/26 10:55:01.26 kernel pc: 0x000000010003e320 .cm_writedes[7]+0x4c()
12:00000:01064:2016/07/26 10:55:01.26 kernel pc: 0x00000001000257ec .bufwritedes_log[1]+0x24()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100032d48 .xls_flush+0xc4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100032b3c .finishlog+0x1c4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000dd8c4 .abort__all[1]+0x24()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000de07c .xact__rollbackxact[1]+0x15c()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000de1ac .xact__rollback_local[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001006460b8 .s_handle+0xe88()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100178684 .ex_raise[1]+0x48()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100226344 .stack_oflow+0x34()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010068b778 .constree[6]+0x18()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel end of stack trace, spid 1064, kpid 184288347, suid 1471
12:00000:01064:2016/07/26 10:55:01.27 kernel *** Stack corrupted, server aborting.
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100355e80 .pcstkwalk+0x88()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100356538 .ucstkgentrace+0x238()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001003552c8 .ucbacktrace+0x78()
2:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel end of stack trace, spid 1064, kpid 184288347, suid 1471
12:00000:01064:2016/07/26 10:55:01.27 kernel *** Stack corrupted, server aborting.
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100355e80 .pcstkwalk+0x88()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100356538 .ucstkgentrace+0x238()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001003552c8 .ucbacktrace+0x78()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001001ff108 .keipanic+0x8c()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001001fec24 .ucstackcrash+0xb4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010021c000 .upsleepgeneric[8]+0x160()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010003e320 .cm_writedes[7]+0x4c()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000257ec .bufwritedes_log[1]+0x24()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100032d48 .xls_flush+0xc4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100032b3c .finishlog+0x1c4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000dd8c4 .abort__all[1]+0x24()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000de07c .xact__rollbackxact[1]+0x15c()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100178684 .ex_raise[1]+0x48()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x0000000100226344 .stack_oflow+0x34()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010068b778 .constree[6]+0x18()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x000000010006b07c .constree[1]+0xc()
12:00000:01064:2016/07/26 10:55:01.27 kernel pc: 0x00000001000840b8 .com__op[3]+0x4()
12:00000:01064:2016/07/26 10:55:01.27 kernel end of stack trace, spid 1064, kpid 184288347, suid 1471

 

inewup-stack-overflow

对于这个错误的官方解释为

Stack guardword corrupted

Message text

*** Stack guardword corrupted.

Explanation

This error occurs when the stack area used by an Adaptive Server process is corrupted. Adaptive Server usually shuts itself down after this error to avoid problems that could arise from the stack corruption.

WARNING! If this error occurs and Adaptive Server remains running, shut it down immediately!

At start-up, Adaptive Server allocates one stack area for every configured user connection. These stacks are in contiguous areas of memory, with a guard at the end of each stack. At the end of each stack guard area is a "guardword," which is a 4-byte structure with a pattern. Adaptive Server periodically checks this pattern to determine whether it has changed. A change indicates that a process has overflowed its stack guard area. When this occurs, Adaptive Server prints the following messages in the error log and shuts down:

kernel: *** Stack overflow detected: <limit>: 0x%lx <sp>: 0x%lx
kernel: *** Stack guardword corrupted
kernel: *** Stack corrupted, server aborting

In the first message, <limit> is the address of the end of the stack guard area, and <sp> is the current value of the stack pointer.

In addition, Adaptive Server periodically checks the stack pointer to determine whether it is completely outside both the stack and the stack guard area for the process. If it is, Adaptive Server shuts down, even if the stack guardword is not corrupted, and prints the following messages in the error log:

kernel: *** Stack overflow detected: limit: 0x%lx sp: 0x%lx
kernel: *** Stack corrupted, server aborting

Stack corruption is usually the result of one process's stack overflowing its boundaries and writing on top of another process' stack. In general, an Adaptive Server process writes past the end of its stack area for one of two reasons:

  • The stack size is too small. The information placed on the stack is valid but its total size exceeds the specified stack size. This is often caused by a single, complex query that requires more than the average amount of stack space.
  • An incorrectly handled error results in recursive calls that eventually fill the stack, regardless of its size.

Action

If this error occurs because a complex query has run out of stack area, correct the error by using one of the following methods.

Choose solution 1, or choose between solutions 2 and 3 depending on your scenario.

Solution 1

Break up the query into smaller pieces, if possible.

Solution 2 – Server remains running after error occurs

Restart the server. Use the following information to select an appropriate size for the stack size configuration parameter:

  • The stack size should always be an even increment of 2K (2048 bytes). If a stack size is specified that is not divisible by 2K, Adaptive Server rounds it up to the next 2K increment.
  • Increase the stack size by no more than 2K at a time. If the stack size is too large, you may be unable to start Adaptive Server.
  • Increasing the stack size results in Adaptive Server requiring more memory for each configured user connection and device.

Use sp_configure to increase the stack size configuration parameter:

1> sp_configure "stack size", <new_value>
				
2> go

Where <new_value> is the new stack size.

Once this change is made, shut down and restart Adaptive Server for the change to take effect.

WARNING! If you increase the value of the stack size configuration parameter, you may need to adjust other memory-related parameters. Refer to "Memory Use and Performance" in Performance and Tuning: Basics and "Configuring Memory" in the System Administration Guide: Volume 2.

Solution 3 – Server shuts down after error occurs

  1. Restart the Adaptive Server.
  2. Increase the stack size, following the instructions in "Solution 2 – Server remains running after error occurs."
  3. Increase the stack guard size by 2K. Use sp_configure to increase this parameter:
  4. 1> sp_configure "stack guard size", <new_value>
    					
  5. 2> go
    
  6. Once this change is made, restart Adaptive Server to have the change take affect.

Additional information

Increasing the stack size results in Adaptive Server requiring more memory for each configured user connection and device. Therefore, increasing the stack size without increasing the memory parameter, will result in less total cache space for Adaptive Server and could affect performance.

Refer to "Setting Configuration Parameters" in the System Administration Guide: Volume 1 for information about using the sp_configure procedure and the stack configuration parameters. Also see Reference Manual: Procedures for additional information on sp_configure.

给我留言

Copyright © 2011-2016 零下二十四度Theme By  Ality  京ICP备16007547号   关于本站

用户登录