stack-corruption

Passing an array of strings from C# to C++ DLL function and fill it in the DLL and get back

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 03:16:20
问题 I am writing a C# application that passes an empty string array of size 30 to a C++ DLL. This string array needs to be filled in the DLL and given back to the C# application. I my code I observe memory corruption at the end of function call from DLL. My C++ DLL code is as follows: SAMPLEDLL_API BOOL InitExecution (wchar_t **paszStrings, int count) { for (int i = 0 ; i < count; i++) { mbstowcs(*(paszStrings + i), "Good",4); //*(paszStrings + i) = "Good"; } return TRUE; } My C# code is string[]

“Backtrace stopped: previous frame identical to this frame (corrupt stack?)” on ARM linux

爷,独闯天下 提交于 2019-12-12 12:51:11
问题 I am trying to debug a segfault while running an application on linux ( ARM architecture). I copied the core dump file and tried to get the backtrace using arm-gdb on x86_64 host. This is the o/p: $ arm-arago-linux-gnueabi-gdb test_slave6_slave core GNU gdb (GDB) 7.4 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the

Stack corruption using sscanf

我是研究僧i 提交于 2019-12-11 06:54:37
问题 I have the following code to convert 2 hex digits to a byte value: const char* data= "Some hex string"; unsigned char temp=' '; sscanf(data, "%2hhx", &temp); When running it I get a run time exception, saying stack around variable temp is corrupted What am I doing wrong? AFAIK 2hhx should convert two bytes to one... 回答1: Are you sure your compiler and standard library support that particular specifier? It is new in C99. Microsoft for example doesn't support it, according to this: http://msdn

Crash due to “stack corruption detected: aborted”

随声附和 提交于 2019-12-09 05:18:55
问题 I recently received complaint from a user that my app was crashing. I've extracted the following from the user's error logs and was able to see why issues where happening: 12-17 10:31:12.446 I/PLAYLIST( 3158): PreparePlaylist 12-17 10:31:12.446 I/PLAYLIST( 3158): URL: http://f69cbd7a-3d91-4bf5-b4c6-ddb1175cf9e9.d40f2093-2013-4ad9-aec2-e99b015d61ca.070305e7-a706-4626-9ecb-777835065841.groovera.com/listen.pls 12-17 10:31:12.456 F/unknown ( 3158): stack corruption detected: aborted 12-17 10:31

Program segfaults on alpine linux. How do I resolve it?

蓝咒 提交于 2019-12-07 13:04:58
问题 I've been working on a webrtc datachannel library in C/C++ and wrote a program in C to: Create two peers from the same process. Establish a connection between them. Close the connection if it's successful. Everything runs fine on a debian docker container and on my host opensuse tumbleweed (all x86_64 and 64bit), but on alpine linux container (64bit x86_64), I'm getting a SEGFAULT inside the child processes: The function above is from the program's dependency "libnice". It seems like *agent =

Program segfaults on alpine linux. How do I resolve it?

China☆狼群 提交于 2019-12-06 02:02:47
I've been working on a webrtc datachannel library in C/C++ and wrote a program in C to: Create two peers from the same process. Establish a connection between them. Close the connection if it's successful. Everything runs fine on a debian docker container and on my host opensuse tumbleweed (all x86_64 and 64bit), but on alpine linux container (64bit x86_64), I'm getting a SEGFAULT inside the child processes: The function above is from the program's dependency "libnice". It seems like *agent == NULL and there is no way that is made null in the caller's scope. I even inserted a printf("Argument