8 Commits

Author SHA1 Message Date
xxnuo
88010e9aa7 fix(cld2): stack overflow - increase WASM stack size
The CLD2 WASM module has a stack size of only 8KB (TOTAL_STACK=8192), leading to stack overflow crashes when processing long texts.

Error Manifestation:
- Abort when processing 282-character mixed English and Chinese text
- Error message: `RuntimeError: Aborted()`
- Crash location: `detectLanguageWithCLD` calling CLD2

- **Makefile**: Increase TOTAL_STACK from 8192 (8KB) ​​to 65536 (64KB)
- An 8-fold increase is sufficient for language detection of complex texts.
- The WASM module size remains unchanged at 1.1MB.

- Input sanitization: Remove null bytes and control characters
- UTF-8 byte boundary truncation: 512-byte limit
- Enhanced error logging: Record crash context
- API request limit: 10MB JSON parsing limit

- `detectLanguageWithLength` method accepts explicit length
- WebIDL interface definition completed
- Temporarily disabled; using the original interface with input sanitization

fix: detectMultipleLanguages

fix: detectMultipleLanguages
2026-01-01 17:10:36 +08:00
xxnuo
3175917a7b fix: limit length of language detection
Truncate input text to avoid memory issues in WASM and improve performance.

1KB is sufficient for reliable language detection.

Create reproduce_cld.ts
2026-01-01 17:09:35 +08:00
xxnuo
62fa6d4ad1 fix(ui): serve 2026-01-01 16:58:52 +08:00
xxnuo
5c25b294d1 refactor: prepare using js
feat: update

remove python
2026-01-02 20:51:23 +08:00
xxnuo
178c2c4ef0 feat: add python test script 2025-11-09 22:21:28 +08:00
xxnuo
0a10df4860 feat: clean code 2025-11-02 05:07:27 +08:00
xxnuo
82f2933029 更新服务器及文档 2025-07-21 16:51:08 +08:00
xxnuo
f56312116e Init 2025-07-20 20:36:01 +08:00