Mailing List Archive

#1750: Fail more gracefully on -l >= 4GB
#1750: Fail more gracefully on -l >= 4GB
---------------------------------+----------------------
Reporter: geoff | Type: defect
Status: new | Priority: low
Milestone: Varnish 4.0 release | Component: varnishd
Version: 4.0.3 | Severity: minor
Keywords: |
---------------------------------+----------------------
Varnish cannot run with a VSM file size of 4GB or more -- as discussed
with Martin on IRC, the VSM API cannot accommodate sizes that large (for
example due to unsigned ints as offsets).

But the varnishd command succeeds with -l 4g -- the management process
starts, and then the child process fails an assert. So the invocation
appears to be normal, although Varnish fails almost immediately.

On my system, there was a message in /var/log/messages indicating failure
of the child due to SIGABRT, but there was no core dump (although I always
get them otherwise). And since the management process also stopped, there
was no panic message, so there was nothing useful to diagnose the problem.

I suggest checking -l against the maximum on invocation, and failing right
away to stderr.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1750: Fail more gracefully on -l >= 4GB [ In reply to ]
#1750: Fail more gracefully on -l >= 4GB
----------------------+----------------------------------
Reporter: geoff | Owner:
Type: defect | Status: new
Priority: low | Milestone: Varnish 4.0 release
Component: varnishd | Version: 4.0.3
Severity: minor | Resolution:
Keywords: |
----------------------+----------------------------------

Comment (by geoff):

Also, the varnishd documentation (both 4.0 and trunk) has this to say
about -l: "Scaling suffixes like 'k', 'M' can be used up to (E)xabytes."
Obviously there won't be any exabytes. Better to document the 4GB limit.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1750: Fail more gracefully on -l >= 4GB [ In reply to ]
#1750: Fail more gracefully on -l >= 4GB
----------------------+----------------------------------
Reporter: geoff | Owner: martin
Type: defect | Status: new
Priority: low | Milestone: Varnish 4.0 release
Component: varnishd | Version: 4.0.3
Severity: minor | Resolution:
Keywords: |
----------------------+----------------------------------
Changes (by martin):

* owner: => martin


--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1750: Fail more gracefully on -l >= 4GB [ In reply to ]
#1750: Fail more gracefully on -l >= 4GB
----------------------+----------------------------------
Reporter: geoff | Owner: martin
Type: defect | Status: new
Priority: low | Milestone: Varnish 4.0 release
Component: varnishd | Version: 4.0.3
Severity: minor | Resolution:
Keywords: |
----------------------+----------------------------------

Comment (by phk):

As I understand this, this is a limitation in the VSL api which uses
uint32_t for offset/index?

That really should be size_t...

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1750: Fail more gracefully on -l >= 4GB [ In reply to ]
#1750: Fail more gracefully on -l >= 4GB
----------------------+----------------------------------
Reporter: geoff | Owner: martin
Type: defect | Status: new
Priority: low | Milestone: Varnish 4.0 release
Component: varnishd | Version: 4.0.3
Severity: minor | Resolution:
Keywords: |
----------------------+----------------------------------

Comment (by geoff):

size_t is a "natural" type for something like that, and is almost
certainly large enough for anything that anyone might want to have for -l.

But there's also the matter of graceful failure. It would still be
necessary to reject -l values that are too large (> SIZE_MAX in the case
of size_t), and the reasonable expectation would be that varnish doesn't
start at all, neither master or child process, as soon as the command line
parsed, with a message to stderr.

As it is, the master process starts when -l is too large, but the child
process is aborted and then the master process stops. A message about the
abort goes to syslog, but nothing says what the problem was. Automated
deployments see the master process starting, and then have every reason to
assume that everything's fine.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1750: Fail more gracefully on -l >= 4GB [ In reply to ]
#1750: Fail more gracefully on -l >= 4GB
----------------------+----------------------------------
Reporter: geoff | Owner: martin
Type: defect | Status: new
Priority: low | Milestone: Varnish 4.0 release
Component: varnishd | Version: 4.0.3
Severity: minor | Resolution:
Keywords: |
----------------------+----------------------------------

Comment (by phk):

size_t is big enough to cover the address-space of the CPU.

You will, by definition, never mmap anything larger.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750#comment:5>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1750: Fail more gracefully on -l >= 4GB [ In reply to ]
#1750: Fail more gracefully on -l >= 4GB
----------------------+---------------------
Reporter: geoff | Owner: martin
Type: defect | Status: new
Priority: low | Milestone:
Component: varnishd | Version: trunk
Severity: minor | Resolution:
Keywords: |
----------------------+---------------------
Changes (by phk):

* version: 4.0.3 => trunk
* milestone: Varnish 4.0 release =>


--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1750#comment:6>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs