Wordpress Underscore theme error - custom-wordpress-pages

function wp_is_stream( $path ) { $wrappers = stream_get_wrappers(); $wrappers_re = '(' . join('|', $wrappers) . ')'; return preg_match( "!^$wrappers_re://! ", $path ) === 1; }
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3266603443 bytes) in H:\xamp\htdocs\grafteach\wp-includes\functions.php on line 5160
whats the problem when trying to go to admin panel it give this error?

The bug is fixed.
Wordpress/ stream_get_wrappers causes crash

Related

GNU LD: Overlapping sections (NOLOAD) generates no errors

I have a use-case where I want to reserve a configurable AREA of Flash for user-data at the end of the FLASH. I wan't the linker to produce an error (or at minimum a warning) if the code section overlap with the "user-data" area.
Here is what I have defined in my linker script:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 160K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
}
SECTIONS
{
.text :
{
*(.text)
*(.text*)
*(.glue_7)
*(.glue_7t)
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
_etext = .;
} >FLASH
/* Reserved FLASH area for user data (r/w data in Flash) */
__flash_data_size__ = DEFINED(FLASH_DATA_SIZE) ? FLASH_DATA_SIZE : 0K;
.flash_data ORIGIN(FLASH) + LENGTH(FLASH) - __flash_data_size__ (NOLOAD) :
{
. = ALIGN(2048);
__flash_data_start__ = .;
. = . + __flash_data_size__;
__flash_data_end__ = .;
} >FLASH
}
When I define the symbol FLASH_DATA_SIZE I can see that the elf file contains a NOLOAD section at the end of the Flash as expected. However if the section overlaps with the code section (.text) I don't get any linker error.
Any idea why the linker does not complain about this?
Alternatively any other ideas how I can have a "compile time" configurable section of the Flash reserved for user data, which is checked against overlapping of code sections?
Thanks in advance,
Thomas
I managed to work out a solution that works and provided the errors I need with overlapping sections. I solved it, by creating another MEMORY region with configurable size. For those interested in the solution I have provided it below:
_FLASH_SIZE = 512K;
_FLASH_DATA_SIZE = (DEFINED(FLASH_DATA_SIZE) ? FLASH_DATA_SIZE : 0K);
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 160K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = _FLASH_SIZE - _FLASH_DATA_SIZE
FLASH_DATA (rw) : ORIGIN = 0x08000000 + _FLASH_SIZE - _FLASH_DATA_SIZE, LENGTH = _FLASH_DATA_SIZE
}
SECTIONS
{
.text :
{
*(.text)
*(.text*)
*(.glue_7)
*(.glue_7t)
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
_etext = .;
} >FLASH
.flash_data (NOLOAD) :
{
. = ALIGN(2048);
__flash_data_start__ = .;
. = . + _FLASH_DATA_SIZE;
__flash_data_end__ = .;
} >FLASH_DATA
}

Can Saxon work on a page with .htaccess?

