[27-06-2005 22:12, Henry Nestler escreveu]
> 1. Invalid access to memory
> This open me a debugger and I see thet a address 0x00987001 is not
> mapped. I see, only adresses from 0x00980000 to 0x00986FFFF are filled
> with data. Others are marked with "?? ?? ... ??"
> Problem: My debugger (MSVC) have no symbols.
> The register IP for bad code is known and have always the same position.
> Programm is not stripped.
> How can I find the function/procedure from badly IP for WinNT EXE?
Use "i686-pc-mingw32-nm -C colinux-console-fltk.exe | sort | less" to
see where that address appears.
> 2. STOP: 0x0000008E (0xC0000046, 0x804F6121, 0xEE267730, 0x00000000)
> What says this line on blue screen?
> Think, it's from linux.sys. But I have not change anything on this.
As linux.sys can be loaded on any address, there is no way to know from
this if it's from the linux.sys driver, but the code means:
"Bug Check 0x8E: KERNEL_MODE_EXCEPTION_NOT_HANDLED
The KERNEL_MODE_EXCEPTION_NOT_HANDLED bug check has a value of
0x0000008E. This indicates that a kernel-mode program generated an
exception which the error handler did not catch."
Note that the GNU compiler has no support for structured exception
handling, so there's no way to write one in the linux.sys driver without
using the Microsoft compiler.
The exception code - 0xC0000046 - is STATUS_MUTANT_NOT_OWNED (as can be
seen in ddk/ntstatus.h).
The second parameter is the address where the exception occurred. With
a crash dump it would be possible to see the base address of linux.sys
and find the place in code where that happened.
The third is the trap frame (I don't think it matters to us).
> 3. Program runs, if insert one line 'co_terminal_print("blabla")'
> After insert one or more lines with co_terminal_print, then it works and
> I see that all variables are ok.
No idea about this.
It can mean some kind of problem in the code, like using a code
"trick" that is not standard and can change with different compiler
flags (things like casting from non-aligned memory, etc).
> 4. Environment
> New lines gets an environment variable. It craches only, with the
> listed errors, if colinux-daemon.exe execute the program.
> I can run same program from command or batch line perfectly.
By looking at the patch, you are using the buffer returned by
getenv(). There is no warranty this buffer will not be freed latter
by the C runtime, and any latter getenv() call can do that. I would try
to make a strdup() of the font name before using it.
> 5. On Stable branch works.
> Have the same source in stable branch. There works without any problems.
It can be a matter of luck it works there ;)
Hope this helps,