Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QtWebKit fails to run in Win x86 (Release Mode)
Forum Updated to NodeBB v4.3 + New Features

QtWebKit fails to run in Win x86 (Release Mode)

Scheduled Pinned Locked Moved Qt WebKit
6 Posts 2 Posters 4.3k 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.
  • N Offline
    N Offline
    Nosf
    wrote on last edited by
    #1

    I've built qt_4.8.2 with webkit using visual studio 2012. (Used fix from "Here":http://qt-project.org/forums/viewthread/17771)

    Now my application works fine in debug build however in release it crashes when the mainFrame()->setHtml() was called with an access violation error.

    The weird part is this problem does not happen in my x64 machine which has been built in the same way as the x86 machine apart from the x86 or x64 type.

    I tried running the "webkit examples". Same story. In the x86 machines, release mode crashes with an access violation error while debug mode seems to work fine.

    Could someone suggest anything I might be doing wrong here or missed please.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Do you happen to mix debug and release version of your DLLs by accident?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Nosf
        wrote on last edited by
        #3

        Hey Volker,

        Nah. The dll's are in the exe's folder and release version dll's are just one's without the "d" .

        "Video":http://videobam.com/ThRDu

        ^^

        1. In that video initially am trying to run the application with my built release libraries using visual studio 2012. Which does not run and if executed from visual studio gives an exception and crashes.

        2. the "qt_installer" folder from which i run the exe has dll's from the qt 4.8.2 installer for MSVC 2010. that seems to work fine.

        3. Finally I run the debug version with my built debug dll's and they seem to be fine too.

        Pretty confused by this. Not sure if MSVC 2012 has some incompatibility and hence builds webkit but with some problems in the back, and if thats the case why it works fine in debug but not in release.

        My Literal build process was as follows.

        1. Get the source tar ball for 4.8.2
        2. From MSVC command prompt switch to qt folder (with env variables set)
        3. Apply fix from the thread linked in my first post to hashset.h
        4. in qmake.conf for win32-msvc2010 set QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
        5. configure -debug-and-release -opensource -confirm-license -shared -platform win32-msvc2010 -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg
        6. nmake

        Process finished with no errors.

        1 Reply Last reply
        0
        • N Offline
          N Offline
          Nosf
          wrote on last edited by
          #4

          Just to update,

          using the qt installer dll's is not an option as for qt example's it runs fine. However when the c runtime library is used because of your own code, it fails again (VS 2012RC)

          Seems like some memory being allocated is not working out well with Visual studio 2012 on x86 release mode.

          Am stuck trying to find exactly where the problem might be to try and fix it in webkit if so.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Nosf
            wrote on last edited by
            #5

            Was finally able to build QtWebKit4.dll from Visual studio with the debugging symbols.

            Found the function causing the problem.

            "Bug Report":https://bugs.webkit.org/show_bug.cgi?id=90008

            1 Reply Last reply
            0
            • N Offline
              N Offline
              Nosf
              wrote on last edited by
              #6

              WorkAround:

              in file "TextEncodingRegistry.cpp" path: "\src\3rdparty\webkit\Source\WebCore\platform\text"

              Replace

              @
              static void addToTextCodecMap(const char* name, NewTextCodecFunction function, const void* additionalData)
              {
              const char* atomicName = textEncodingNameMap->get(name);
              ASSERT(atomicName);
              textCodecMap->add(atomicName, TextCodecFactory(function, additionalData));
              }
              @

              With

              @
              static void addToTextCodecMap(const char* name, NewTextCodecFunction function, const void* additionalData)
              {
              // const char* atomicName = textEncodingNameMap->get(name);
              const char* atomicName;
              TextEncodingNameMap::iterator pos;
              for (pos = textEncodingNameMap->begin(); pos != textEncodingNameMap->end(); ++pos) {
              if (strcmp(pos->first, name) == 0) {
              atomicName = pos->second;
              break;
              }
              }
              ASSERT(atomicName);
              textCodecMap->add(atomicName, TextCodecFactory(function, additionalData));
              }
              @

              and Replace

              @
              PassOwnPtr<TextCodec> newTextCodec(const TextEncoding& encoding)
              {
              MutexLocker lock(encodingRegistryMutex());

              ASSERT(textCodecMap);
              TextCodecFactory factory = textCodecMap->get(encoding.name());
              ASSERT(factory.function);
              return factory.function(encoding, factory.additionalData);
              

              }
              @

              With

              @
              PassOwnPtr<TextCodec> newTextCodec(const TextEncoding& encoding)
              {
              MutexLocker lock(encodingRegistryMutex());

              ASSERT(textCodecMap);
              // TextCodecFactory factory = textCodecMap->get(encoding.name());
              

              TextCodecFactory factory;
              TextCodecMap::iterator pos;
              for (pos = textCodecMap->begin(); pos != textCodecMap->end(); ++pos) {
              if (strcmp(pos->first, encoding.name()) == 0) {
              factory = pos->second;
              break;
              }
              }
              ASSERT(factory.function);
              return factory.function(encoding, factory.additionalData);
              }
              @

              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