Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] QSerialPortInfo::availablePorts() crashing on osx
Forum Updated to NodeBB v4.3 + New Features

[solved] QSerialPortInfo::availablePorts() crashing on osx

Scheduled Pinned Locked Moved General and Desktop
24 Posts 4 Posters 15.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ambershark
    wrote on last edited by
    #11

    Yea you're right, I had the problem again with Qt 5.2 on my mac.

    What I believe is the problem was the ICU library. Since I had built Qt 5.2 from scratch whereas the Qt 5.1.1 I had used the pre-built version.

    I updated my ICU library (also built from scratch) and rebuilt Qt 5.2 against that and the problem was finally resolved.

    I can't guarantee that it was an ICU issue but the changing of ICU to 52 (was using 48) seems to have resolved the issue.

    If your ICU library is self built I would try upgrading to 52 as well and rebuild your Qt. Alternately I haven't had a problem with this bug and the prebuilt Qt libraries so you can always use those until you can get your build issue worked out.

    Sorry I never updated this thread with my new findings. :)

    My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ArseniyArtmind
      wrote on last edited by
      #12

      Thank you for your reply.
      I haven't ever seen ICU library, which packages it could be provided with on my system? And what dependencies does it have with Qt?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ambershark
        wrote on last edited by
        #13

        It is an internationalization package. Qt is dependent on it for QtWebKit. If you don't use or haven't compiled in QtWebKit you won't need it.

        I don't think it is installed by default with windows, I could be wrong though I don't use windows much.

        You can find more about it and download at:

        http://site.icu-project.org/

        It may not have been ICU changes that fixed my problem. It could have been the rebuild of the source. If you are using pre-compiled Qt or Qt Creator and you are seeing this problem I would look deeper in your code as it may not be the same thing I was experiencing. I never experienced this on windows or linux, only osx.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ArseniyArtmind
          wrote on last edited by
          #14

          I read about icu and scan my system. There is no icu files or libs in my Qt sources. I don't use QtWebKit. There is no any evidence that basic example QtSerialPort application that doesn't use any additional Qt modules could crash because of one of QtWebKit dependencies.
          I don't use pre-compiled Qt, I built Qt from sources using vs2010 command prompt and jom.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ArseniyArtmind
            wrote on last edited by
            #15

            @#include <QtSerialPort/QSerialPortInfo>

            int main(int argc, char *argv[])
            {
            QSerialPortInfo::availablePorts();
            }@
            It's enough to crash.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ambershark
              wrote on last edited by
              #16

              Ok, not webkit or icu then for sure.

              Try getting the pre-built sources and compile and test with those. There has to be something during the build that is causing that crash. I thought mine was ICU as when I changed ICU versions and rebuilt it was "fixed". However in light of your issues maybe it was something else entirely but the rebuild fixed it anyway.

              My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

              1 Reply Last reply
              0
              • A Offline
                A Offline
                ArseniyArtmind
                wrote on last edited by
                #17

                There is no crash in release. I't is only in debug build configuration.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  ambershark
                  wrote on last edited by
                  #18

                  My crash happened in both debug and release.

                  My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    ArseniyArtmind
                    wrote on last edited by
                    #19

                    Would you please describe you system configuration at
                    https://bugreports.qt-project.org/browse/QTBUG-36559#comment-230605,
                    I submited there.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      ArseniyArtmind
                      wrote on last edited by
                      #20

                      I made further step. I avoided using than function and initialized serial port with nam string:
                      QSerialPortInfo info("COM25");
                      I began sending data from my device to computer and tried to catch it.
                      It worked in release but in debug there wasn't any data received.

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kuzulis
                        Qt Champions 2020
                        wrote on last edited by
                        #21

                        [quote]
                        I began sending data from my device to computer and tried to catch it.
                        It worked in release but in debug there wasn’t any data received.
                        [/quote]

                        Please create other task for this issue.

                        Are you build library (on VS2010) yourself?

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          ArseniyArtmind
                          wrote on last edited by
                          #22

                          They find a solution - I've connected release library to project not debug one in debug mode. My fault.

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            kuzulis
                            Qt Champions 2020
                            wrote on last edited by
                            #23

                            Ok. :)

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              ambershark
                              wrote on last edited by
                              #24

                              Well that would definitely do it lol. I would probably have though of that with the debug mode only thing if it wasn't so late last night when I was answering.

                              Glad you got it all working. So it probably was a bad icu lib on my build.

                              My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved