Xcode Linker error: can't allocate region - xcode4

I want to run an app on the iPad2 but at linking I got this error:
collect2: ld terminated with signal 6 [Abort trap]
ld(69392) malloc: *** mmap(size=16777216) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
I dont know whats the reason for this error. It look like allocating 16777216 bytes (16MB) and the iPad2 should handle that!

Are you sure you got the error at linking, and that it didn't successfully link, install and begin to run, THEN get the error?
The error you have is because malloc can't allocate another 16M block, and THAT is almost certainly because you have either crazy memory fragmentation (possible, but not as common) or a memory leak (very common!)
It would be odd to see this coming form the linker/XCode tools (unless you're running betaware, in which case who knows?!) It's more likely in your app.

Related

I am trouble getting my esp32 working on Linux

I am using garuda linux specifically. Im getting this error
`Sketch uses 227017 bytes (17%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21760 bytes (6%) of dynamic memory, leaving 305920 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port /dev/ttyUSB0
A fatal error occurred: Could not open /dev/ttyUSB0, the port doesn't exist
A fatal error occurred: Could not open /dev/ttyUSB0, the port doesn't exist
`
The usb0 port shows up when i plug in the esp32, and im able to select it on arduino. So it obviously does exist. So i thought maybe i dont have the cp2102 driver. I try to install it, and i get this error
make -C /lib/modules/uname -r/build M=/home/sovadirr/Desktop/espdriv modules
make[1]: Entering directory '/usr/lib/modules/6.0.9-zen1-1-zen/build'
CC [M] /home/sovadirr/Desktop/espdriv/cp210x.o
/home/sovadirr/Desktop/espdriv/cp210x.c:290:35: error: initialization of ‘void (*)(struct usb_serial_port )’ from incompatible pointer type ‘int ()(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
290 | .port_remove = cp210x_port_remove,
| ^~~~~~~~~~~~~~~~~~
/home/sovadirr/Desktop/espdriv/cp210x.c:290:35: note: (near initialization for ‘cp210x_device.port_remove’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:249: /home/sovadirr/Desktop/espdriv/cp210x.o] Error 1
make[1]: *** [Makefile:1849: /home/sovadirr/Desktop/espdriv] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.0.9-zen1-1-zen/build'
make: *** [Makefile:7: all] Error 2
I am very confused, because would the esp32 not show on arduino if i didnt have the driver? I believe i have the esp32 devkit v1, it says on the back of the board.
*rom incompatible pointer type ‘int ()(struct usb_serial_port )’ [-Werror=incompatible-pointer-types]
From the looks of it, this has happened in OpenSuSE, Debian, Manjaro, and Arch.
This is a fix for Putty. I'm not sure how to apply it to the esp32 driver. I don't have much time, so don't expect results from me today. I'm not any expert. I'm just sharing my attempts.
https://github.com/xmm7360/xmm7360-pci/pull/159
These links seem to work on the issue. Watch out for the few that just turn the errors off.
https://github.com/xmm7360/xmm7360-pci/issues/141
https://github.com/xmm7360/xmm7360-pci/issues/137
Thanks,
Pat

UCX warn unexpected tag-receive

What can the following be due to / how to debug it? it happens when closing my MPI application
[1612979755.727913] [compute-0-9:21112:0] tag_match.c:61 UCX WARN unexpected tag-receive descriptor 0x2b2bf64cdbc0 was not matched
Assuming the application exited normally, this probably means that some process sent a message (e.g. calling MPI_Send) to a destination process that did not post a matching receive before calling MPI_Finalize. See https://github.com/openucx/ucx/issues/6331#issuecomment-778428537

Grakn mem issue windows local installation

I don't have a tech background. I installed grakn locally on windows into a folder, I am able to start the server and use the workbase, however when I tried to do the compute query in the documentation tutorial (social_network), it throws an error:
2020-08-18 16:59:33,614 [transaction-listener] ERROR g.c.s.r.SessionService$TransactionListener - Runtime Exception in RPC TransactionListener: java.lang.IllegalArgumentException: System memory 259522560 must be at least 471859200. Please increase heap size using the --driver-memory option or spark.driver.memory in Spark configuration.
I then set env variables:
"SERVER_JAVAOPTS": -Xmx4G
"STORAGE_JAVAOPTS": -Xmx4G
Outcome nok:
Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': 'Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.
An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': 'Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.
I then set env variables:
"SERVER_JAVAOPTS": -Xmx2G
"STORAGE_JAVAOPTS": -Xmx2G
Outcome again nok:
Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': ''
An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': ''
I then set env variables to this:
"SERVER_JAVAOPTS": -Xmx1G
"STORAGE_JAVAOPTS": -Xmx1G
Outcome now is ok:
Starting Storage......SUCCESS
Starting Grakn Core Server.....SUCCESS
...but why can't I assign more mem? I have totally 32GB and usage is around 20%.
Many thanks in advance.
There are two possible reasons for this:
JVM is unable to allocate 4G of RAM because it's occupied by something else. However, as you've said only 20% or RAM is used, this is an unlikely reason.
32-bit JVM are unable to address more than 4GB of RAM 1, so you should check if it applies to you and reinstall your JVM to be 64-bit if it does.

Cloud Functions: Function worker crashed with exit code: 3

in Node.js command prompt
Your environment has been set up for using Node.js 6.14.0 (x64) and
npm.
run
firebase functions:shell
get error:
i functions: Preparing to emulate functions.
error: FATAL ERROR: Zone Allocation failed - process out of memory
error: Function worker crashed with exit code: 3
error: code=500, status=INTERNAL, message=Function worker crashed
with exit code: 3
undefinedFATAL ERROR: Zone Allocation failed - process out of memory,
errors=[Function worker crashed with exit code: 3
undefinedFATAL ERROR: Zone Allocation failed - process out of memory]
error: FATAL ERROR: Zone Allocation failed - process out of memory
error: Function worker crashed with exit code: 3
! functions: Error from emulator. [object Object]
No functions emulated.
Update: hmmm.... I just noticed that the message comes from the Cloud Functions shell. I don't think my steps below will solve the problem there, but will leave them up just in case.
As the error message says, your Cloud Functions fails because:
process out of memory
You can either reduce the memory your code uses, or increase the memory that is available to your functions. Given that you didn't share details about the function itself, I'll focus on the second option.
To increase the memory available to your functions:
Go to the Cloud Functions console
Select your function
Click Edit
Change the value in the "Memory allocated" dropdown
Click Save

Qt application crashing immediately without debugging info. How do I track down the problem?

I run an Qt app I've built:
./App
Segmentation fault
I run it with strace:
strace ./App
execve("./App", ["./App"], [/* 27 vars */]) = 0
--- SIGSEGV (Segmentation fault) # 0 (0) ---
+++ killed by SIGSEGV +++
Process 868 detached
Again, no useful info.
I run it with gdb:
(gdb) run
Starting program: /root/test/App
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0xffffe000
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
Again, nothing.
I run it with valgrind:
==948== Process terminating with default action of signal 11 (SIGSEGV)
==948== Bad permissions for mapped region at address 0x0
==948== at 0x1: (within /root/test/App)
Even if I put in debugging symbols, it doesn't give any more useful info. ldd shows all libraries being linked properly.
Is there any other way I can find out what's wrong? I can't even do standard printf, cout, etc debugging. The executable doesn't even seem to start running at all.
I rebuilt with symbols, and tried the suggestion below
(gdb) break main
Breakpoint 1 at 0x45470
(gdb) run
Starting program: /root/test/App
Breakpoint 1 at 0x80045470
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
I checked for static initializers and I don't seem to have any.
Yep, I tried printf, cout, etc. It doesn't even make it into the main routine, so I'm looking for problems with static initializers in link libraries, adding them in one-by-one. I'm not getting any stack traces either.
Try running it through strace, it might give you at least some hints what happens before the program crashes. Also, does a backtrace in gdb not work?

Resources