You are not logged in.
When I run the code in mormot2\ex\mvc-blog on my computer, an error occurs: 00000000156a25fa # EXCOS EAccessViolation (c0000005 EXCEPTION_ACCESS_VIOLATION) [blog 2] at 5abb8e mormot.core.text.pas IsInvalidHttpHeader (10879) {16 0.89 0.57 10GB/31.8GB 4a651701}. However, it runs normally on another computer. How can I resolve this error on my computer, or is there a part of my computer that might be malfunctioning?
Offline
Which compiler?
Which Operating System?Can you give more context?
Delphi12.1
win10。
Additionally, I compiled it once using Lazarus, and everything went smoothly.
When I debug, the returned value is on line 8016 of the mormot.rest.server.pas unit
// lazarus: Call.OutHead = 'Content-Type: text/html;charset=utf-8'
//delphi12.1:OutHead 'Content-Type: text/html;charset=utf-8'#$D#$A'ETag: "E039C149"'
Last edited by slan2026 (2026-02-04 00:38:43)
Offline
I wonder why that IsInvalidHttpHeader changed so much?
It used to be a simple lineair search for invalid line-breaks.
If you look at it now... it became so much more complex (and prone to errors and bugs, as is now the case).
This is the old version:
https://github.com/synopse/mORMot2/blob … .pas#L5473
This is the newer expanded version:
https://github.com/synopse/mORMot2/blob … pas#L10862
It's also strange that searching for IsInvalidHttpHeader on github doesn't give you the location of this function, while it is in the repository.
Offline
The old version was not correct anyway, and slower.
It is very likely that the problem comes from outside this function itself, and that Call.OutHead is incorrect.
I have tried to reproduce the issue with no success:
https://github.com/synopse/mORMot2/commit/bc3f00a03
Do you set the output headers by hand in your server?
Do you use cookies at that time?
Can you have the content of Call.OutHead when it is actually triggered?
Win32 or Win64?
Offline
I can't even compile the current trunk/master on Delphi 10.2.
First I get an error regarding UnCamelCase.
[dcc32 Error] mormot.core.rtti.pas(6253): E2250 There is no overloaded version of 'UnCamelCase' that can be called with these arguments
After fixing that (with a related fix) I get an error in this line:
[dcc32 Error] mormot.ui.pdf.pas(12254): E2029 'THEN' expected but ')' found
if w < Trunc(R.rclBounds.Right - R.rclBounds.Left) / Canvas.fFactorX) thenThis latest source from that file is from januari 27th so...
https://github.com/synopse/mORMot2/blob … pas#L12254
It's amazing how you can compile the latest mORMot2 without any problems
![]()
About the IsInvalidHttpHeader from this topic... I also couldn't reproduce this under Delphi 10.2 win64.
So hopefully @slan2026 can provide more information about the problem and debug exactly on what line the error occurs.
Offline
Win32 or Win64?
i am not set the output headers by hand in server and not use cookies . debug in win32.
I downloaded the source code from GitHub and run the example.
When debugging with Delphi 12.1, input http://localhost:8092 in Edge .
The breakpoint is at line 10879 of the mormot.cre.text.as unit.
After pressing F8, pause at line 8022 of the mormot.rest.server. pas unit
and continue stepping to locate line 8652 of the mormot.net.server. pas unit.
As I mentioned above, everything works fine when I debug with Lazaus。
Offline
Win32 or Win64?
I just found the reason. I used madexcept to detect memory leaks during debugging, and after removing it, everything went smoothly.
Thank you very much.
Offline
The PDF unit compilation should be fixed now
https://github.com/synopse/mORMot2/commit/a7b04d7a3
Offline