Due to some issues with the php version of Saxon, I currently have a convoluted setup where I do a php call to execute a java command, convert the results into html, display that html on my page, and then delete the resulting html after display. I can provide a link to the page if it helps, but the actual .xq file is pretty simplistic:
xquery version "1.0" encoding "UTF-8";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare variable $zone external;
declare variable $line external;
declare variable $collection external;
declare function local:if-empty
( $arg as item()? ,
$value as item()* ) as item()* {
if (string($arg) != '')
then data($arg)
else $value
};
declare function local:remove-elements($input as element(), $remove-names as xs:string*) as element() {
element {node-name($input) }
{$input/#*,
for $child in $input/node()[not(name(.)=$remove-names)]
return
if ($child instance of element())
then local:remove-elements($child, $remove-names)
else $child
}
};
declare function local:remove-empty-elements($nodes as node()*) as node()* {
for $node in $nodes
return
if (empty($node)) then () else
if ($node instance of element())
then if (normalize-space($node) = '')
then ()
else element { node-name($node)}
{ $node/#*,
local:remove-empty-elements($node/node())}
else if ($node instance of document-node())
then local:remove-empty-elements($node/node())
else $node
} ;
<list>
{
let $q:=collection($collection)
let $remove-list := ('note')
(:let $q:=local:remove-empty-elements($q):)
for $y in $q
let $s := $y//tei:surface
let $t := $y//tei:titleStmt/#xml:id
let $m := $y//tei:msDesc/#xml:id
let $z := $s/tei:zone[#n=$zone]
let $l := $z/tei:line[#n=$line]
let $w := concat($y//tei:msDesc/tei:msIdentifier/tei:settlement/text(),', ',$y//tei:msDesc/tei:msIdentifier/tei:institution/text(),' ',$y//tei:msDesc/tei:msIdentifier/tei:idno/text())
let $g := concat($t, "/" , $m, "/", substring-before($l/../../tei:graphic/#url,"."),".html")
let $o:=local:remove-elements($l/tei:orig,$remove-list)
where ($z//tei:line/#n = "l.1")
return
<item>{$w}: <ref target="{$g}">{$o}</ref></item>}
</list>
and the command to run it is java -Xms128m -Xmx1024m -XX:+UseCompressedOops -cp saxon9he.jar net.sf.saxon.Query -t -q:test.xq -o:1505740041.41932650059544.xml line=l.4 zone=EETS.QD.8 collection=file:<filefolder>
My problem is that the xml files I'm working with are currently unpublished transcriptions, and I'd like to keep them behind a password protected folder until I think they're ready for prime time. If I have any sort of .htaccess file in the filefolder location, I get the following error message:
Building tree for file:<filefolder>/.htaccess using class net.sf.saxon.tree.tiny.TinyBuilder
Error on line 1 column 1 of .htaccess:
SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
Query failed with dynamic error: org.xml.sax.SAXParseException; systemId: file:<filefolder>/.htaccess; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
It's pretty obvious to me that what's happening is that it's getting to the .htaccess file, which is not XML, and then doesn't know what to do with it. My question is if there's a way in my xquery file to tell Saxon not to include .htaccess in the collection. I'm sure there is, but everything I've found is about finding file names, not about suppressing them in the collection you're building.
If you ever need something more elaborate than selection using a glob pattern, then you can use the uri-collection() function to return the URIs of the files in the directory, and then use doc() to process the ones that you are actually interested in. This would give you a solution if, for example, you wanted everything that doesn't start with ".", regardless of its extension.
Another thing you can do with uri-collection() is to process each returned URI within a try/catch block so you have full control over the error handling.
Ok, I'm just stupid. The solution is to add a concat statement to append the select info to the $collection variable, like so:
let $collection:=concat($collection, '?select=*.xml')
let $q:=collection($collection)
let $remove-list := ('note')

Class parameter syntax errors

I am trying to learn to write puppet modules in a good way, so I've started looking around for tutorials and howto.
I've seen that users suggest writing the main class in the following way, but It's actually failing for me.
I am honestly a bit confused how the 2 blocks between brackets are actually connected, and so I might be not seeing an obvious error or real missing comma.
I am running Puppet 3.8 by the way
class icinga2 {
$version = 'present'
$enable = true
$start = true
} {
class{'icinga2::install': } ->
class{'icinga2::config': } ~>
class{'icinga2::service': } ->
Class["icinga2"]
}
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '{'; expected '}' at /etc/puppet/modules/icinga2/manifests/init.pp:5
Your problem here is that your parameters must be surrounded by (), not {}. Also, they should be commas separated.
class icinga2 (
$version = 'present',
$enable = true,
$start = true,
) {
class{'icinga2::install': } ->
class{'icinga2::config': } ~>
class{'icinga2::service': } ->
Class["icinga2"]
}

Linux kernel vfs_stat function does not return device id of the file

I am trying to get the device number of a file in kernel mode. The device id I am looking for is something which comes with stat:
Size: 1024 Blocks: 2 IO Block: 1024 directory
Device: 700h/1792d Inode: 2 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Context: system_u:object_r:unlabeled_t:s0
I have written code using vfs_stat but do not get the same number
struct kstat sb;
int error = 0;
sb.rdev = 0;
error = vfs_fstat(fd, &sb);
if (error) {
monks_error("Could not get vfs stat %d", error);
}
if (sb.mode == 0060000) {
monks_info("The device number is %d", MINOR(sb.dev));
}
return sb.dev;
not sure what is wrong here?
Well, the code sample is insufficient to give a meaningful answer. Also you are inspecting sb.mode even if vfs_fstat failed and what's worse you are unconditionally returning sb.dev.
However, the obvious place to start digging is the stat syscall to see if it does anything to stuff obtained from vfs_fstat. It so happens it does as can be seen in cp_new_stat: tmp.st_dev = encode_dev(stat->dev);

ZeroMemory on PROCESSENTRY32 local variable?

I needed to enumerate running processes and wondered for a while why my code wasn't working:
PROCESSENTRY32 ProcEntry;
ZeroMemory (&ProcEntry, sizeof (PROCESSENTRY32)); //problem
ProcEntry.dwFlags = sizeof(PROCESSENTRY32);
HANDLE Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (Snapshot == INVALID_HANDLE_VALUE)
return false;
if (Process32First(Snapshot, &ProcEntry))
....
Problem was that Process32First always returned FALSE because of ERROR_BAD_LENGTH error.
Once I removed ZeroMemory line, everything started working fine. So the question is, why ZeroMemory caused it? It should just fill memory at the address of X for Z bytes. I use it a lot for winapi pointer-like structures, this time I didnt realise its a local variable but that doesn't explain the problem or does it?
Thanks,
Kra
EDIT: plus I found out code works fine only in Debug version, once I compile it as Release version, its bugged again :/
You should set dwSize, not dwFlags.
ProcEntry.dwFlags = sizeof(PROCESSENTRY32);
should be
ProcEntry.dwSize = sizeof(PROCESSENTRY32);
You cannot zero out the entire PROCESSENTRY32 structure as it is self-describing - you have to set dwSize. From the sample here:
HANDLE hProcessSnap;
HANDLE hProcess;
PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
// Take a snapshot of all processes in the system.
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
printError( TEXT("CreateToolhelp32Snapshot (of processes)") );
return( FALSE );
}
// Set the size of the structure before using it.
pe32.dwSize = sizeof( PROCESSENTRY32 );
// Retrieve information about the first process,
// and exit if unsuccessful
if( !Process32First( hProcessSnap, &pe32 ) )
{
printError( TEXT("Process32First") ); // show cause of failure
CloseHandle( hProcessSnap ); // clean the snapshot object
return( FALSE );
}

Resources