back soft

متن مرتبط با «valgrind corrupt heap» در سایت back soft نوشته شده است

A quantion about building a 3 dimension DataFrame and its heap-map in Python

  • امروزدخترم رابردم دندانپزشکی .یکی ازهمکاران قدیمی به اسم خانم شریفی رادیدم خوشحال شدم ،راستش برای من فرقی نمی کنه که خاطره خوب ازهمکارام داشته باشم یانه وقتی بعدازمدتهااونهارامی بینم خوشحال میشم،بعدرف, ...ادامه مطلب

  • Corrupt Valgrind?

  • Vote count: 0 I have the following simple program: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> #include <assert.h> #include <ero.h> #define handle_error_en(en, msg) {do { ero = en; perror(msg); exit(EXIT_FAILURE); } while (0);} #define status_check(stat) ((stat != 0) ? (handle_error_en(stat, "status error")) : ((void)0)) static void* thread_start(void *arg) { printf("%sn", "thread working.."); sleep(1); retu NULL; } int main(int argc, char const *argv[]) { int status; pthread_t thread; status = pthread_create(&thread, NULL, thread_start, NULL); status_check(status); status = pthread_join(thread, NULL); status_check(status); printf("%sn", "exit program.."); retu 0; } When I run Valgind with Valgrind --tool=helgrind ./threads_simple I get 54 errors, all being data rac,valgrind corrupt memory,valgrind corrupt heap ...ادامه مطلب

  • Raspberry Attempted to read or write protected memory. This is often an indication that other memory is corrupt

  • Vote count: 0 I have the following code, and the StopWatch object, when I try to restart it, it throws this exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt The code is as follows: public sealed partial class MainPage : Page { private const int ECHO_PIN = 23; private const int TRIGGER_PIN = 18; private GpioPin pinEcho; private GpioPin pinTrigger; private DispatcherTimer timer; private Stopwatch sw; public MainPage() { this.InitializeComponent(); InitGPIO(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(400); timer.Tick += Timer_Tick; if (pinEcho != null && pinTrigger != null) { timer.Start(); } } private async void Timer_Tick(object sender, object e) { pinTrigger.Write(GpioPinValue.High); await Task.Delay(10); pinTrigger.Write(GpioPinValue.Low); while (pinEcho.Read() == GpioPinValue.Low) { sw.Restart(); } while (pinEcho.Read() == GpioPinValue.High) { } sw.Stop(); var elapsed = sw.Elapsed.TotalSeconds; var distance = elapsed * 34000; distance /= 2; distancetb.Text = "Distance: " + distance + " cm"; } private async void InitGPIO() { var gpio = GpioController.GetDefault(); if (gpio == null) { pinEcho = null; pinTrigger = null; gpioStatus.Text = "no hay controlador GPIO en este dispositivo"; retu; } pinEcho = gpio.OpenPin(ECHO_PIN); pinTrigger = gpio.OpenPin(TRIGGER_PIN); pinTrigger.SetDriveMode(GpioP, ...ادامه مطلب

  • Create a subdomain on Namecheap for a Heroku Rails app

  • Vote count: 0 I have a domain name registered on namecheap. Let's say it is mysite.com. I want this domain to be my personal site. I also want to create a subdomain like myapp.mysite.com for a Rails app on Heroku. I have tried to configure one in the DNS section of the Namecheap dashboard but I'm new with theses things. I'm using a CNAME type, @ for host and automatic for TTL. I have also added myapp.mysite.com as a custom domain in my Heroku dashboard. Am I doing this right? Please explain it in detail so I can lea more about DNS. asked 2 mins agoFrank Noel Let's block ads! بخوانید, ...ادامه مطلب

  • Implement BST by array and implement heap by linked list

  • Vote count: 0 I am currently leaing data structure and trying to implement a BST and max-heap(use BST as base class). But I accidentally found it seems impossible to derive heap from BST. Almost all the implementation for heap are based on array rather then using pointers point to left and right, and most of BST are based on pointers rather than array. So my question is why I have to use array to realize a heap? And, in realizing BST, why people choose to use pointers point to left and right rather array? I know use array to realize BST may cost more space, and it is harder to implement remove function, is there any more reason for that? Thank you so much! asked 41 secs agoXiangyu Zhang Let's block ads! بخوانید, ...ادامه مطلب

  • 0_ os_lock_corruption_abort in NSURLProtocol

  • Vote count: 0 I've built a custom NSURLProtocol which is used by a WebView whilst it browses. But at seemingly random times (between a 20 seconds or a few minutes into browsing) I am getting an EXC_BREAKPOINT and the app stops running in my NSURLProtocol. The relevant part of my NSURLProtocol is below, it's the last line which is showing the EXC_BREAKPOINT self.mutableData = NSMutableData(data: data!) self.response = response self.client?.URLProtocol(self, didReceiveResponse: response!, cacheStoragePolicy: NSURLCacheStoragePolicy.Allowed) self.client?.URLProtocol(self, didLoadData: data!) self.client?.URLProtocolDidFinishLoading(self) The Xcode error is visible below: I'm totally bamboozled on this one. Does anyone have an idea what might be causing this, and how to fix it? Thank you! Sam asked 1 min agoSam Heather Let's block ads! بخوانید, ...ادامه مطلب

  • What's the difference between heapq and PriorityQueue in python?

  • Vote count: 0 In python there's a built-in heapq algorithm that gives you push, pop, nlargest, nsmallest... etc that you can apply to lists. However, there's also the queue.PriorityQueue class that seems to support more or less the same functionality. What's the difference, and when would you use one over the other? asked 2 mins agoYasser 1 Answer Vote count: 0 Queue.PriorityQueue is a thread-safe class, while collections.heapq makes no thread-safety guarantees. From the Queue module documentation: The Queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics. It depends on the availability of thread support in Python; see the threading module. answered 1 min agoMartijn Pieters♦ Let's block ads! بخوانید, ...ادامه مطلب

  • Playing a MIDI file clogs up the heap with millions of com.sun.media.sound.ModelSource[]

  • Vote count: 0 As the title says, i have a game that plays a MIDI file in the background. This appears to create millions of instances of com.sun.media.sound.ModelSource[], taking up lots of RAM, causing GC lag spikes and probably clearing some SoftReferences (i'm not sure if they does). I don't have any other sound related code and it also does not appear to be related to the size of the soundbank I use. Is there any way to improve the memory footprint? My code: public class MusicPlayer { private Sequencer player; private Synthesizer synth; private Soundbank bank; private boolean paused = false; private boolean ready = false; public MusicPlayer() { try { // Initialize MIDI output player = MidiSystem.getSequencer(false); synth = MidiSystem.getSynthesizer(); bank = MidiSystem.getSoundbank(new BufferedInputStream(getClass().getResourceAsStream("path/to/soundbank.sf2"))); player.open(); synth.open(); player.getTransmitter().setReceiver(synth.getReceiver()); synth.loadAllInstruments(bank); } catch (Exception e) { System.err.println("MUSIC INITIALIZATION ERROR: n" + e.toString()); } } /** * Starts playing a new track */ public void play(String name) { try { Sequence track = Loader.getSong(name); player.stop(); player.setSequence(track); player.setMicrosecondPosition(0); // Rewind if needed player.setLoopCount(Sequencer.LOOP_CONTINUOUSLY); paused = false; ready = true; player.start(); // And here we go! } catch (Exception e) { System.err.println("MUSIC PLAY ERROR: n" + e.toString()); retu; } } /** * Pauses the currently playing track */ public void pause() { if (!paused && ready) { player.stop(); , ...ادامه مطلب

  • Visual studio Team foundation corrupted file

  • Vote count: 0 My machine crashed in the midst of a Team Foundation sync, and now when I try to commit changes, or change branches in my solution, I get the error: An error occurred. Detailed message: Invalid data in index - incorrect header signature How can I get my commits/sync working again? edited 2 hours agojessehouwing asked 2 hours agoanti Let's block ads! بخوانید, ...ادامه مطلب

  • rJava -- NLP, java heap error

  • Vote count: 0 I'm trying to run the NLP and openNLP packages in R with rJava, and I keep getting a similar error: Java.lang.OutOfMemoryError: Java heap space. I've already tried: options( java.parameters = "-Xmx4g" ) library( "RWeka" ) I've also tried increasing to 8g. Still running out of space, still crashing R. I'm working on annotating a .txt file-- a large one, yes, but just one file. Trying to extract location names. Any ideas how I can fix this issue? Thanks! asked 2 mins agoLaura McGrath Let's block ads! بخوانید, ...ادامه مطلب

  • Sending corrupted csv line over the socket in Python 3

  • Vote count: 0 I build a sensor unit where data are gathered at one Raspberry Pi and send to another's over the network. My first Pi creates a line with multiple readings from different sensors. It supposed to create a server and send it to clients. The client Pis needs to receive the sentence, do further processing or visualisation. To test my solutions I want to read data from a txt file, which was build in an experiment. The problem is that sometimes data are corrupted, has different format depending on sensor and rows can be different for different set-ups. I have build a function which suppose to change the input line to bytes. (I tried different methods but only this clunky function is the closest to any results). But it does not convert over the network import struct message = ['First sensor', 'second data', 'third',1, '19.04.2016', 0.1] def packerForNet(message): patte = '' newMessage = [] for cell in message: if isinstance( cell, int ): patte += ('I') newMessage.append(cell) elif isinstance( cell, float ): patte += ('d') newMessage.append(cell) elif isinstance(cell, str): patte += (str(len(cell))) patte += ('s') newMessage.append(cell.encode('UTF-8')) else: cell = str(cell) patte += (len(cell)) patte += ('s') newMessage.append(cell.encode('UTF-8')) retu (newMessage, patte) newMessage, patte = packerForNet(message) patteStruct = struct.Struct(patte) packedM = patteStruct.pack(*newMessage) The output from the function does not unpack correctly: packedM = b'First sensorsecond datathirdx01x00x00x0019.04.2016x00x00x00x00x00x00x9ax99x99x99x99x99xb9?' 56 print('unpacked = %s' % patteStruct.unpack(packedM)) TypeError: not all arguments converted during string formatting In addition I need to know the patte to unpack it on the client side so in general , ...ادامه مطلب

  • Getting heap size error while deserializing json respone in apex

  • Vote count: 0 I am using third party service to get data using rest API. But sometimes it retu more than 6 MB data. They don't have API to provide data in chunks. I am already using future method to increase heap size limit to 12 MB. With below code, I am facing heap size error at the time of de-serialization of data. @future (callout=true) public static void CreateProjects(set<ID> setOfProjectID) { HttpRequest request; HttpResponse response = new HttpResponse(); Map<Id,Opportunity> mapOfIdAndProjectToCreate = new Map<Id,Opportunity>([SELECT Id, Name, projectId__c, Mercatus_Project__c FROM Opportunity WHERE ID IN :setOfProjectID]); Map<string,Mercatus_Custom_Setting__c> mercatusCustomSettings = Mercatus_Custom_Setting__c.getAll(); Integer customerId; List<Opportunity> lstOppToUpdate = new List<Opportunity>(); if(!mapOfIdAndProjectToCreate.isEmpty()) { for(Id OpportunityID : mapOfIdAndProjectToCreate.keySet()) { Opportunity oppCreated = new Opportunity(); oppCreated = mapOfIdAndProjectToCreate.get(OpportunityID); try { String projectId; String requestBody = createRequestBodyForProject(mapOfIdAndProjectToCreate.get(OpportunityID)); HttpRequest req = CreateHttpRequest(MercatusConstant.CreateProjectURL,requestBody,'POST'); Http http = new Http(); HTTPResponse resp = new HTTPResponse(); if(!Test.IsRunningTest()) { resp = http.send(req); System.debug('heap size after api call '+Limits.getHeapSize()); } if(resp.getStatusCode() == 200) { string responseBody = String.valueOf(resp.getBody()); resp = n, ...ادامه مطلب

  • WiFi configuration file corrupted on Android

  • Vote count: 0 Hey so I recently created an Android application that basically connects to an access point and if it isn't in range, it uses peer-to-peer connectivity to reach other devices that are in range of the AP themselves. Mistakenly, I hard coded the wrong SSID and as a result, if I go into my WiFi settings and take a look at my saved networks, there it is. The obvious solution would be to simply remove it by tapping on it and selecting 'Forget' but every so often, it appears on the list again. I've tried clearing the entire configuration file both manually and programmatically but it still somehow makes it's way on there. And this isn't just a pet peeve, I think it's somehow related to my actual problem, why I'm always having trouble connecting to secured networks anywhere I go. I have to reenter the credentials every time and its become a bit of a hassle. I've searched the inteet and the solution seems to be deleting the corrupted config file: '/data/misc/wifi/wpa_supplicant.conf' or a path that's similar. After trying the ADB tool, I don't believe I even have read access as I kept getting a 'No such file or directory' error. My device isn't rooted and all signs point to going in that direction but if I were to go through all that trouble I might as well just factory reset my phone and have everything go back to normal. Any last minute ideas before I break the glass and push the red button? I appreciate any help, thank you thanks! asked 2 mins agospatel4140 This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers., ...ادامه مطلب

  • جدیدترین مطالب منتشر شده

    گزیده مطالب

    تبلیغات

    برچسب ها