Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. sigsegv
    Log in to post

    • UNSOLVED Segmentation Fault after assigning QSqlQueryModel from function return in switch statement
      General and Desktop • c++ sql qsqlquery qsqlquerymodel sigsegv • • achoy011  

      14
      0
      Votes
      14
      Posts
      138
      Views

      @RyanSolanki Please mark as solved if you are happy the issue is resolved. Also consider reading up further about Qt's memory management model (maybe it would make sense to pass a parent during the QSqlQueryModel's construction to avoid all that manual memory management or else perhaps smart pointers if there is no clear parent to assign ownership to). Furthermore, SGaist's point about passing a pointer to a function whose signature expects a const reference cannot be understated. If the function expects a pointer, give it a pointer. If it expects a const reference, give it an object created on the stack! https://doc.qt.io/qt-5/qsqlquerymodel.html#details The documentation is good; use it! It is unclear to me why you are using functions such as "clear" for the model. The setQuery() function already clears the model. Why mess around with new and delete several times when you can just pass in a new query to modify the existing model? Futhermore, why bother clear()-ing the model immediately before you delete it? The destructor is called during the delete, which itself frees up any resources, per the documentation. There are deeper problems of comprehension going on here!
    • SOLVED Program crashes with SIGSEGV error when declaring custom matrix type
      General and Desktop • qt6 sigsegv • • hra-ved  

      9
      0
      Votes
      9
      Posts
      172
      Views

      So it seems that I had two issues. Firstly, my program was creating table of 500*500 doubles every time I create a object of the Matrix class, and the second one was that I forgotten to set N-1 into determinat calculator. result was that my program was looping into infinity and every single time creating that massive matrix. Thank you very much for your help.
    • UNSOLVED Program exiting when closing QTcpServer and socket with a QPushButton
      General and Desktop • tcp push button sigsegv qt4.7.4 • • stordd  

      2
      0
      Votes
      2
      Posts
      97
      Views

      99.9999% probability you are trying to use the object you just deleted. If you call deleteLater on an object you then have to recreate it (e.g. with new) before using it or trying to delete it again
    • SOLVED need help SigSegv fault with normal + calculation
      General and Desktop • slot class signals sigsegv fault • • JonnyQB  

      9
      0
      Votes
      9
      Posts
      307
      Views

      @JonnyQB Hi You declare it like Punkte * punkten; Then some place else you must do punkten = new Punkte(); ( not in .h) Often the constructor is a good place.
    • SOLVED Having SIGSEGV when setting serial port name
      Tools • qserialport sigsegv setportname • • cesar93  

      4
      0
      Votes
      4
      Posts
      795
      Views

      @cesar93 so if your problem is solved, please mark this topic as SOLVED too. Thanks
    • UNSOLVED Doing a QList::append while using KBDLLHOOKSTRUCT (WinAPI) results in segmentation fault. :(
      General and Desktop • qt 5.7 crash sigsegv winapi • • Thynome  

      6
      0
      Votes
      6
      Posts
      2607
      Views

      @Thynome Hi, Well, you're stuck with C when working with the WinApi. It sucks, I know, but you need to transfer the context (the object) through a global variable. You can look here for some inspiration - WindowsCtrlDispatcher::instance is the context that's transferred to the VOID WINAPI ServiceMain(DWORD, LPTSTR *) function. I hope that helps. Kind regards.
    • SOLVED SIGSEV error on setDatabaseName
      General and Desktop • sigsegv setdatabasename • • gabor53  

      19
      0
      Votes
      19
      Posts
      3948
      Views

      @kshegunov Finally I figured out that the problem is the missing QSqlDatabase::removeDatabase (); after db.close(); Thank you for your help!!!
    • UNSOLVED Segmentation fault SIGSEGV, what can it be?
      General and Desktop • memory sigsegv segmentation fault management • • StephanWoebbeking  

      34
      0
      Votes
      34
      Posts
      20727
      Views

      Hi, i was experiencing the same strange thing... i was using Qt headers and non Qt headers, and placing before the Qt headers seemed to have solved the problem.
    • SOLVED Segmentation fault on QThread termination. (deletion of 2 sockets running in it)
      General and Desktop • qthread sigsegv movetothread destro • • mbruel  

      10
      0
      Votes
      10
      Posts
      6000
      Views

      @mbruel said: What do you think, still something to avoid? You do want to free your resources, while this is usually done in the destructor, that might not always be the case (for example QFile has open() and close() methods, and internal state that it tracks. For speed optimisation and avoiding signal/slots when possible, well I don't know... I'm new to async programming and still don't really see the point to use a signal/slot mechanism with direct connection instead of directly calling the function on the object. It might not optimize a lot but it should definitely avoid few functions calls and passing by the event queue. When you connect objects that live in the same thread, you don't have any event queue calls (it's a direct connection, and behaves exactly like you've invoked the function yourself). A reason why you might want to use signals and slots, instead of pure function calls is to decouple components, which is something you'd want for the most part. I'm wondering if the impressive results of the QT version are due to the C++ and use of native socket or more of the non blocking sockets. Probably both, although internally (at the OS level) the sockets are blocking, you just don't see it. Also linux sockets, at least to my experience, tend to perform better than their windows counterparts. I don't know why, they just seem to be faster.
    • SIGSEGV - segmentation fault
      Tools • serial port debugging serialport sigsegv segmentation fa unexpectedly fi exe crashed the inferior st • • FabioSO  

      6
      0
      Votes
      6
      Posts
      1903
      Views

      You're welcome ! Since you have it working now, please update the thread title prepending [solved] so other forums users may know a solution has been found :)
    • QThread causes Sigsgev fault
      General and Desktop • qthread network sigsegv • • Nara  

      4
      0
      Votes
      4
      Posts
      1145
      Views

      Ok, I found my mistake, I was just dumb. I didn't initialize something properly but it looked like it was a bit random so I didnt get it first.