Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-01

help please -> crash in realoc mem due to entercritical section

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

I recently startet getting the below error => 2.4.2 and trunk, so probably not fpc.

But The particular code in Lazarus hasn't changed (from what it was before I start getting the error)

If I step into it, then fpc_ansistr_concat get's 2 perfectly valid strings (as far as I can see). Tha code is even in a loop , it works 3 or 4 times, then boom.
The issue is, I am at loss, where to even start looking. So any hints will be welcome...

It happens if I run the gdb test case in lazarus=> my version is currently modified from the one in svn, but the debugger code, that crashes is not modified.

#0 ntdll!RtlAddAccessDeniedObjectAce at :0
#1 ntdll!RtlAddAccessDeniedObjectAce at :0
#2 SYSENTERCRITICALSECTION(0) at ..\win\systhrd.inc:358 #3 ENTERCRITICALSECTION({DEBUGINFO = 0x0, LOCKCOUNT = 4, RECURSIONCOUNT = 0, OWNINGTHREAD = 4294967292, LOCKSEMAPHORE = 10226112, SPINCOUNT = 10226116}) at ..\inc\thread.inc:202
#4 WAITFREE_VAR(0xfffffffc) at ..\inc\heap.inc:1081 #5 SYSFREEMEM_VAR(0x0, 0x0) at ..\inc\heap.inc:1144 #6 SYSFREEMEM(0xfffffffc) at ..\inc\heap.inc:1186
#7 SYSREALLOCMEM(0x9c09c4, 4294967292) at ..\inc\heap.inc:1432 #8 REALLOCMEM(0x0, 4) at ..\inc\heap.inc:317
#9 fpc_ansistr_setlength(0x2c4210 #1, 10226116) at ..\inc\astrings.inc:580 #10 fpc_ansistr_concat(0x2c4210 #1, 0x2c4218 'type = TOBJECT = class '#13#10' public'#13#10' constructor CREATE (TOBJECT, POINTER) : ^TOBJECT;'#13#10' destructor ~DESTROY (TOBJECT, POINTER); virtual;'#13#10' function NEWINSTANCE (unnamedtype) : ^TOBJECT; vir'..., 0x2f0640 ' function SAFECALLEXCEPTION (TOBJECT, TOBJECT, POINTER) : LONGINT; virtual;'#13#10) at ..\inc\astrings.inc:225 #11 DOCONSOLESTREAM(0x4a0e598, 0x2f0640 ' function SAFECALLEXCEPTION (TOBJECT, TOBJECT, POINTER) : LONGINT; virtual;'#13#10) at ..\debugger\gdbmidebugger.pp:8157
#12 PROCESSRESULT(0x2f0698, {STATE = DSNONE, VALUES = 0x2c4210 #1, FLAGS = []}, -1) at ..\debugger\gdbmidebugger.pp:8223
#13 EXECUTECOMMAND(0x2f0698, 0x98ed00 'ptype TObject', {STATE = DSNONE, VALUES = 0x2c4210 #1, FLAGS = []}, [], -1) at
..\debugger\gdbmidebugger.pp:8036
#14 DOEXECUTE(0x2f0698) at ..\debugger\gdbmidebugger.pp:2980 #15 EXECUTE(0x2f0698) at ..\debugger\gdbmidebugger.pp:8776 #16 RUNQUEUE(0x6442008) at ..\debugger\gdbmidebugger.pp:4781 #17 QUEUECOMMAND(0x6442008, 0x2f0698, false) at
..\debugger\gdbmidebugger.pp:4878
#18 STARTDEBUGGING(0x6442008, 0x2d42f0) at ..\debugger\gdbmidebugger.pp:5770 #19 STARTDEBUGGING(0x6442008, ECTCONTINUE) at
..\debugger\gdbmidebugger.pp:5754
#20 GDBRUN(0x6442008) at ..\debugger\gdbmidebugger.pp:5094 #21 REQUESTCOMMAND(0x6442008, DCRUN, {}, -1) at
..\debugger\gdbmidebugger.pp:5554
#22 REQCMD(0x6442008, DCRUN, {}, -1) at ..\debugger\debugger.pp:2130 #23 RUN(0x6442008) at ..\debugger\debugger.pp:2144 #24 TESTWATCHES(0x32a4d8) at testwatches.pas:607
#25 RUNTEST(0xfffffffc) at src\fpcunit.pp:867
#26 RUNBARE(0x32a4d8) at src\fpcunit.pp:845
#27 PROTECTTEST(0x0, 0x4) at src\fpcunit.pp:1177
#28 RUNPROTECTED(0x5f824b0, 0x32a4d8, {procedure (TTEST, TTESTRESULT)} 0x4a0f26c) at src\fpcunit.pp:1201
#29 RUN(0xfffffffc, 0x9c09c0) at src\fpcunit.pp:1186 #30 RUN(0x4, 0x0) at src\fpcunit.pp:835
#31 RUNTEST(0x0, 0xfffffffc, 0x4) at src\fpcunit.pp:1035 #32 RUN(0x0, 0x0) at src\fpcunit.pp:1026
#33 GUITESTRUNNER_TGUITESTRUNNER_$__RUNTEST$TTEST at :0 #34 GUITESTRUNNER_TGUITESTRUNNER_$__ACTRUNHIGHLIGHTEDTESTEXECUTE$TOBJECT at :0
#35 EXECUTE(0x0) at ..\objpas\classes\action.inc:124 #36 EXECUTE(0x2f4770) at include\containedaction.inc:104 #37 EXECUTE(0x2f4770) at include\customaction.inc:252 #38 EXECUTE(0x5fad638, 0x5f57e00) at ..\objpas\classes\action.inc:49 #39 CLICK(0x5f57e00) at include\control.inc:2285
#40 CLICK(0x5f57e00) at include\buttoncontrol.inc:62 #41 CLICK(0x5f57e00) at include\buttons.inc:174
#42 CLICK(0x5f57e00) at include\bitbtn.inc:57
#43 WMDEFAULTCLICKED(0x5f57e00, {MSG = 66567, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0}) at include\buttoncontrol.inc:26 #44 DISPATCH(0x0, 0) at ..\inc\objpas.inc:592
#45 WNDPROC(0x5f57e00, {MSG = 66567, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0}) at include\control.inc:1684
#46 WNDPROC(0x5f57e00, {MSG = 66567, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0}) at include\wincontrol.inc:5241
#47 DELIVERMESSAGE(0x5f57e00, 0) at lclmessageglue.pas:110 #48 WINDOWPROC(7865768, 273, 32256, 656944) at win32callback.inc:2441 #49 USER32!GetWindowMinimizeRect at :0
#50 IDENTPROC(0x111) at synhighlighterhtml.pp:2122 #51 USER32!GetWindowMinimizeRect at :0
#52 GETNEEDPARENTPAINT(0x0, 0xcacd1342) at win32callback.inc:213 #53 USER32!CallNextHookEx at :0
#54 USER32!SendNotifyMessageA at :0
#55 DllInstall at :0
#56 DllInstall at :0
#57 DllInstall at :0
#58 USER32!GetWindowMinimizeRect at :0
#59 ?? at :0
#60 USER32!GetWindowMinimizeRect at :0
#61 DSA_Destroy at :0
#62 USER32!CancelShutdown at :0
#63 USER32!CancelShutdown at :0
#64 CALLDEFAULTWINDOWPROC(656944, 514, 0, 1114192) at win32callback.inc:110 #65 WINDOWPROC(656944, 514, 0, 1114192) at win32callback.inc:2226 #66 BITBTNWNDPROC(656944, 514, 0, 1114192) at win32wsbuttons.pp:548 #67 USER32!GetWindowMinimizeRect at :0
#68 ?? at :0
#69 USER32!GetWindowMinimizeRect at :0
#70 DRAWBITMAP(0x7741522d, BSUP, true (66), false) at win32wsbuttons.pp:320 #71 USER32!GetMonitorInfoA at :0
#72 USER32!DisplayExitWindowsWarnings at :0
#73 APPPROCESSMESSAGES(0x2cbc58) at win32object.inc:389 #74 HANDLEMESSAGE(0x2c3c40) at include\application.inc:1229 #75 RUNLOOP(0x2c3c40) at include\application.inc:1362 #76 APPRUN(0x2cbc58, {Proc = {procedure (POINTER)} 0x4a0ff48, Self = 0x2c3c40}) at include\interfacebase.inc:49
#77 RUN(0x2c3c40) at include\application.inc:1350
#78 :15

Reply by email

Martin
to Martin
Martin wrote
I recently startet getting the below error => 2.4.2 and trunk, so probably not fpc.

Solved....

the "talk about it" effect.

I had an out of range memory access in completely unrelated code.

Reply by email