[fpc-devel] Unicodestring branch, please test and help fixing

Martin Schreiber fpmse at bluewin.ch
Sat Sep 13 15:51:50 CEST 2008


On Thursday 11 September 2008 23.18:07 Florian Klaempfl wrote:
> Martin Schreiber schrieb:
> > On Saturday 30 August 2008 13.37:42 Florian Klaempfl wrote:
> >
> > I have a crash in MSEide startup in a procedure finalization section:
[...]
> > I saw that you merged unicodestring to trunk. Should I test with trunk
> > instead of unicodestring branch?
>
> Yes. Unicodestring branch is closed.

I tried with trunk, same result. The problem is probably that the second 
constant string parameter has a wrong reference count. It is initially 0 
instead of -1. The incref call at begin of winfilepath turns it to 1, decref 
in finalize section of winfilepath tries to free the constant string 
memory -> bumm.
Testresult:
"
-1
1
An unhandled exception occurred at $77892373 :
EAccessViolation : Access violation
  $77892373
  $778922F8
  $0040A214
  $004097A3
  $004098DD
  $004099DB
  $00408844
  $004068EA
  $0040696D
  $00401858
  $004018D5
"
The crash stack:
"
#0  77892373 :0 ??()
#1  00416E04 :0 U_SYSTEM_ENTRYINFORMATION()
#2  004196D4 :0 U_SYSINITPAS_ENTRYINFORMATION()
#3  004162C4 :0 U_SYSTEM_OUTPUT()
#4  014CFE20 :0 ??()
#5  00408799 sysheap.inc:38 SYSOSALLOC(SIZE=0)
#6  778922F8 sysheap.inc:0 ??()
#7  00416F00 sysheap.inc:0 U_SYSTEM_ORPHANED_FREELISTS()
#8  0040A762 systhrd.inc:300 SYSENTERCRITICALSECTION(CS=void)
#9  0040A214 thread.inc:190 ENTERCRITICALSECTION(CS={DEBUGINFO = 0x0, 
LOCKCOUNT = 1, RECURSIONCOUNT = 0, OWNINGTHREAD = 0, LOCKSEMAPHORE = 944, 
SPINCOUNT = 0})
#10  004097A3 heap.inc:1034 WAITFREE_VAR(PMCV=0x41312c)
#11  004098DD heap.inc:1086 SYSFREEMEM_VAR(LOC_FREELISTS=0x416f84, 
PMCV=0x41312c)
#12  004099DB heap.inc:1125 SYSFREEMEM(P=0x413138)
#13  00408844 heap.inc:275 FREEMEM(P=0x413138)
#14  004068EA ustrings.inc:179 DISPOSEUNICODESTRING(S=0x413138)
#15  0040696D ustrings.inc:206 fpc_unicodestr_decr_ref(S=0x413138)
#16  00401858 decrefcrash.pas:63 WINFILEPATH(DIRNAME=0x0, FILENAME=0x413138, 
result=0x14fdab0)
#17  004018D5 decrefcrash.pas:69 main()
"
And there are calls to fpc_WideStr_Decr_Ref I don't understand.
Test program attached.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: decrefcrash.pas
Type: text/x-pascal
Size: 1729 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080913/d1285961/attachment.pas>


More information about the fpc-devel mailing list