segmentation-fault

Segmentation-fault with PyObject_Call() in shared library for iTunes

我与影子孤独终老i 提交于 2020-01-16 02:06:22
问题 I'm experimenting with the iTunes SDK and Cython. The DLL entry-point seems to work, but using any "real Python" causes iTunes to crash. The following code compiles fine and the plugin-dll is loaded successfully by iTunes. cimport libc.stdio as stdio cdef extern from "iTunesAPI/iTunesAPI.h": ctypedef int OSType ctypedef int OSStatus ctypedef struct PluginMessageInfo: pass int unimpErr cdef public OSStatus iTunesPluginMain( OSType message, PluginMessageInfo* messageInfo, void* refCon ): cdef

Reverse a string in C solution segfaulting

北战南征 提交于 2020-01-14 09:22:26
问题 I've come up with the following solution in C for reversing a string: #include <stdio.h> void reverse(char * head); void main() { char * s = "sample text"; reverse(s); printf("%s", s); } void reverse(char * head) { char * end = head; char tmp; if (!head || !(*head)) return; while(*end) ++end; --end; while (head < end) { tmp = *head; *head++ = *end; *end-- = tmp; } } However my solution is segfaulting. According to GDB, the offending line is the following: *head++ = *end; The line segfaults on

CasperJS/PhantomJS Segmentation fault

孤者浪人 提交于 2020-01-14 06:27:07
问题 I have a script which opens the urls in the links array and for each url it extracts the links in that url and inserts the new links to the array links(addLinks function). The code results in segmentation fault and it happens when it calls this.start to open a valid url (3rd line of the code). Is it a problem with casperjs or my code? Another interesting point is that it always prints 'OK, it is loaded' after the 'Page title: ' while according to the code they should be printed in reverse

Python threads stack_size and segfaults

自古美人都是妖i 提交于 2020-01-13 20:21:12
问题 A web crawler script that spawns at most 500 threads and each thread basically requests for certain data served from the remote server, which each server's reply is different in content and size from others. i'm setting stack_size as 756K's for threads threading.stack_size(756*1024) which enables me to have the sufficient number of threads required and complete most of the jobs and requests. But as some servers' responses are bigger than others, and when a thread gets that kind of response,

Segmentation fault- strcat

牧云@^-^@ 提交于 2020-01-13 14:12:12
问题 This is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> void main(int arge, char *argv[]) { FILE *f1; char ch,*fn="~/lyrics/"; strcat(fn,argv[1]); strcat(fn,".txt"); if( (f1 = fopen(fn,"r"))==NULL ) { printf("\nWrong filename\n%s not found",argv[1]); return; } while((ch=getw(f1))!=EOF) { printf("%c",ch); } } I compiled it using gcc -g -o file file.c and the compiler gave no error messages. But when I run it I get the error message: Segmentation fault (core dumped) Bad

Segmentation fault- strcat

心不动则不痛 提交于 2020-01-13 14:09:38
问题 This is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> void main(int arge, char *argv[]) { FILE *f1; char ch,*fn="~/lyrics/"; strcat(fn,argv[1]); strcat(fn,".txt"); if( (f1 = fopen(fn,"r"))==NULL ) { printf("\nWrong filename\n%s not found",argv[1]); return; } while((ch=getw(f1))!=EOF) { printf("%c",ch); } } I compiled it using gcc -g -o file file.c and the compiler gave no error messages. But when I run it I get the error message: Segmentation fault (core dumped) Bad

Segmentation fault- strcat

这一生的挚爱 提交于 2020-01-13 14:09:09
问题 This is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> void main(int arge, char *argv[]) { FILE *f1; char ch,*fn="~/lyrics/"; strcat(fn,argv[1]); strcat(fn,".txt"); if( (f1 = fopen(fn,"r"))==NULL ) { printf("\nWrong filename\n%s not found",argv[1]); return; } while((ch=getw(f1))!=EOF) { printf("%c",ch); } } I compiled it using gcc -g -o file file.c and the compiler gave no error messages. But when I run it I get the error message: Segmentation fault (core dumped) Bad

Segmentation fault- strcat

只谈情不闲聊 提交于 2020-01-13 14:08:01
问题 This is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> void main(int arge, char *argv[]) { FILE *f1; char ch,*fn="~/lyrics/"; strcat(fn,argv[1]); strcat(fn,".txt"); if( (f1 = fopen(fn,"r"))==NULL ) { printf("\nWrong filename\n%s not found",argv[1]); return; } while((ch=getw(f1))!=EOF) { printf("%c",ch); } } I compiled it using gcc -g -o file file.c and the compiler gave no error messages. But when I run it I get the error message: Segmentation fault (core dumped) Bad

Persistent Ruby segfaulting after a clean install

橙三吉。 提交于 2020-01-13 14:05:21
问题 Ruby keeps segfaulting when using the Koala gem to talk over HTTP: /Users/pawel/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault I've tried the following: Run which -a ruby which showed multiple Rubies via MacPorts. So I deleted those and running the same command again returns only /usr/bin/ruby I've removed the MacPorts version of PostgreSQL and installed it with Homebrew instead (With MacPorts, it installs its own version of OpenSSL) Running openssl version

Persistent Ruby segfaulting after a clean install

懵懂的女人 提交于 2020-01-13 14:05:06
问题 Ruby keeps segfaulting when using the Koala gem to talk over HTTP: /Users/pawel/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault I've tried the following: Run which -a ruby which showed multiple Rubies via MacPorts. So I deleted those and running the same command again returns only /usr/bin/ruby I've removed the MacPorts version of PostgreSQL and installed it with Homebrew instead (With MacPorts, it installs its own version of OpenSSL) Running openssl version