Noto Color Emoji not rendering in Emacs - emacs

I can't get Emacs on X11 to display emojis using Google's Noto Color Emoji font. I'm testing with a file containing only one Unicode character CROSSED FLAGS (U+1F38C) and a line feed. I open this file using emacs -Q crossed-flags.txt to inhibit any customizations in my init file or elsewhere to get into the way.
The buffer displays a somewhat wider-than-usual white space where the crossed flags emoji would be expected:
Here's the excerpt from C-u C-x = on the emoji's position. Specifically the line starting with ftcrhb seems to indicate that everything is fine, from Emacs' perspective:
script: emoji
syntax: w which means: word
category: .:Base
to input: type "C-x 8 RET 1f38c" or "C-x 8 RET CROSSED FLAGS"
buffer code: #xF0 #x9F #x8E #x8C
file code: #xF0 #x9F #x8E #x8C (encoded by coding system utf-8-unix)
display: by this font (glyph code):
ftcrhb:-NONE-Noto Color Emoji-regular-normal-normal-*-14-*-*-*-m-0-iso10646-1 (#xC95)
I've collected a Fontconfig trace to show where the font is loaded from using FC_DEBUG=1 emacs -Q crossed-flags.txt >emacs29-fc.log 2>&1. This contains the following info near the end, with file:... locations indicating that the font file of Noto Color Emoji could be found at the expected location.
Match Pattern has 28 elts (size 32)
family: "Noto Color Emoji"(s) "DejaVu Sans"(w) "DejaVu LGC Sans"(w) "DejaVu LGC Sans"(w) "DejaVu Sans"(w) "Bitstream Vera Sans"(w) "Verdana"(w) "Arial"(w) "Albany AMT"(w) "Luxi Sans"(w) "Nimbus Sans L"(w) "Nimbus Sans"(w) "Helvetica"(w) "Lucida Sans Unicode"(w) "BPG Glaho International"(w) "Tahoma"(w) "Noto Sans CJK JP"(w) "Noto Sans CJK SC"(w) "Noto Sans CJK TC"(w) "Nachlieli"(w) "Lucida Sans Unicode"(w) "Yudit Unicode"(w) "Kerkis"(w) "ArmNet Helvetica"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Waree"(w) "Loma"(w) "Garuda"(w) "Umpush"(w) "Saysettha Unicode"(w) "JG Lao Old Arial"(w) "GF Zemen Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narrow"(w) "malayalam"(w) "Sampige"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Gothic"(w) "UmePlus P Gothic"(w) "SimSun"(w) "PMingLiu"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "MgOpen Modata"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "AR PL ShanHeiSun Uni"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "MS ゴシック"(w) "ZYSong18030"(w) "TSCu_Paranar"(w) "NanumGothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim"(w) "KacstQura"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSans"(w) "Arial Unicode MS"(w) "Arial Unicode"(w) "Code2000"(w) "Code2001"(w) "sans-serif"(w) "Roya"(w) "Koodak"(w) "Terafik"(w) "sans-serif"(w)
familylang: "de"(s) "en-us"(w)
stylelang: "de"(s) "en-us"(w)
fullnamelang: "de"(s) "en-us"(w)
slant: 0(i)(s)
weight: 80(i)(s)
width: 100(i)(s)
size: 14.4(f)(s)
pixelsize: 15(f)(s)
spacing: 100(i)(s)
foundry: "NONE"(s)
hintstyle: 3(i)(s)
hinting: True(s)
verticallayout: False(s)
autohint: False(s)
globaladvance: True(s)
file: "/usr/share/fonts/truetype/NotoColorEmoji-Regular.ttf"(s)
index: 0(i)(s)
scalable: True(s)
charset:
0000: 00000000 00000001 00000000 00000000 00000000 00000000 00000000 00000000
0020: 00002000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0e00: 00000000 03ff0000 00000000 87fffffe 00000000 00000000 00000000 00000000
(s)
lang: "de"(w)
fontversion: 2147483647(i)(s)
embeddedbitmap: True(s)
decorative: False(s)
lcdfilter: 1(i)(w)
namelang: "de"(s)
prgname: "emacs-29.0.60"(s)
symbol: False(s)
Best score 0 0 0 0 0 0 0 0 2000 1001 0 0 0 0 0 0 0 0 0 0 0 0 0 2.14742e+12
Pattern has 24 elts (size 24)
family: "Noto Color Emoji"(w)
familylang: "en"(w)
style: "Regular"(w)
stylelang: "en"(w)
fullname: "Noto Color Emoji"(w)
fullnamelang: "en"(w)
slant: 0(i)(w)
weight: 80(i)(w)
width: 100(i)(w)
spacing: 100(i)(w)
foundry: "NONE"(w)
file: "/usr/share/fonts/truetype/NotoColorEmoji-Regular.ttf"(w)
index: 0(i)(w)
outline: True(w)
scalable: True(w)
charset:
0000: 00000000 00000001 00000000 00000000 00000000 00000000 00000000 00000000
0020: 00002000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0e00: 00000000 03ff0000 00000000 87fffffe 00000000 00000000 00000000 00000000
(w)
lang: (w)
fontversion: 65536(i)(w)
capability: "otlayout:DFLT otlayout:latn"(w)
fontformat: "TrueType"(w)
decorative: False(w)
postscriptname: "NotoColorEmoji"(w)
color: False(w)
symbol: False(w)
I've tried various fontconfig tweaks in $HOME/.config/fontconfig/conf.d, but none of them solved the problem. Hence, I've collected the above info with all fontconfig customizations moved out of the way as recommended in etc/PROBLEMS of the Emacs source distribution.
Any ideas on how this could be resolved?

It turns out that this is a problem of the specific font file in my environment. When installing the font from the official Ubuntu package using sudo apt install fonts-noto-color-emoji, the emoji renders as expected:
In contrast, most of the TTF file versions available directly from Noto Color Emoji GitHub repository result in rendering only white space, as illustrated in the OP. The only TTF file from GitHub that works as expected -on Ubuntu 22.04 (Jammy) at least- is NotoColorEmoji-emojicompat.ttf.
An interesting side note is that when compiling the identical Emacs version (from emacs-29 branch) on Ubuntu 16.04 (Trusty) and using the identical font version linked above, emojis are rendered black and white only.
I haven't investigated the source of this difference any further, but assume it is caused by older versions of some Emacs dependencies on Trusty, specifically freetype, fontconfig and/or cairo.

Related

Sanitise code output from grep, replacing multiple whitespace after a range of characters

Answer: Thanks to Jerry Jeremiah I have the solution the end result is this:
grep -E '^\S{8} \S' test.lst | awk -F';' '{print substr($1,1,35)gensub("[[:space:]]+"," ","g",substr($1,36));}'
It requires having gawk installed
Original Question:
I have a file which i want to sanitise the output and then diff however i'm having problems coming up with working regex to do what i want
Basically i want to ignore the first 36 characters then after that start with the first non white space character and replace all multiple white spaces with a single space and strip and line comment off the end which starts with a ; and remove any trailing whitespace
I just cant figure out how to get a pattern that works while ignoring those first 36 characters, any time i use a capture group like (\S*([^\s]\s+))* it will only ever return the last match
This is an example of the code i'm grepping into sed:
00000000 =00A00000 z80_ram: equ $A00000 ; start of Z80 RAM
00000000 =00A000EA z80_dac3_pitch: equ $A000EA
00000000 =00A01FFD z80_dac_status: equ $A01FFD
00000000 =00A01FFF z80_dac_sample: equ $A01FFF
00000000 =00A02000 z80_ram_end: equ $A02000 ; end of non-reserved Z80 RAM
00000000 =00A10001 z80_version: equ $A10001
00000000 =00A10002 z80_port_1_data: equ $A10002
00000000 =00A10008 z80_port_1_control: equ $A10008
00000000 =00A1000A z80_port_2_control: equ $A1000A
00000000 =00A1000C z80_expansion_control: equ $A1000C
00000000 =00A11100 z80_bus_request: equ $A11100
00000000 =00A11200 z80_reset: equ $A11200
00000000 =00A04000 ym2612_a0: equ $A04000
00000000 =00A04001 ym2612_d0: equ $A04001
00000000 =00A04002 ym2612_a1: equ $A04002
00000000 =00A04003 ym2612_d1: equ $A04003
00000000 =00A14000 security_addr: equ $A14000
00000214 6600 bne.s SkipSetup ; Skip the VDP and Z80 setup code if port A, B or C is ok...?
00000216 4BFA 0000 lea SetupValues(pc),a5 ; Load setup values array address.
0000021A 4C9D 00E0 movem.w (a5)+,d5-d7
0000021E 4CDD 1F00 movem.l (a5)+,a0-a4
00000222 1029 EF01 move.b -$10FF(a1),d0 ; get hardware version (from $A10001)
00000226 0200 000F andi.b #$F,d0
0000022A 6700 beq.s SkipSecurity ; If the console has no TMSS, skip the security stuff.
0000022C 237C 5345 4741 2F00 move.l #'SEGA',$2F00(a1) ; move "SEGA" to TMSS register ($A14000)
The output I want is this:
00000000 =00A00000 z80_ram: equ $A00000
00000000 =00A000EA z80_dac3_pitch: equ $A000EA
00000000 =00A01FFD z80_dac_status: equ $A01FFD
00000000 =00A01FFF z80_dac_sample: equ $A01FFF
00000000 =00A02000 z80_ram_end: equ $A02000
00000000 =00A10001 z80_version: equ $A10001
00000000 =00A10002 z80_port_1_data: equ $A10002
00000000 =00A10008 z80_port_1_control: equ $A10008
00000000 =00A1000A z80_port_2_control: equ $A1000A
00000000 =00A1000C z80_expansion_control: equ $A1000C
00000000 =00A11100 z80_bus_request: equ $A11100
00000000 =00A11200 z80_reset: equ $A11200
00000000 =00A04000 ym2612_a0: equ $A04000
00000000 =00A04001 ym2612_d0: equ $A04001
00000000 =00A04002 ym2612_a1: equ $A04002
00000000 =00A04003 ym2612_d1: equ $A04003
00000000 =00A14000 security_addr: equ $A14000
00000214 6600 bne.s SkipSetup
00000216 4BFA 0000 lea SetupValues(pc),a5
0000021A 4C9D 00E0 movem.w (a5)+,d5-d7
0000021E 4CDD 1F00 movem.l (a5)+,a0-a4
00000222 1029 EF01 move.b -$10FF(a1),d0
00000226 0200 000F andi.b #$F,d0
0000022A 6700 beq.s SkipSecurity
0000022C 237C 5345 4741 2F00 move.l #'SEGA',$2F00(a1)
sed '
# Hold the line
h
# Remove 36 characters
s/.\{36\}//
# Remove comments
s/;.*//
# Remove leading spaces
s/[ ]*//
# Squeeze spaces after first word
s/\([^ ]*\) */\1 /
# Shuffle the output with holded line
G
s/\(.*\)\n\(.\{36\}\).*/\2\1/
'
Tested on repl when applied to input generates expected output.
how to get a pattern that works while ignoring those first 36 characters
First hold the line or relevant parts of the line you want to save. Then remove the parts you do not want to apply regex on, apply the regex. Then join the line with holded data and reorder them for the output.
You may use awk like:
awk -F';' '{a=substr($1,1,35); b=substr($1,36); gsub("[[:space:]]+"," ",b);print a b;}' file > outfile
See an online awk demo
Details
-F';' - field separator set to ;
a=substr($1,1,35) - set an a variable equal to a (1,35) char substring of Field 1
b=substr($1,36) - set a b variable equal to a (36,) char substring of Field 1
gsub("[[:space:]]+"," ",b) - replace all chunks of 1 or more whitespace chars with a single regular space char in the b variable only
print a b - print concatenated a and b variable values.

The meaning of "Wait Start TickCount" and "Ticks" in dump file

When I use WinDBG to analyse a kernel model dump file, I can get the information of certain thread. But there are some items that confuse me.
So please help me understand the meaning of the following keywords. Thank you.
Wait Start TickCount
Ticks
UserTime
KernelTime
Here is one example.
THREAD b6b48908 Cid 1038.10b0 Teb: 7ffac000 Win32Thread: fd517868 WAIT: (WrUserRequest) UserMode Non-Alertable
b5700630 SynchronizationEvent
IRP List:
b6ae6ab8: (0006,01d8) Flags: 00060000 Mdl: 00000000
Not impersonating
DeviceMap 95bd9310
Owning Process b5614788 Image: iexplore.exe
Attached Process N/A Image: N/A
Wait Start TickCount 27465609 Ticks: 109779 (0:00:28:32.563)
Context Switch Count 38627
UserTime 00:00:00.717
KernelTime 00:00:00.421
Win32 Start Address 0x6a6439a0
Stack Init b8b7ded0 Current b8b7d8e0 Base b8b7e000 Limit b8b7b000 Call 0
Priority 11 BasePriority 8 UnusualBoost 0 ForegroundBoost 2 IoPriority 2 PagePriority 5
ChildEBP RetAddr Args to Child
b8b7d8f8 8328aefd b6b48908 8333d008 83339e20 nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
b8b7d930 83289d57 b5700630 b6b48908 b6b489ec nt!KiSwapThread+0x266
b8b7d958 83285af4 b6b48908 b6b489c8 00000000 nt!KiCommitThreadWait+0x1df
b8b7dad4 94bac293 00000001 b8b7db0c 00000001 nt!KeWaitForMultipleObjects+0x535
b8b7db44 94bac06c 000025ff 00000000 00000001 win32k!xxxRealSleepThread+0x20b (FPO: [SEH])
b8b7db60 94ba90b4 000025ff 00000000 00000001 win32k!xxxSleepThread+0x2d (FPO: [3,0,0])
b8b7dbb8 94bac685 b8b7dbe8 000025ff 00000000 win32k!xxxRealInternalGetMessage+0x4b2 (FPO: [SEH])
b8b7dc1c 83249dc6 0295c7dc 00000000 00000000 win32k!NtUserGetMessage+0x4d (FPO: [SEH])
b8b7dc1c 77366bf4 0295c7dc 00000000 00000000 nt!KiSystemServicePostCall (FPO: [0,3] TrapFrame # b8b7dc34)
0295c790 00000000 00000000 00000000 00000000 ntdll!KiFastSystemCallRet (FPO: [0,0,0])
Wait Start TickCount is the computer internal time representation of when the Thread started waiting, i.e. when it changed from state "running" to state "waiting".
Ticks is the difference from Wait Start TickCount to now. These values may affect thread scheduling (together with others, such as the priorities).
Usertime is the amount of time the thread had a call stack with user mode functions on top.
Kerneltime is the amount of time the thread had a call stack with kernel mode functions on top. This should correspond to the values displayed by !runaway in user mode debugging. Both times do not include waiting time, just the actual running time when the thread was really executing CPU instructions.

How to find the source of an 'Access Violation'

To put in a nutshell, I have a C# application doing lots of mciSendString calls ( via dllimport ) to control wav files playback ( essentially open, play, pause, stop, status, close ). And after running for a while, the application crashes without notice with an 'access violation'.
Even though I'm running the app from my vs2012, the exception is not caught by visual studio. Even with the 'force break on an exception' option, I've had no luck in debugging this from the vs2012. So instead I've setup WER to generate me crash dumps and I am using windbg with psscor2.dll plugin to debug it.
Then in sequence, using the following commands, this is what I get ( shorten to the essential for readability purposes ) :
$>.ecxr
eax=00000001 ebx=00000000 ecx=00000401 edx=00000000 esi=049725b8 edi=00000002
eip=4e88159e esp=0a4efa38 ebp=0a4efa54 iopl=0 nv up ei pl nz ac pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010216
<Unloaded_mciwave.dll>+0x159e:
4e88159e ?? ???
$>~*kb
# 19 Id: 105c.28cc Suspend: 1 Teb: 7ef06000
Unfrozen
user32!NtUserGetMessage+0x15
user32!GetMessageA+0xa1
winmm!mciwindow+0x102
kernel32!BaseThreadInitThunk+0xe
ntdll!__RtlUserThreadStart+0x70
ntdll!_RtlUserThreadStart+0x1b
# 30 Id: 105c.15f8 Suspend: 0 Teb: 7ef1b000 Unfrozen
ntdll!ZwWaitForMultipleObjects+0x15
KERNELBASE!WaitForMultipleObjectsEx+0x100
kernel32!WaitForMultipleObjectsExImplementation+0xe0
kernel32!WaitForMultipleObjects+0x18
kernel32!WerpReportFaultInternal+0x186
kernel32!WerpReportFault+0x70
kernel32!BasepReportFault+0x20
kernel32!UnhandledExceptionFilter+0x1af
ntdll!__RtlUserThreadStart+0x62
ntdll!_EH4_CallFilterFunc+0x12
ntdll!_except_handler4+0x8e
ntdll!ExecuteHandler2+0x26
ntdll!ExecuteHandler+0x24
ntdll!RtlDispatchException+0x127
ntdll!KiUserExceptionDispatcher+0xf
WARNING: Frame IP not in any known module. Following frames may be wrong.
<Unloaded_mciwave.dll>+0x159e
# 31 Id: 105c.2310 Suspend: 1 Teb: 7ef00000 Unfrozen
user32!NtUserGetMessage+0x15
user32!GetMessageW+0x33
mciwave!TaskBlock+0x1d
mciwave!PlayFile+0xcb
mciwave!mwTask+0x98
winmm!mmStartTask+0x22
kernel32!BaseThreadInitThunk+0xe
ntdll!__RtlUserThreadStart+0x70
ntdll!_RtlUserThreadStart+0x1b:
$>!analyze -v
FAULTING_IP:
mciwave_4e880000!TaskBlock+1d
4e88159e ?? ???
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 4e88159e (mciwave_4e880000!TaskBlock+0x0000001d)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000008
Parameter[1]: 4e88159e
Attempt to execute non-executable address 4e88159e
PROCESS_NAME: Titan.vshost.exe
ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.
EXCEPTION_PARAMETER1: 00000008
EXCEPTION_PARAMETER2: 4e88159e
WRITE_ADDRESS: 4e88159e
FOLLOWUP_IP:
mciwave_4e880000!TaskBlock+1d
4e88159e ?? ???
MOD_LIST: <ANALYSIS/>
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
MANAGED_STACK: !dumpstack -EE
OS Thread Id: 0x15f8 (30)
====> Exception cxr#a4ef750
FAULTING_THREAD: 000015f8
BUGCHECK_STR: APPLICATION_FAULT_SOFTWARE_NX_FAULT_CODE_WRONG_SYMBOLS
PRIMARY_PROBLEM_CLASS: SOFTWARE_NX_FAULT_CODE
DEFAULT_BUCKET_ID: SOFTWARE_NX_FAULT_CODE
LAST_CONTROL_TRANSFER: from 4e881999 to 4e88159e
STACK_TEXT:
0a4efa54 4e881999 0a4efa88 078db198 078db1a4 mciwave_4e880000!TaskBlock+0x1d
0a4efa68 74370ae5 00038edc 00000000 00000000 mciwave_4e880000!mwTask+0x45
0a4efa88 7670338a 078db198 0a4efad4 76f99f72 winmm!mmStartTask+0x22
0a4efa94 76f99f72 078db198 79f84a28 00000000 kernel32!BaseThreadInitThunk+0xe
0a4efad4 76f99f45 74370ac3 078db198 00000000 ntdll!__RtlUserThreadStart+0x70
0a4efaec 00000000 74370ac3 078db198 00000000 ntdll!_RtlUserThreadStart+0x1b
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: mciwave!TaskBlock+1d
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: mciwave_4e880000
IMAGE_NAME: mciwave.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 4a5bcb4a
STACK_COMMAND: ~30s; .ecxr ; kb
FAILURE_BUCKET_ID: SOFTWARE_NX_FAULT_CODE_c0000005_mciwave.dll!TaskBlock
BUCKET_ID: APPLICATION_FAULT_SOFTWARE_NX_FAULT_CODE_WRONG_SYMBOLS_mciwave!TaskBlock+1d
Followup: MachineOwner
---------
Exception seems to happen in thread #30 in Unloaded_mciwave.dll, but I have no idea how to push further the debugging.. How can I get a better idea of what's going ??
How can I get what's happening between these two lines ?
ntdll!KiUserExceptionDispatcher+0xf
--> WARNING: Frame IP not in any known module. Following frames may be wrong.
<Unloaded_mciwave.dll>+0x159e
Thank you for your help in advance.
You should get more details by reloading the DLL in the Debugger.
For that you need to do:
lmvm mciwave.dll
start end module name
Unloaded modules:
e6510000 e6548000 mciwave.dll
Timestamp: Fri Oct 14 12:00:00 2011 (4E98E6E2)
Checksum: 0003E937
ImageSize: 00038000
You need to set up the Symbol and Exe-Path so the debugger can find the DLL and PDB (which shouldn't be a problem if you have it in your machine). Then you can do
.reload mciwave.dll=e6510000,00038000
DBGHELP: <path>\mciwave.dll - OK
Now if you do !analyze -v again, it should give you the correct call stack.

Access violation while running app via windbg

My application get access violation sometimes.
I runned application through windbg, and it stopped in the following function .
also tried _vscprintf instead of vsnprintf, and the result was same.
I 'm newbie about windbg.
Any help will be appreciated.
int tsk_sprintf_2(char** str, const char* format, va_list* ap)
{
int len = 0;
va_list ap2;
ap2 = *ap;
len = vsnprintf(0, 0, format, *ap); /*-> access violation in this point! */
*str = (char*)calloc(1, len+1);
vsnprintf(*str, len, format, ap2);
va_end(ap2);
return len;
}
==> the following are the result from windbg
MANAGED_STACK: !dumpstack -EE
OS Thread Id: 0x5b8 (22)
Current frame:
ChildEBP RetAddr Caller, Callee
PRIMARY_PROBLEM_CLASS: WRONG_SYMBOLS
BUGCHECK_STR: APPLICATION_FAULT_WRONG_SYMBOLS
LAST_CONTROL_TRANSFER: from 1026d3d8 to 102e14cf
STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
1d3cde7c 1026d3d8 1d3cdea8 0898eeeb 00000000 MSVCR100D!vcwprintf_s_l+0x52ef
1d3cded0 1026d46c 00000000 00000000 0898ee88 MSVCR100D!vsnprintf_l+0x158
1d3cdeec 0834d927 00000000 00000000 0898ee88 MSVCR100D!vsnprintf+0x1c
1d3cdfe8 1002891e 1d3ce0d0 0898ee88 1d3ce1e4 tinySAK!tsk_sprintf_2+0x57
1d3ce0f0 10028b77 09a16fe8 0898ee88 00000000 tinyWRAP!debug_xxx_cb+0x6e
1d3ce1ec 088b697b 09a16fe8 0898ee88 00000444 tinyWRAP!DDebugCallback::debug_info_cb+0x37
1d3cffb4 7c80b713 1cd10f90 1d2cfb44 7c947d9a tinyNET!tnet_transport_mainthread+0x1adb
1d3cffec 00000000 088a2aff 1cd10f90 00000000 KERNEL32!GetModuleFileNameA+0x1b4
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: msvcr100d!vcwprintf_s_l+52ef
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: MSVCR100D
IMAGE_NAME: MSVCR100D.dll
STACK_COMMAND: ~22s ; kb
BUCKET_ID: WRONG_SYMBOLS
FAILURE_BUCKET_ID: WRONG_SYMBOLS_c0000005_MSVCR100D.dll!vcwprintf_s_l
WATSON_STAGEONE_URL:
Followup: MachineOwner
---------
route.
You're attempting to print into a NULL pointer: len = vsnprintf(0, 0, format, *ap);; of course, it will crash. Send a valid address of output buffer as the first parameter and valid length as second.

Understanding Objective c enum declaration

From iPhone UIControl
UIControlEventAllTouchEvents = 0x00000FFF,
UIControlEventAllEditingEvents = 0x000F0000,
UIControlEventApplicationReserved = 0x0F000000,
UIControlEventSystemReserved = 0xF0000000,
UIControlEventAllEvents = 0xFFFFFFFF
Now I assume the UIControlEventApplication is the 'range' I can use to specify custom control events, but I have no idea how to do it properly. Only if I assign 0xF0000000 the control event will correctly fire. If I assign anything else (0xF0000001) the control event fires when it's not supposed to.
Some clarification:
enum {
UIBPMPickerControlEventBeginUpdate = 0x0F000000,
UIBPMPickerControlEventEndUpdate = // Which value do I use here?
};
My assumption of it being a range is based on the docs. Which say:
I assume this because the docs say: A range of control-event values available for application use.
Could anyone help me understand the type of enum declaration used in UIControl?
I would think 0x0F000000 is the 4 bits you have at your disposal for creating your own control events.
0x0F000000 = 00001111 00000000 00000000 00000000
So any combination of:
0x00000001<<27 = 00001000 00000000 00000000 00000000
0x00000001<<26 = 00000100 00000000 00000000 00000000
0x00000001<<25 = 00000010 00000000 00000000 00000000
0x00000001<<24 = 00000001 00000000 00000000 00000000
You can of course OR these together to create new ones:
0x00000001<<24 | 0x00000001<<25 = 00000011 00000000 00000000 00000000
So in your example:
enum {
UIBPMPickerControlEventBeginUpdate = 0x00000001<<24,
UIBPMPickerControlEventEndUpdate = 0x00000001<<25, ...
};
To use the enums you just do bitwise operations:
UIControlEventAllEditingEvents | UIControlEventApplicationReserved | UIControlEventApplicationReserved