Immediate crash upon calling PL_initialize (Win32)

Kaitain Jones <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAMeycMyK518aZV3mp2pv+KnqbAuRFGh7DZCLT1UBNmqdor1TWw@mail.gmail.com>
I've got SWI working pretty much as expected in a small Win32 console app.
But now I'm trying to to integrate it into our much more heavyweight
app/codebase (still Win32) and am hitting a wall as soon as I try to
initialize the system, that takes the whole app down. It compiles and
links, and seems happy with the DLLs on startup. But it seems to be the
very first attempt to call into the libswipl DLL that causes the
explosion...anyone have any ideas as to how to begin diagnosing the problem?

ntdll.dll!_LdrpCallInitRoutine@16()  + 0x14 bytes
  ntdll.dll!_LdrShutdownProcess@0()  + 0x141 bytes
  ntdll.dll!_RtlExitUserProcess@4()  + 0x74 bytes
  kernel32.dll!768a79c5()
  msvcrt.dll!___crtExitProcess()  + 0x17 bytes
  msvcrt.dll!__cinit()  + 0x13c8 bytes
  msvcrt.dll!_exit()  + 0x11 bytes
  libswipl.dll!6d28b85b()
  libswipl.dll!6d301a61()
  msvcrt.dll!_free()  + 0x39 bytes
  libswipl.dll!6d334a00()
  libswipl.dll!6d334f3a()
  libswipl.dll!6d301c10()
  msvcrt.dll!_free()  + 0x39 bytes
> libswipl.dll!6d334a00()
  t3.mll!InitializerInstructions::ExecutePrologStartup()  Line 250 + 0xd
bytes C++
  t3.mll!PrologBridge::InitializeNewPrologSession()  Line 291 C++
  t3.mll!PrologBridge::InitializeNewPrologSession(const
InitializerInstructions & instructions={...})  Line 298 C++
  t3.mll!InitPrologForStory(char * targetFile=0x07b4348c)  Line 1500 + 0x13
bytes C++

I was trying to see if I could repro the problem in the smaller (and
single-threaded) console app, but I haven't been able to do so. I was about
to embark on a slightly tedious expedition to add elements gradually to the
working app to push it ever closer to the state of the larger app and
(hopefully) find the point where failure is triggered, but wondered if
anyone had some handle on what was likely to be going on here (or a more
informed path of suggested investigation).

To add extra details:

ExecutePrologStartup()

calls

PL_initialise(nCommands, plav)

with nCommands = 1 and plav having "libswipl.dll" in cell 0 and NULL in
cell 1. (In the working console app, it seems not to matter what I pass as
the plav argument; I can put a nonsense word in and the default/fallback
logic seems to be fine.)

KJ
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.