내 프로그램 나누기 완전히 무관 한 줄에 세그먼트 오류가 발생하고 여기에 EXC_BAD_ACCESS를 제공합니다 해당 코드 행은 나중에 표시됩니다. 나중까지 호출되지 않는 함수에는 프로그램을 손상시키는 코드 행이 있습니다. 행이 실행되기 전에 함수에서 리턴 할 때 프로그램에는이. 제 점이 없지만 행 뒤의 함수에서 리턴해야한다면이. 제 점이 있습니다.라인은 엑스 코드에서 스택 트레이스에 따라, 코드
코드 줄은 OpenCL 호출입니다. 어떻게 든 프로그램을 망가 뜨리고 있습니까?
err = clEnqueueReadBuffer(ocl_data->commands, ocl_data->output, CL_TRUE, 0, sizeof(CombinationResult) * PPO_COMBINATIONS, (*PPO_results)[x] + PPO_COMBINATIONS*(p + 5), 0, NULL, NULL);
PPO_COMBINATIONS 정수 매크로로서 정의되고 PPO_results의 유형 CombinationResult (*) [3] [PPO_COMBINATIONS * 11]이다. ocl_data-> 명령에는 cl_command_queue 유형이 있고 ocl_data-> 출력에는 cl_mem 유형이 있습니다. err, p 및 x는 int 유형입니다.
"Apple LLVM Compiler 3.0"에서 Xcode를 사용하고 있습니다. "LLVM GCC 4.2"컴파일러는 어떤 이유로 "아키텍처 i386에 대한 잘못된 메타 데이터 레코드"를 제공합니다.
Matthew-Mitchell:Parrallel BitCoin Trading Algorithm matt$ gcc -g cmain.c -o test -lcurl -framework OpenCL -std=c99 -arch i386
Matthew-Mitchell:Parrallel BitCoin Trading Algorithm matt$ gdb testGNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 15 16:03:10 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .... done
(gdb) run
Starting program: /Users/matt/Programming/Bit Coin algorithm/Parrallel BitCoin Trading Algorithm/test
Reading symbols for shared libraries .+++.................................................................. done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0xbea7d7cc
0x00003e9a in main (argc=0, argv=0x1000) at cmain.c:572
572 int main (int argc, const char * argv[]) {
명령 줄에서 직접 실행하면 프로그램이 즉시 종료 : 컴파일하고 gdb를 실행 명령 줄을 사용하는 경우
이
은 결과입니다.
'gdb'에서 프로그램이 충돌 한 후 'bt'의 결과를 게시 할 수 있습니까? –
예를 들면 다음과 같이 실행하십시오. Valgrind? –
'main'의 두 번째 매개 변수에'const'없이 시도 했습니까? [C99 표준] (http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf)은이를 'char **'일반 ... – pmg