issue_owner_repo
sequencelengths
2
2
issue_body
stringlengths
0
261k
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "libming", "libming" ]
on 0.4.8 (the latest version): there is a out-of-range left shift in the readUInt32 function (util/read.c), which can cause denial of service via a crafted swf file. src/util/read.c:181:26: runtime error: left shift of 128 by 24 places cannot be represented in type 'int' To reproduce the issue, compile libming with UBSAN "-fsanitize=undefined", then execute: listswf $POC The POC file can be downloaded from: https://github.com/ProbeFuzzer/poc/blob/master/libming/libming_0-4-8_listswf_integer-overflow_readUInt32.swf
integer overflow caused by out-of-range left shift in readUInt32 (util/read.c)
https://api.github.com/repos/libming/libming/issues/98/comments
4
2018-01-05T20:26:52Z
2018-01-17T10:17:30Z
https://github.com/libming/libming/issues/98
286,395,896
98
[ "libming", "libming" ]
on 0.4.8 (the latest version): there is a left shift of a negative value in the readSBits function (util/read.c), which can cause denial of service via a crafted swf file. src/util/read.c:110:14: runtime error: shift exponent -1 is negative To reproduce the issue, compile libming with UBSAN "-fsanitize=undefined", then execute: listswf $POC The POC file can be downloaded from: https://github.com/youwei1988/poc/blob/master/libming/libming_0-4-8_listswf_negative-shift-exponent_readSBits.swf
left shift of a negative value in readSBits (util/read.c)
https://api.github.com/repos/libming/libming/issues/97/comments
3
2018-01-04T04:40:44Z
2018-01-17T10:17:30Z
https://github.com/libming/libming/issues/97
285,880,303
97
[ "libming", "libming" ]
shows text pages without related content. and seems to be mirror of netsweng.com.
libming.org down/misconfigured?
https://api.github.com/repos/libming/libming/issues/95/comments
3
2017-12-04T22:17:29Z
2017-12-21T20:27:21Z
https://github.com/libming/libming/issues/95
279,171,158
95
[ "libming", "libming" ]
The POC is got from https://github.com/owl337/pocs/blob/master/libswf_POC2.rar Description: The debugging information is as follows: There is previous incorrect operation cause si->size too large that make malloc memory failure. It leads the program crash in outputtxt.c:2229 , the details is below. outputtxt.c:2228 buffer = malloc(si->Size+1);//si->Size is too large buffer is NULL,malloc failure outputtxt.c:2229 memset(buffer, 0, si->Size+1);//cause NULL pointer deference $gdb ./listswf (gdb) set args POC2 (gdb) r ... (gdb) bt (gdb) bt #0 __memset_sse2 () at ../sysdeps/x86_64/multiarch/../memset.S:78 #1 0x000000000040e0f3 in outputABC_STRING_INFO (si=<optimized out>) at outputtxt.c:2229 #2 outputStringConstant (abc=<optimized out>, strIndex=<optimized out>) at outputtxt.c:2449 #3 0x000000000040ec79 in outputABC_METADATA_INFO (abc=0x676250, mi=0x7ffff00020f8) at outputtxt.c:2563 #4 0x000000000040ff01 in outputABC_FILE (abc=0x676250) at outputtxt.c:2772 #5 0x000000000040b0ca in outputBlock (type=<optimized out>, blockp=0x676240, stream=<optimized out>) at outputtxt.c:2933 #6 0x00000000004120c6 in readMovie (f=<optimized out>) at main.c:277 #7 main (argc=<optimized out>, argv=<optimized out>) at main.c:350 Credits: This vulnerability is detected by team OWL337, with our custom fuzzer collAFL. Please contact [email protected] and [email protected] if you need more info about the team, the tool or the vulnerability.
There is crash in listswf tool of libming by a crafted input that will lead to a DoS damage.
https://api.github.com/repos/libming/libming/issues/86/comments
4
2017-06-23T14:17:45Z
2017-10-21T12:18:10Z
https://github.com/libming/libming/issues/86
238,155,782
86
[ "libming", "libming" ]
POC is got from https://github.com/owl337/pocs/blob/master/libswf_POC1.rar Description: The debugging information is as follows: $ ./listswf POC1 there is overflow in function readEncUInt30 that lead to malloc a large size of memory failure. It makes the program crash in pareser.c:3083, the details is below. parser.c:3080 nsset->Count = readEncUInt30(f);//return 15582466837 parser.c:3081 nsset->NS = malloc(sizeof(U30) * nsset->Count);// malloc failure, return NULL parser.c:3083 nsset->NS[i] = readEncUInt30(f); //cause NULL pointer DEF $gdb ./listswf (gdb) set args POC1 (gdb) r ... (gdb) bt #0 parseABC_NS_SET_INFO (f=<optimized out>, nsset=<optimized out>, f=<optimized out>) at parser.c:3083 #1 parseABC_CONSTANT_POOL (cpool=0x676258, f=0x676010) at parser.c:3191 #2 0x0000000000454d14 in parseABC_FILE (abcFile=0x676250, f=0x676010) at parser.c:3426 #3 0x00000000004558b4 in parseSWF_DOABC (f=0x676010, length=0) at parser.c:3481 #4 0x0000000000416672 in blockParse (f=0x676010, length=0, header=<optimized out>) at blocktypes.c:145 #5 0x0000000000411f79 in readMovie (f=0x676010) at main.c:265 #6 main (argc=<optimized out>, argv=<optimized out>) at main.c:350 Credits: This vulnerability is detected by team OWL337, with our custom fuzzer collAFL. Please contact [email protected] and [email protected] if you need more info about the team, the tool or the vulnerability.
There is crash in listswf tool of libming . A crafted input can lead to a DoS damage.
https://api.github.com/repos/libming/libming/issues/85/comments
5
2017-06-23T14:15:10Z
2017-10-12T09:20:14Z
https://github.com/libming/libming/issues/85
238,155,042
85
[ "libming", "libming" ]
On libming latest version, an invalid memory read was found in function OpCode . ``` #swftocxx $FILE out ================================================================= SEGV on unknown address 0x60dffffffff0 (pc 0x000000566254 bp 0x2028656c696877 sp 0x7ffda7ccab50 T0) ==20555==The signal is caused by a READ memory access. #0 0x566253 in OpCode /home/haojun/Downloads/libming-master/util/decompile.c:868:37 #1 0x566253 in isLogicalOp /home/haojun/Downloads/libming-master/util/decompile.c:1193 #2 0x566253 in decompileIF /home/haojun/Downloads/libming-master/util/decompile.c:2332 #3 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #4 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #5 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #6 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #7 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #8 0x7f1829051b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #9 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) SEGV /home/haojun/Downloads/libming-master/util/decompile.c:868:37 in OpCode ==20555==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/invalid-memory-read-in_OpCode Credit : ADLab of Venustech
invalid memory read in OpCode
https://api.github.com/repos/libming/libming/issues/84/comments
1
2017-06-08T16:37:37Z
2017-10-06T11:26:41Z
https://github.com/libming/libming/issues/84
234,586,855
84
[ "libming", "libming" ]
On libming latest version, a heap buffer overflow was found in function decompileCALLFUNCTION . ``` #swftocxx $FILE out ================================================================= heap-buffer-overflow on address 0x6120000002f0 at pc 0x0000005524b1 bp 0x7ffe6c0b9700 sp 0x7ffe6c0b96f8 READ of size 1 at 0x6120000002f0 thread T0 #0 0x5524b0 in decompileCALLFUNCTION /home/haojun/Downloads/libming-master/util/decompile.c:2864:2 #1 0x5524b0 in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3264 #2 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #3 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #4 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #5 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #6 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #7 0x7ff575a06b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #8 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) 0x6120000002f0 is located 40 bytes to the right of 264-byte region [0x6120000001c0,0x6120000002c8) allocated by thread T0 here: #0 0x4dff2d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5beb8c in parseSWF_DOACTION /home/haojun/Downloads/libming-master/util/parser.c:2428:3 #2 0x7ff575a06b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 heap-buffer-overflow /home/haojun/Downloads/libming-master/util/decompile.c:2864:2 in decompileCALLFUNCTION Shadow bytes around the buggy address: 0x0c247fff8000: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c247fff8010: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c247fff8020: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c247fff8030: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff8040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c247fff8050: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa[fa]fa 0x0c247fff8060: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff8070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff80a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==17349==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/heap-buffer-overflow-in_decompileCALLFUNCTION Credit : ADLab of Venustech
heap buffer overflow in decompileCALLFUNCTION
https://api.github.com/repos/libming/libming/issues/83/comments
1
2017-06-08T16:36:52Z
2017-10-11T08:41:33Z
https://github.com/libming/libming/issues/83
234,586,621
83
[ "libming", "libming" ]
On libming latest version, a heap buffer overflow was found in function OpCode . ``` #swftocxx $FILE out ================================================================= heap-buffer-overflow on address 0x612000000170 at pc 0x000000555cee bp 0x7ffcc35fb940 sp 0x7ffcc35fb938 READ of size 1 at 0x612000000170 thread T0 #0 0x555ced in OpCode /home/haojun/Downloads/libming-master/util/decompile.c:868:37 #1 0x555ced in decompileSETMEMBER /home/haojun/Downloads/libming-master/util/decompile.c:1699 #2 0x555ced in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3202 #3 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #4 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #5 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #6 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #7 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #8 0x7fa41f1c5b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #9 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) 0x612000000170 is located 40 bytes to the right of 264-byte region [0x612000000040,0x612000000148) allocated by thread T0 here: #0 0x4dff2d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5beb8c in parseSWF_DOACTION /home/haojun/Downloads/libming-master/util/parser.c:2428:3 #2 0x7fa41f1c5b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 heap-buffer-overflow /home/haojun/Downloads/libming-master/util/decompile.c:868:37 in OpCode Shadow bytes around the buggy address: 0x0c247fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff8000: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c247fff8020: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa[fa]fa 0x0c247fff8030: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff8040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff8050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==17016==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/heap-buffer-overflow-in_OpCode_by_decompileSETMEMBER Credit : ADLab of Venustech
heap buffer overflow in OpCode (via decompileSETMEMBER)
https://api.github.com/repos/libming/libming/issues/82/comments
6
2017-06-08T16:35:58Z
2017-10-06T11:26:40Z
https://github.com/libming/libming/issues/82
234,586,383
82
[ "libming", "libming" ]
On libming latest version, a heap buffer overflow was found in function OpCode . ``` #swftocxx $FILE out ================================================================= heap-buffer-overflow on address 0x6120000005f0 at pc 0x000000560490 bp 0x7ffdb7ed2610 sp 0x7ffdb7ed2608 READ of size 1 at 0x6120000005f0 thread T0 #0 0x56048f in OpCode /home/haojun/Downloads/libming-master/util/decompile.c:868:37 #1 0x56048f in decompileINCR_DECR /home/haojun/Downloads/libming-master/util/decompile.c:1474 #2 0x537f24 in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3222:10 #3 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #4 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #5 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #6 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #7 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #8 0x7f1423d73b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #9 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) 0x6120000005f0 is located 40 bytes to the right of 264-byte region [0x6120000004c0,0x6120000005c8) allocated by thread T0 here: #0 0x4dff2d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5beb8c in parseSWF_DOACTION /home/haojun/Downloads/libming-master/util/parser.c:2428:3 #2 0x7f1423d73b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 heap-buffer-overflow /home/haojun/Downloads/libming-master/util/decompile.c:868:37 in OpCode Shadow bytes around the buggy address: 0x0c247fff8060: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c247fff8070: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c247fff8080: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c247fff8090: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c247fff80b0: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa[fa]fa 0x0c247fff80c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff80d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff80e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff80f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==16682==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/heap-buffer-overflow-in_OpCode_by_decompileINCR_DECR_2 Credit : ADLab of Venustech
heap buffer overflow in OpCode (via decompileINCR_DECR)
https://api.github.com/repos/libming/libming/issues/81/comments
0
2017-06-08T16:34:13Z
2017-10-06T11:26:41Z
https://github.com/libming/libming/issues/81
234,585,973
81
[ "libming", "libming" ]
On libming latest version, a heap buffer overflow was found in function dcputs . ``` #swftocxx $FILE out ================================================================= heap-buffer-overflow on address 0x7fe82faff800 at pc 0x00000047d145 bp 0x7ffe86b6c620 sp 0x7ffe86b6bdd0 WRITE of size 45 at 0x7fe82faff800 thread T0 #0 0x47d144 in __interceptor_strcat /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:491 #1 0x5459fa in dcputs /home/haojun/Downloads/libming-master/util/decompile.c:104:2 #2 0x5459fa in decompileIMPLEMENTS /home/haojun/Downloads/libming-master/util/decompile.c:3094 #3 0x5459fa in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3375 #4 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #5 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #6 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #7 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #8 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #9 0x7fe83201bb34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #10 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) 0x7fe82faff800 is located 0 bytes to the right of 327680-byte region [0x7fe82faaf800,0x7fe82faff800) allocated by thread T0 here: #0 0x4e012d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x545984 in dcchkstr /home/haojun/Downloads/libming-master/util/decompile.c:92:9 #2 0x545984 in dcputs /home/haojun/Downloads/libming-master/util/decompile.c:103 #3 0x545984 in decompileIMPLEMENTS /home/haojun/Downloads/libming-master/util/decompile.c:3094 #4 0x545984 in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3375 heap-buffer-overflow /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:491 in __interceptor_strcat Shadow bytes around the buggy address: 0x0ffd85f57eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ffd85f57ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ffd85f57ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ffd85f57ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ffd85f57ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0ffd85f57f00:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffd85f57f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffd85f57f20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffd85f57f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffd85f57f40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffd85f57f50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==16605==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/heap-buffer-overflow-in_dcputs Credit : ADLab of Venustech
heap buffer overflow in dcputs
https://api.github.com/repos/libming/libming/issues/80/comments
5
2017-06-08T16:33:06Z
2017-12-05T16:30:09Z
https://github.com/libming/libming/issues/80
234,585,656
80
[ "libming", "libming" ]
On libming latest version, a heap buffer overflow was found in function OpCode . ``` #swftocxx $FILE out ================================================================= heap-buffer-overflow on address 0x6120000005f0 at pc 0x00000056035d bp 0x7ffefd922730 sp 0x7ffefd922728 READ of size 1 at 0x6120000005f0 thread T0 #0 0x56035c in OpCode /home/haojun/Downloads/libming-master/util/decompile.c:868:37 #1 0x56035c in decompileINCR_DECR /home/haojun/Downloads/libming-master/util/decompile.c:1440 #2 0x537f24 in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3222:10 #3 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #4 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #5 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #6 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #7 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #8 0x7ffb27480b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #9 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) 0x6120000005f0 is located 40 bytes to the right of 264-byte region [0x6120000004c0,0x6120000005c8) allocated by thread T0 here: #0 0x4dff2d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5beb8c in parseSWF_DOACTION /home/haojun/Downloads/libming-master/util/parser.c:2428:3 #2 0x7ffb27480b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 heap-buffer-overflow /home/haojun/Downloads/libming-master/util/decompile.c:868:37 in OpCode Shadow bytes around the buggy address: 0x0c247fff8060: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c247fff8070: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c247fff8080: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c247fff8090: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c247fff80b0: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa[fa]fa 0x0c247fff80c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff80d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff80e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff80f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==16464==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/heap-buffer-overflow-in_OpCode_by_decompileINCR_DECR Credit : ADLab of Venustech
heap buffer overflow in OpCode (via decompileINCR_DECR)
https://api.github.com/repos/libming/libming/issues/79/comments
0
2017-06-08T16:32:14Z
2017-10-06T11:26:41Z
https://github.com/libming/libming/issues/79
234,585,394
79
[ "libming", "libming" ]
On libming latest version, a null pointer dereference read was found in function stackswap . ``` #swftocxx $FILE out ================================================================= SEGV on unknown address 0x000000000000 (pc 0x000000545058 bp 0x603000000160 sp 0x7fffce29b5b0 T0) ==17155==The signal is caused by a READ memory access. ==17155==Hint: address points to the zero page. #0 0x545057 in stackswap /home/haojun/Downloads/libming-master/util/decompile.c:629:29 #1 0x545057 in decompileSTACKSWAP /home/haojun/Downloads/libming-master/util/decompile.c:1344 #2 0x545057 in decompileAction /home/haojun/Downloads/libming-master/util/decompile.c:3159 #3 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #4 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #5 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #6 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #7 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #8 0x7fd51244fb34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #9 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) SEGV /home/haojun/Downloads/libming-master/util/decompile.c:629:29 in stackswap ==17155==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/null-ptr-in_stackswap Credit : ADLab of Venustech
null pointer dereference in stackswap
https://api.github.com/repos/libming/libming/issues/78/comments
6
2017-06-08T16:30:19Z
2017-10-28T22:43:27Z
https://github.com/libming/libming/issues/78
234,584,883
78
[ "libming", "libming" ]
On libming latest version, an invalid memory read was found in function outputSWF_TEXT_RECORD . ``` #swftocxx $FILE out ================================================================= SEGV on unknown address 0x00000000000c (pc 0x00000052876c bp 0x000000000000 sp 0x7ffcaa1a7620 T0) ==15250==The signal is caused by a READ memory access. ==15250==Hint: address points to the zero page. #0 0x52876b in outputSWF_TEXT_RECORD /home/haojun/Downloads/libming-master/util/outputscript.c:1429:13 #1 0x52941d in outputSWF_DEFINETEXT2 /home/haojun/Downloads/libming-master/util/outputscript.c:1493:6 #2 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #3 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #4 0x7f086c2f7b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #5 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) SEGV /home/haojun/Downloads/libming-master/util/outputscript.c:1429:13 in outputSWF_TEXT_RECORD ==15250==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/invalid-memory-read-in_outputSWF_TEXT_RECORD Credit : ADLab of Venustech
invalid memory read in outputSWF_TEXT_RECORD
https://api.github.com/repos/libming/libming/issues/77/comments
3
2017-06-08T16:29:18Z
2017-11-24T20:36:17Z
https://github.com/libming/libming/issues/77
234,584,613
77
[ "libming", "libming" ]
On libming latest version, a heap buffer overflow was found in function decompileIF. ``` #swftocxx $FILE out ================================================================= heap-buffer-overflow on address 0x6020000000a0 at pc 0x000000570171 bp 0x7fffe4c1cbe0 sp 0x7fffe4c1cbd8 READ of size 1 at 0x6020000000a0 thread T0 #0 0x570170 in decompileIF /home/haojun/Downloads/libming-master/util/decompile.c:2369:79 #1 0x5875eb in decompileActions /home/haojun/Downloads/libming-master/util/decompile.c:3401:6 #2 0x5875eb in decompile5Action /home/haojun/Downloads/libming-master/util/decompile.c:3423 #3 0x52a0c5 in outputSWF_DOACTION /home/haojun/Downloads/libming-master/util/outputscript.c:1548:29 #4 0x531311 in readMovie /home/haojun/Downloads/libming-master/util/main.c:277:4 #5 0x531311 in main /home/haojun/Downloads/libming-master/util/main.c:350 #6 0x7f7029da9b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #7 0x41ae7b in _start (/home/haojun/Downloads/libming-afl-build/bin/swftocxx+0x41ae7b) 0x6020000000a0 is located 12 bytes to the right of 4-byte region [0x602000000090,0x602000000094) allocated by thread T0 here: #0 0x4dfd76 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5d42e0 in readBytes /home/haojun/Downloads/libming-master/util/read.c:228:17 #2 0x7f7029da9b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 heap-buffer-overflow /home/haojun/Downloads/libming-master/util/decompile.c:2369:79 in decompileIF Shadow bytes around the buggy address: 0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff8000: fa fa 00 fa fa fa 02 fa fa fa 00 04 fa fa 01 fa =>0x0c047fff8010: fa fa 04 fa[fa]fa 00 03 fa fa 07 fa fa fa 01 fa 0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==15153==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/heap-buffer-overflow-in_decompileIF Credit : ADLab of Venustech
heap buffer overflow in decompileIF
https://api.github.com/repos/libming/libming/issues/76/comments
6
2017-06-08T16:27:53Z
2017-10-06T09:51:54Z
https://github.com/libming/libming/issues/76
234,584,226
76
[ "libming", "libming" ]
On libming latest version, a global buffer overflow was found in function printMP3Headers. ``` #listmp3 $FILE global-buffer-overflow on address 0x00000074ad3c at pc 0x000000515d76 bp 0x7ffd9e6b9250 sp 0x7ffd9e6b9248 READ of size 4 at 0x00000074ad3c thread T0 #0 0x515d75 in printMP3Headers /usr/include/bits/stdio.h:81:25 #1 0x515f03 in main /home/haojun/Downloads/libming-master/util/listmp3.c:209:3 #2 0x7f1d4bd07b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 #3 0x41ab8b in _start (/home/haojun/Downloads/libming-afl-build/bin/listmp3+0x41ab8b) 0x00000074ad3c is located 36 bytes to the left of global variable 'mp2l23_bitrate_table' defined in 'listmp3.c:37:5' (0x74ad60) of size 60 0x00000074ad3c is located 0 bytes to the right of global variable 'mp2l1_bitrate_table' defined in 'listmp3.c:34:5' (0x74ad00) of size 60 global-buffer-overflow /usr/include/bits/stdio.h:81:25 in printMP3Headers Shadow bytes around the buggy address: 0x0000800e1550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800e1560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800e1570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800e1580: 00 00 00 04 f9 f9 f9 f9 00 00 00 00 00 00 00 04 0x0000800e1590: f9 f9 f9 f9 00 00 00 00 00 00 00 04 f9 f9 f9 f9 =>0x0000800e15a0: 00 00 00 00 00 00 00[04]f9 f9 f9 f9 00 00 00 00 0x0000800e15b0: 00 00 00 04 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x0000800e15c0: 00 04 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x0000800e15d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800e15e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800e15f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==24629==ABORTING ``` testcase : https://github.com/bestshow/p0cs/blob/master/global-buffer-overflow_in_printMP3Headers Credit : ADLab of Venustech
global buffer overflow in printMP3Headers
https://api.github.com/repos/libming/libming/issues/75/comments
3
2017-06-07T14:59:00Z
2018-01-10T12:19:41Z
https://github.com/libming/libming/issues/75
234,239,675
75
[ "libming", "libming" ]
On libming latest version, a memory leak was found in function cws2fws (in main.c:111). ``` #listswf $FILE ================================================================= Direct leak of 2676 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x543350 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:111:15 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f8291a2ab34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 2635 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5431b3 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:101:13 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f8291a2ab34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 2564 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5efe10 in readBytes /home/haojun/Downloads/libming-master/util/read.c:228:17 Direct leak of 576 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5bf458 in parseSWF_SHAPEWITHSTYLE /home/haojun/Downloads/libming-master/util/parser.c:882:49 #2 0x5d7315 in parseSWF_DEFINESHAPE3 /home/haojun/Downloads/libming-master/util/parser.c:2259:3 Direct leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5bf205 in parseSWF_FILLSTYLEARRAY /home/haojun/Downloads/libming-master/util/parser.c:620:23 #2 0x5bf205 in parseSWF_SHAPEWITHSTYLE /home/haojun/Downloads/libming-master/util/parser.c:867 #3 0x5d7315 in parseSWF_DEFINESHAPE3 /home/haojun/Downloads/libming-master/util/parser.c:2259:3 Direct leak of 256 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5f004f in readString /home/haojun/Downloads/libming-master/util/read.c:243:17 Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5d7f66 in parseSWF_DEFINESPRITE /home/haojun/Downloads/libming-master/util/parser.c:2312:5 Direct leak of 6 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5d7eae in parseSWF_DEFINESPRITE /home/haojun/Downloads/libming-master/util/parser.c:2310:5 Direct leak of 1 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5b9a1a in parseSWF_LINESTYLEARRAY /home/haojun/Downloads/libming-master/util/parser.c:684:25 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5e1279 in parseSWF_SHOWFRAME /home/haojun/Downloads/libming-master/util/parser.c:2813:3 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5dae99 in parseSWF_END /home/haojun/Downloads/libming-master/util/parser.c:2469:3 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5ddab4 in parseSWF_PLACEOBJECT2 /home/haojun/Downloads/libming-master/util/parser.c:2633:3 9794 byte(s) leaked in 12 allocation(s). ``` testcase : https://github.com/bestshow/p0cs/blob/master/memory-leak-in_cws2fws_111 Credit : ADLab of Venustech
memory leak in cws2fws (main.c:111)
https://api.github.com/repos/libming/libming/issues/74/comments
0
2017-06-07T14:57:40Z
2017-06-07T14:57:40Z
https://github.com/libming/libming/issues/74
234,239,218
74
[ "libming", "libming" ]
On libming latest version, a memory leak was found in function cws2fws (in main.c:101). ``` #listswf $FILE ================================================================= Direct leak of 2363 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5431b3 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:101:13 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f0606636b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 2360 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x543350 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:111:15 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f0606636b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 2243 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5efe10 in readBytes /home/haojun/Downloads/libming-master/util/read.c:228:17 Direct leak of 576 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5bf458 in parseSWF_SHAPEWITHSTYLE /home/haojun/Downloads/libming-master/util/parser.c:882:49 #2 0x5d7315 in parseSWF_DEFINESHAPE3 /home/haojun/Downloads/libming-master/util/parser.c:2259:3 Direct leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5bf205 in parseSWF_FILLSTYLEARRAY /home/haojun/Downloads/libming-master/util/parser.c:620:23 #2 0x5bf205 in parseSWF_SHAPEWITHSTYLE /home/haojun/Downloads/libming-master/util/parser.c:867 #3 0x5d7315 in parseSWF_DEFINESHAPE3 /home/haojun/Downloads/libming-master/util/parser.c:2259:3 Direct leak of 256 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5f004f in readString /home/haojun/Downloads/libming-master/util/read.c:243:17 Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5d7f66 in parseSWF_DEFINESPRITE /home/haojun/Downloads/libming-master/util/parser.c:2312:5 Direct leak of 6 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5d7eae in parseSWF_DEFINESPRITE /home/haojun/Downloads/libming-master/util/parser.c:2310:5 Direct leak of 1 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5b9a1a in parseSWF_LINESTYLEARRAY /home/haojun/Downloads/libming-master/util/parser.c:684:25 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5e1279 in parseSWF_SHOWFRAME /home/haojun/Downloads/libming-master/util/parser.c:2813:3 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5dae99 in parseSWF_END /home/haojun/Downloads/libming-master/util/parser.c:2469:3 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5ddab4 in parseSWF_PLACEOBJECT2 /home/haojun/Downloads/libming-master/util/parser.c:2633:3 8885 byte(s) leaked in 12 allocation(s). ``` testcase : https://github.com/bestshow/p0cs/blob/master/memory-leak-in_cws2fws_101 Credit : ADLab of Venustech
memory leak in cws2fws (main.c:101)
https://api.github.com/repos/libming/libming/issues/73/comments
0
2017-06-07T14:56:46Z
2017-06-07T14:56:46Z
https://github.com/libming/libming/issues/73
234,238,923
73
[ "libming", "libming" ]
On libming latest version, a memory leak was found in function parseSWF_DOACTION . ``` #listswf $FILE ================================================================= Direct leak of 160 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5da8b1 in parseSWF_DOACTION /home/haojun/Downloads/libming-master/util/parser.c:2435:43 Direct leak of 28 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x543350 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:111:15 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f85ef782b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 27 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5431b3 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:101:13 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f85ef782b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 215 byte(s) leaked in 3 allocation(s). ``` testcase : https://github.com/bestshow/p0cs/blob/master/memory-leak-in_parseSWF_DOACTION Credit : ADLab of Venustech
memory leak in parseSWF_DOACTION
https://api.github.com/repos/libming/libming/issues/72/comments
3
2017-06-07T14:55:00Z
2019-10-03T07:11:30Z
https://github.com/libming/libming/issues/72
234,238,272
72
[ "libming", "libming" ]
On libming latest version, a memory leak was found in function parseSWF_SHAPEWITHSTYLE. ``` #listswf $FILE Direct leak of 576 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5bf458 in parseSWF_SHAPEWITHSTYLE /home/haojun/Downloads/libming-master/util/parser.c:882:49 #2 0x5d7315 in parseSWF_DEFINESHAPE3 /home/haojun/Downloads/libming-master/util/parser.c:2259:3 Direct leak of 410 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x543350 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:111:15 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f8b1e9e3b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 384 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5431b3 in cws2fws /home/haojun/Downloads/libming-master/util/main.c:101:13 #2 0x5444c6 in readMovieHeader /home/haojun/Downloads/libming-master/util/main.c:198:18 #3 0x5444c6 in main /home/haojun/Downloads/libming-master/util/main.c:346 #4 0x7f8b1e9e3b34 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:274 Direct leak of 307 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5efe10 in readBytes /home/haojun/Downloads/libming-master/util/read.c:228:17 Direct leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5bf205 in parseSWF_FILLSTYLEARRAY /home/haojun/Downloads/libming-master/util/parser.c:620:23 #2 0x5bf205 in parseSWF_SHAPEWITHSTYLE /home/haojun/Downloads/libming-master/util/parser.c:867 #3 0x5d7315 in parseSWF_DEFINESHAPE3 /home/haojun/Downloads/libming-master/util/parser.c:2259:3 Direct leak of 256 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5f004f in readString /home/haojun/Downloads/libming-master/util/read.c:243:17 Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5d7f66 in parseSWF_DEFINESPRITE /home/haojun/Downloads/libming-master/util/parser.c:2312:5 Direct leak of 6 byte(s) in 1 object(s) allocated from: #0 0x4e004d in realloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:79 #1 0x5d7eae in parseSWF_DEFINESPRITE /home/haojun/Downloads/libming-master/util/parser.c:2310:5 Direct leak of 1 byte(s) in 1 object(s) allocated from: #0 0x4dfc96 in malloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66 #1 0x5b9a1a in parseSWF_LINESTYLEARRAY /home/haojun/Downloads/libming-master/util/parser.c:684:25 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5dae99 in parseSWF_END /home/haojun/Downloads/libming-master/util/parser.c:2469:3 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5e1279 in parseSWF_SHOWFRAME /home/haojun/Downloads/libming-master/util/parser.c:2813:3 Indirect leak of 264 byte(s) in 1 object(s) allocated from: #0 0x4dfe4d in calloc /home/haojun/Downloads/llvm-clang/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x5ddab4 in parseSWF_PLACEOBJECT2 /home/haojun/Downloads/libming-master/util/parser.c:2633:3 3020 byte(s) leaked in 12 allocation(s). ``` testcase : https://github.com/bestshow/p0cs/blob/master/memory-leak-in_parseSWF_SHAPEWITHSTYLE Credit : ADLab of Venustech
memory leak in parseSWF_SHAPEWITHSTYLE
https://api.github.com/repos/libming/libming/issues/71/comments
4
2017-06-07T14:54:04Z
2019-10-03T07:14:14Z
https://github.com/libming/libming/issues/71
234,237,946
71
[ "libming", "libming" ]
please see the following advisory: http://seclists.org/fulldisclosure/2017/May/106
readString denial of service
https://api.github.com/repos/libming/libming/issues/70/comments
5
2017-06-01T08:11:49Z
2017-06-06T18:23:12Z
https://github.com/libming/libming/issues/70
232,798,278
70
[ "libming", "libming" ]
Dear all, The following bugs were found with AFLGo, a directed version of the fuzzer AFL / AFLFast. Thanks also to Van-Thuan Pham. This issues are related to #58. The Libming utility listswf crashes due to a heap-based buffer overflow in the function parseSWF_RGBA and several other functions in parser.c. AddressSanitizer flags them as invalid writes "of size 1" but the heap can be actually be written to multiple times (e.g., in each line of parser.c:58-71). The overflows are caused by a pointer behind the bounds of a statically allocated array of structs of type SWF_GRADIENTRECORD. Sample crash-inducing input: [libming1.swf.zip](https://github.com/libming/libming/files/857651/libming1.swf.zip) ``` $ util/listswf libming1.swf read.c:109:14: runtime error: shift exponent -1 is negative read.c:110:20: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' read.c:110:16: runtime error: signed integer overflow: 1389485020 - -2147483648 cannot be represented in type 'int' 205 gradients in SWF_MORPHGRADiENT, expected a max of 8parser.c:786:40: runtime error: index 9 out of bounds for type 'SWF_MORPHGRADIENTRECORD [8]' 203 gradients in SWF_MORPHGRADiENT, expected a max of 8================================================================= ==179946==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62e00000b298 at pc 0x0000005b1be8 bp 0x7ffc849e8990 sp 0x7ffc849e8988 WRITE of size 1 at 0x62e00000b298 thread T0 #0 0x5b1be7 in parseSWF_RGBA /home/ubuntu/subjects/build-asan/libming/util/parser.c:68:14 #1 0x5f004a in parseSWF_MORPHGRADIENTRECORD /home/ubuntu/subjects/build-asan/libming/util/parser.c:771:3 #2 0x5f0c1f in parseSWF_MORPHGRADIENT /home/ubuntu/subjects/build-asan/libming/util/parser.c:786:5 #3 0x5ee190 in parseSWF_MORPHFILLSTYLE /home/ubuntu/subjects/build-asan/libming/util/parser.c:802:7 #4 0x5f1bbe in parseSWF_MORPHFILLSTYLES /home/ubuntu/subjects/build-asan/libming/util/parser.c:829:7 #5 0x634ee5 in parseSWF_DEFINEMORPHSHAPE /home/ubuntu/subjects/build-asan/libming/util/parser.c:2185:3 #6 0x543923 in blockParse /home/ubuntu/subjects/build-asan/libming/util/blocktypes.c:145:14 #7 0x52b2a9 in readMovie /home/ubuntu/subjects/build-asan/libming/util/main.c:265:11 #8 0x528f82 in main /home/ubuntu/subjects/build-asan/libming/util/main.c:350:2 #9 0x7ff0c21cdf44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 #10 0x4bdf5c in _start (/home/ubuntu/subjects/build-asan/libming/util/listswf+0x4bdf5c) 0x62e00000b298 is located 0 bytes to the right of 44696-byte region [0x62e000000400,0x62e00000b298) allocated by thread T0 here: #0 0x4a0a40 in calloc (/home/ubuntu/subjects/build-asan/libming/util/listswf+0x4a0a40) #1 0x5f17b2 in parseSWF_MORPHFILLSTYLES /home/ubuntu/subjects/build-asan/libming/util/parser.c:826:28 #2 0x634ee5 in parseSWF_DEFINEMORPHSHAPE /home/ubuntu/subjects/build-asan/libming/util/parser.c:2185:3 #3 0x543923 in blockParse /home/ubuntu/subjects/build-asan/libming/util/blocktypes.c:145:14 #4 0x52b2a9 in readMovie /home/ubuntu/subjects/build-asan/libming/util/main.c:265:11 #5 0x528f82 in main /home/ubuntu/subjects/build-asan/libming/util/main.c:350:2 #6 0x7ff0c21cdf44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 SUMMARY: AddressSanitizer: heap-buffer-overflow /home/ubuntu/subjects/build-asan/libming/util/parser.c:68 parseSWF_RGBA ``` The bugs are fixed by the following patch (preventing the pointer behind the array bounds): ``` diff --git a/util/parser.c b/util/parser.c index 96b1232..b8662ca 100644 --- a/util/parser.c +++ b/util/parser.c @@ -439,6 +439,7 @@ parseSWF_FOCALGRADIENT (FILE * f, struct SWF_FOCALGRADIENT *gradient, int level) gradient->NumGradients = readBits (f, 4); if(gradient->NumGradients > 15) { fprintf(stderr, "%d gradients in SWF_FOCALGRADIENT, expected a max of 15\n", gradient->NumGradients ); + gradient->NumGradients = 15; /*exit(1);*/ } @@ -457,6 +458,7 @@ parseSWF_GRADIENT (FILE * f, struct SWF_GRADIENT *gradient, int level) gradient->NumGradients = readBits (f, 4); if((gradient->NumGradients > 8 && level < 4) || (gradient->NumGradients > 15 && level == 4)) { fprintf(stderr, "%d gradients in SWF_GRADiENT, expected a max of %d\n", gradient->NumGradients, level<4 ? 8 : 15 ); + gradient->NumGradients = 8; /*exit(1);*/ } @@ -780,6 +782,7 @@ parseSWF_MORPHGRADIENT (FILE * f, struct SWF_MORPHGRADIENT *gradient) gradient->NumGradients = readUInt8 (f); if( gradient->NumGradients > 8 ) { fprintf(stderr, "%d gradients in SWF_MORPHGRADiENT, expected a max of 8", gradient->NumGradients); + gradient->NumGradients = 8; /*exit(1);*/ } for (i = 0; i < gradient->NumGradients; i++) ``` Best regards, - Marcel --- Marcel Böhme Senior Research Fellow TSUNAMi Research Centre National University of Singapore
Heap overflows in parser.c
https://api.github.com/repos/libming/libming/issues/68/comments
3
2017-03-21T10:37:48Z
2017-04-07T08:08:39Z
https://github.com/libming/libming/issues/68
215,693,391
68
[ "libming", "libming" ]
Would be great to have a new release to test if the security bugs were really fixed or not. Also, before make the new release would be awesome if #55 and #56 are fixed. Thanks.
please issue a new release
https://api.github.com/repos/libming/libming/issues/67/comments
2
2017-02-03T11:29:43Z
2017-04-07T08:11:46Z
https://github.com/libming/libming/issues/67
205,134,223
67
[ "libming", "libming" ]
The default error handler now exits which is not ideal for a shared library: ``` void error_default(const char *msg, ...) { va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); exit(EXIT_FAILURE); } ``` Other parts of the code assume that when errors are reported the execution of the code stops. This may allow memory corruption when the error handler is replaced with something that does not exit().
Please report errors from the library instead of exit()-ing
https://api.github.com/repos/libming/libming/issues/66/comments
0
2017-01-30T12:26:09Z
2017-01-30T12:26:09Z
https://github.com/libming/libming/issues/66
203,997,000
66
[ "libming", "libming" ]
To fix a few CVEs I have fixed several readUInt*() (e.g.readUInt32() ) functions to return EOF, but other variants returning signed values are not changed since EOF (-1) is a valid unsigned int value. The returned values of readUInt*() are also not checked for validity very often in the code and they are implemented 3 times with little variation. To improve the robustness of the code I believe there is a need for a lot more error checking and propagation.
Please improve error handling
https://api.github.com/repos/libming/libming/issues/65/comments
0
2017-01-30T12:22:27Z
2017-01-30T12:22:27Z
https://github.com/libming/libming/issues/65
203,996,274
65
[ "libming", "libming" ]
Hi, Thank you for libming. I afraid the project's homepage is down: http://www.libming.org There is also little activity here on GitHub, PR-s are not accepted nor commented on. Please resurrect the development within the original team or at least give merge rights to some people sending PR-s. There is interest in keeping the project alive but this needs at least someone accepting patches. Cheers, Balint
Dead homepage. Dead project?
https://api.github.com/repos/libming/libming/issues/62/comments
5
2016-12-29T17:43:37Z
2017-01-30T17:31:31Z
https://github.com/libming/libming/issues/62
198,043,270
62
[ "libming", "libming" ]
On 0.4.7: ``` # listswf $FILE header indicates a filesize of 7917 but filesize is 187 File version: 100 File size: 187 Frame size: (8452,8981)x(-4096,0) Frame rate: 67.851562 / sec. Total frames: 16387 Stream out of sync after parse of blocktype 2 (SWF_DEFINESHAPE). 166 but expecting 23. Offset: 21 (0x0015) Block type: 2 (SWF_DEFINESHAPE) Block length: 0 CharacterID: 55319 RECT: (-2048,140)x(0,-1548):12 FillStyleArray: FillStyleCount: 18 FillStyleCountExtended: 0 FillStyle: FillStyleType: 0 RGBA: ( 0, 1,9a,ff) FillStyle: FillStyleType: 7f FillStyle: FillStyleType: b FillStyle: FillStyleType: fb FillStyle: FillStyleType: 82 FillStyle: FillStyleType: 24 FillStyle: FillStyleType: 67 FillStyle: FillStyleType: 67 FillStyle: FillStyleType: 18 FillStyle: FillStyleType: 9d FillStyle: FillStyleType: 6d FillStyle: FillStyleType: d7 FillStyle: FillStyleType: 97 FillStyle: FillStyleType: 1 FillStyle: FillStyleType: 26 FillStyle: FillStyleType: 1a FillStyle: FillStyleType: 17 FillStyle: FillStyleType: 9a LineStyleArray: LineStyleCount: 19 LineStyle: Width: 1722 RGBA: (7a,38,df,ff) LineStyle: Width: 42742 RGBA: ( 0, 0, 0,ff) LineStyle: Width: 70 RGBA: (10,91,64,ff) LineStyle: Width: 37031 RGBA: (e7,c7,15,ff) LineStyle: Width: 9591 RGBA: (dc,ee,81,ff) LineStyle: Width: 4249 RGBA: ( 0,ee,ed,ff) LineStyle: Width: 60909 RGBA: (ed,ed,ed,ff) LineStyle: Width: 60909 RGBA: (ed,ed,ed,ff) LineStyle: Width: 60909 RGBA: (ed,ed,ed,ff) LineStyle: Width: 60909 RGBA: (ed,ed,ed,ff) LineStyle: Width: 60909 RGBA: (ed,ed,ed,ff) LineStyle: Width: 60909 RGBA: (ed,ed,a7,ff) LineStyle: Width: 42919 RGBA: (a7,a7,9c,ff) LineStyle: Width: 40092 RGBA: (9c,9c,9c,ff) LineStyle: Width: 32156 RGBA: (9c,bc,9c,ff) LineStyle: Width: 33948 RGBA: (9c,9c,9c,ff) LineStyle: Width: 26404 RGBA: ( 0, c,80,ff) LineStyle: Width: 42752 RGBA: (a7, 2, 2,ff) LineStyle: Width: 514 RGBA: (c6, 2, 0,ff) NumFillBits: 11 NumLineBits: 13 Curved EdgeRecord: 9 Control(-145,637) Anchor(-735,-1010) Curved EdgeRecord: 7 Control(-177,156) Anchor(16,32) StyleChangeRecord: StateNewStyles: 0 StateLineStyle: 1 StateFillStyle1: 0 StateFillStyle0: 0 StateMoveTo: 0 LineStyle: 257 ENDSHAPE Offset: 23 (0x0017) Block type: 864 (Unknown Block Type) Block length: 23 0000: 64 00 00 00 46 4f a3 12 00 00 01 9a 7f 0b fb 82 d...FO.. ....... 0010: 24 67 67 18 9d 6d d7 $gg..m. Offset: 48 (0x0030) Block type: 6 (SWF_DEFINEBITS) Block length: 23 CharacterID: 6694 Offset: 73 (0x0049) Block type: 87 (SWF_DEFINEBINARYDATA) Block length: 7 0000: ASAN:DEADLYSIGNAL ================================================================= ==27703==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000059d2ff bp 0x7ffe859e6fc0 sp 0x7ffe859e6f50 T0) ==27703==The signal is caused by a READ memory access. ==27703==Hint: address points to the zero page. #0 0x59d2fe in dumpBuffer /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/read.c:441:23 #1 0x51c305 in outputSWF_UNKNOWNBLOCK /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/outputtxt.c:2870:3 #2 0x51c305 in outputBlock /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/outputtxt.c:2937 #3 0x527e83 in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:277:4 #4 0x527e83 in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #5 0x7f0186c4461f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 #6 0x419b38 in _init (/usr/bin/listswf+0x419b38) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/read.c:441:23 in dumpBuffer ==27703==ABORTING ``` Testcase: https://github.com/asarubbo/poc/blob/master/00078-libming-nullptr-dumpBuffer
listswf: NULL pointer dereference in dumpBuffer (read.c)
https://api.github.com/repos/libming/libming/issues/60/comments
0
2016-11-24T11:19:03Z
2017-01-30T08:57:44Z
https://github.com/libming/libming/issues/60
191,494,919
60
[ "libming", "libming" ]
On 0.4.7: ``` # listswf $FILE header indicates a filesize of 18446744072727653119 but filesize is 165 File version: 128 File size: 165 Frame size: (-4671272,-4672424)x(-4703645,4404051) Frame rate: 142.777344 / sec. Total frames: 2696 Offset: 25 (0x0019) Block type: 67 (Unknown Block Type) Block length: 24 0000: 00 97 6b ba 06 91 6f 98 7a 38 01 00 a6 e3 80 2c ..k...o. z8....., 0010: 77 25 d3 d3 1a 19 80 7f w%..... Offset: 51 (0x0033) Block type: 24 (SWF_PROTECT) Block length: 1 ================================================================= ==3132==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000eff1 at pc 0x000000499d10 bp 0x7ffc34a55e10 sp 0x7ffc34a555c0 READ of size 2 at 0x60200000eff1 thread T0 #0 0x499d0f in printf_common /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_format.inc:545 #1 0x499a9d in printf_common /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_format.inc:545 #2 0x49abfa in __interceptor_vfprintf /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1321 #3 0x509dd7 in vprintf /usr/include/bits/stdio.h:38:10 #4 0x509dd7 in _iprintf /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/outputtxt.c:144 #5 0x51f1f5 in outputSWF_PROTECT /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/outputtxt.c:1873:5 #6 0x51c35b in outputBlock /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/outputtxt.c:2933:4 #7 0x527e83 in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:277:4 #8 0x527e83 in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #9 0x7f0f1ff6861f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 #10 0x419b38 in _init (/usr/bin/listswf+0x419b38) 0x60200000eff1 is located 0 bytes to the right of 1-byte region [0x60200000eff0,0x60200000eff1) allocated by thread T0 here: #0 0x4d28f8 in malloc /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64 #1 0x59b9ab in readBytes /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/read.c:201:17 #2 0x592864 in parseSWF_PROTECT /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:2668:26 #3 0x5302cb in blockParse /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/blocktypes.c:145:14 #4 0x527d4f in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:265:11 #5 0x527d4f in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #6 0x7f0f1ff6861f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 SUMMARY: AddressSanitizer: heap-buffer-overflow /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_format.inc:545 in printf_common Shadow bytes around the buggy address: 0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff9df0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa[01]fa 0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==3132==ABORTING ``` Testcase: https://github.com/asarubbo/poc/blob/master/00077-libming-heapoverflow-_iprintf
listswf: heap-based buffer overflow in _iprintf (outputtxt.c)
https://api.github.com/repos/libming/libming/issues/59/comments
0
2016-11-24T11:16:07Z
2017-01-30T08:57:44Z
https://github.com/libming/libming/issues/59
191,494,349
59
[ "libming", "libming" ]
On 0.4.7: ``` # listswf $FILE header indicates a filesize of 237 but filesize is 191 File version: 6 File size: 191 Frame size: (3493,-4999)x(-5076,9541) Frame rate: 39.625000 / sec. Total frames: 33032 Stream out of sync after parse of blocktype 18 (SWF_SOUNDSTREAMHEAD). 29 but expecting 27. Offset: 21 (0x0015) Block type: 18 (SWF_SOUNDSTREAMHEAD) Block length: 4 PlaybackSoundRate 5.5 kHz PlaybackSoundSize 16 bit PlaybackSoundType stereo StreamSoundCompression MP3 StreamSoundRate 44 kHz StreamSoundSize error StreamSoundType mono StreamSoundSampleCount 10838 LatencySeek 53805 Offset: 27 (0x001b) Block type: 840 (Unknown Block Type) Block length: 45 0000: 2c 37 a6 30 3a 29 ab d2 54 6e 8e 88 0a f5 1b 6a ,7.0:).. Tn.....j 0010: a2 f7 a1 a3 a3 a1 e1 06 70 04 8e 90 82 03 40 47 ........ p.....@G 0020: e0 30 c6 a6 83 57 ac 46 4f 8a 91 76 07 .0...W.F O..v. Offset: 74 (0x004a) Block type: 514 (Unknown Block Type) Block length: 27 0000: b2 05 12 c2 3e 3a 01 20 d8 a7 7d 63 01 11 5c fc ....>:. ..}c..\. 0010: 15 8e 90 43 8f 64 8e 58 49 ad 95 ...C.d.X I.. Offset: 103 (0x0067) Block type: 297 (Unknown Block Type) Block length: 20 0000: 27 79 a2 e3 2c 56 2a 2d d2 2c 37 a6 30 3a 29 ab 'y..,V*- .,7.0:). 0010: d2 54 6e 8e .Tn. skipping 8 bytes Offset: 125 (0x007d) Block type: 42 (SWF_DEFINETEXTFORMAT) Block length: 8 255 gradients in SWF_MORPHGRADiENT, expected a max of 8================================================================= ==31250==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62400000df10 at pc 0x00000057f342 bp 0x7ffe24b21ef0 sp 0x7ffe24b21ee8 WRITE of size 1 at 0x62400000df10 thread T0 #0 0x57f341 in parseSWF_RGBA /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:66:12 #1 0x57f341 in parseSWF_MORPHGRADIENTRECORD /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:746 #2 0x57f341 in parseSWF_MORPHGRADIENT /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:761 #3 0x57e25a in parseSWF_MORPHFILLSTYLE /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:777:7 #4 0x58b9b8 in parseSWF_MORPHFILLSTYLES /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:804:7 #5 0x58b9b8 in parseSWF_DEFINEMORPHSHAPE /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:2098 #6 0x5302cb in blockParse /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/blocktypes.c:145:14 #7 0x527d4f in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:265:11 #8 0x527d4f in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #9 0x7f39cc7da61f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 #10 0x419b38 in _init (/usr/bin/listswf+0x419b38) 0x62400000df10 is located 0 bytes to the right of 7696-byte region [0x62400000c100,0x62400000df10) allocated by thread T0 here: #0 0x4d2af5 in calloc /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:72 #1 0x58b90a in parseSWF_MORPHFILLSTYLES /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:801:28 #2 0x58b90a in parseSWF_DEFINEMORPHSHAPE /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:2098 #3 0x5302cb in blockParse /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/blocktypes.c:145:14 #4 0x527d4f in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:265:11 #5 0x527d4f in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #6 0x7f39cc7da61f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 SUMMARY: AddressSanitizer: heap-buffer-overflow /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:66:12 in parseSWF_RGBA Shadow bytes around the buggy address: 0x0c487fff9b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c487fff9ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c487fff9bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c487fff9bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c487fff9bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c487fff9be0: 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c487fff9bf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c487fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c487fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c487fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c487fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==31250==ABORTING ``` Testcase: https://github.com/asarubbo/poc/blob/master/00076-libming-heapoverflow-parseSWF_RGBA
listswf: heap-based buffer overflow in parseSWF_RGBA (parser.c)
https://api.github.com/repos/libming/libming/issues/58/comments
0
2016-11-24T11:13:17Z
2017-01-30T08:57:44Z
https://github.com/libming/libming/issues/58
191,493,824
58
[ "libming", "libming" ]
On 0.4.7: ``` # listswf $FILE header indicates a filesize of 237 but filesize is 272 File version: 6 File size: 272 Frame size: (-4926252,-2829100)x(-2829100,-2829100) Frame rate: 166.648438 / sec. Total frames: 42662 Offset: 25 (0x0019) Block type: 666 (Unknown Block Type) Block length: 38 0000: a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 c5 c5 c5 ........ ........ 0010: c5 c5 00 02 00 00 19 9a 02 ba 06 80 00 00 fe 38 ........ .......8 0020: 01 00 a6 e3 80 29 .....) Offset: 65 (0x0041) Block type: 149 (Unknown Block Type) Block length: 55 0000: dc 20 1c db 31 89 c7 ff 7f 0a d8 97 c5 c5 c5 c5 . ..1... ....... 0010: cb c5 ea fc 77 da c5 c5 c5 c5 c5 d3 d3 1a 19 9a ....w... ........ 0020: 7a 38 df f6 a6 e3 80 40 77 a5 e3 00 ba f5 90 6f z8.....@ w......o 0030: d3 1a 5d f0 59 0e c2 ..].Y.. Offset: 122 (0x007a) Block type: 896 (Unknown Block Type) Block length: 47 0000: 7f 41 41 41 67 67 18 9d 6d ea 3b 3f ff ff ba 06 AAAgg.. m.;?.... 0010: 80 00 00 fe 38 01 00 a6 e3 80 29 77 25 dc 20 1c ....8... ..)w%. . 0020: db 31 89 c7 ff 7f 0a d8 97 c5 c5 c5 c5 a6 2f .1..... ....../ Offset: 171 (0x00ab) Block type: 919 (Unknown Block Type) Block length: 48 0000: ab d2 20 65 ff fe 7f 7f 0b 1c 62 24 67 89 18 79 .. e.. ..b$g..y 0010: a2 e3 2c 61 2a 2d c1 2c 37 a6 2f f0 e5 ab d2 20 ..,a*-., 7./.... 0020: 65 65 65 65 65 c7 8e cb 0a d8 1b 75 85 c5 c5 03 eeeee... ...u.... Offset: 221 (0x00dd) Block type: 791 (Unknown Block Type) Block length: 7 0000: c5 b7 c5 d3 d3 1a 19 ....... ================================================================= ==634==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000efb0 at pc 0x00000058582e bp 0x7fff1ed6df60 sp 0x7fff1ed6df58 WRITE of size 2 at 0x60200000efb0 thread T0 #0 0x58582d in parseSWF_DEFINEFONT /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:1656:29 #1 0x5302cb in blockParse /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/blocktypes.c:145:14 #2 0x527d4f in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:265:11 #3 0x527d4f in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #4 0x7fad6007961f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 #5 0x419b38 in _init (/usr/bin/listswf+0x419b38) 0x60200000efb1 is located 0 bytes to the right of 1-byte region [0x60200000efb0,0x60200000efb1) allocated by thread T0 here: #0 0x4d28f8 in malloc /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64 #1 0x58532d in parseSWF_DEFINEFONT /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:1655:36 #2 0x5302cb in blockParse /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/blocktypes.c:145:14 #3 0x527d4f in readMovie /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:265:11 #4 0x527d4f in main /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/main.c:350 #5 0x7fad6007961f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 SUMMARY: AddressSanitizer: heap-buffer-overflow /tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/parser.c:1656:29 in parseSWF_DEFINEFONT Shadow bytes around the buggy address: 0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff9df0: fa fa fa fa fa fa[01]fa fa fa 00 fa fa fa 07 fa 0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==634==ABORTING ``` Testcase: https://github.com/asarubbo/poc/blob/master/00075-libming-heapoverflow-parseSWF_DEFINEFONT
listswf: heap-based buffer overflow in parseSWF_DEFINEFONT (parser.c)
https://api.github.com/repos/libming/libming/issues/57/comments
0
2016-11-24T11:09:32Z
2017-01-30T08:57:44Z
https://github.com/libming/libming/issues/57
191,493,035
57
[ "libming", "libming" ]
On 0.4.7 by default listswf has an odr-violation: ``` ================================================================= ==20414==ERROR: AddressSanitizer: odr-violation (0x00000146f440): [1] size=4 'fileOffset' read.c:30:5 [2] size=4 'fileOffset' listaction.c:29:5 These globals were registered at these points: [1]: #0 0x429cbd in __asan_register_globals /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/asan_globals.cc:309 #1 0x59d9e8 (/usr/bin/listswf+0x59d9e8) [2]: #0 0x429cbd in __asan_register_globals /tmp/portage/sys-devel/llvm-3.9.0-r1/work/llvm-3.9.0.src/projects/compiler-rt/lib/asan/asan_globals.cc:309 #1 0x7f9f331b85c8 (/usr/lib64/libming.so.1+0x6f5c8) ==20414==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0 SUMMARY: AddressSanitizer: odr-violation: global 'fileOffset' at read.c:30:5 ==20414==ABORTING ```
listswf: fileOffset odr-violation
https://api.github.com/repos/libming/libming/issues/56/comments
4
2016-11-24T10:52:32Z
2017-02-03T11:49:10Z
https://github.com/libming/libming/issues/56
191,489,411
56
[ "libming", "libming" ]
it fails for multiple definitions ``` actioncompiler/.libs/libactioncompiler.a(lex.swf4.o):(.bss+0xc0): multiple definition of `swf4debug' actioncompiler/.libs/libactioncompiler.a(swf4compiler.tab.o):(.bss+0x0): first defined here actioncompiler/.libs/libactioncompiler.a(lex.swf5.o):(.bss+0xc0): multiple definition of `swf5debug' actioncompiler/.libs/libactioncompiler.a(swf5compiler.tab.o):(.bss+0x0): first defined here ```
libming-0.4.8 fails to compile with -fno-common
https://api.github.com/repos/libming/libming/issues/55/comments
3
2016-11-22T12:19:26Z
2017-04-07T08:22:53Z
https://github.com/libming/libming/issues/55
190,984,846
55
[ "libming", "libming" ]
there is a left shift in listmp3 Error message: ``` listmp3.c:94:23: runtime error: left shift of negative value -1 listmp3.c:95:23: runtime error: left shift of negative value -1 ``` Testcase: [8.crashes.zip](https://github.com/libming/libming/files/541932/8.crashes.zip) Tested on 0.4.7
listmp3: left shift
https://api.github.com/repos/libming/libming/issues/53/comments
2
2016-10-20T14:24:35Z
2017-01-30T08:57:44Z
https://github.com/libming/libming/issues/53
184,244,226
53
[ "libming", "libming" ]
There is a divide-by-zero in printMP3Headers Stacktrace: ``` ASAN:DEADLYSIGNAL ================================================================= ==29561==ERROR: AddressSanitizer: FPE on unknown address 0x0000004f19e8 (pc 0x0000004f19e8 bp 0x000000000000 sp 0x7ffdf0ab6340 T0) #0 0x4f19e7 in printMP3Headers /var/tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/listmp3.c:172:54 #1 0x4f1bee in main /var/tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/listmp3.c:191:3 #2 0x7f49407a361f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 #3 0x418ae8 in getenv (/usr/bin/listmp3+0x418ae8) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: FPE /var/tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/listmp3.c:172:54 in printMP3Headers ==29561==ABORTING ``` Testcase: [4.crashes.zip](https://github.com/libming/libming/files/541925/4.crashes.zip)
listmp3: divide-by-zero in printMP3Headers (listmp3.c)
https://api.github.com/repos/libming/libming/issues/52/comments
3
2016-10-20T14:22:04Z
2017-01-30T09:00:00Z
https://github.com/libming/libming/issues/52
184,243,616
52
[ "libming", "libming" ]
There is a global buffer overflow in printMP3Headers. Stacktrace: ``` ==29519==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000722e0c at pc 0x0000004f1a99 bp 0x7ffe42b1d7f0 sp 0x7ffe42b1d7e8 READ of size 4 at 0x000000722e0c thread T0 #0 0x4f1a98 in printMP3Headers /var/tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/listmp3.c:128:20 #1 0x4f1bee in main /var/tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/listmp3.c:191:3 #2 0x7fe262a4761f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289 #3 0x418ae8 in getenv (/usr/bin/listmp3+0x418ae8) 0x000000722e0c is located 52 bytes to the left of global variable 'mp2_samplerate_table' defined in 'listmp3.c:44:5' (0x722e40) of size 12 0x000000722e0c is located 0 bytes to the right of global variable 'mp1_samplerate_table' defined in 'listmp3.c:43:5' (0x722e00) of size 12 SUMMARY: AddressSanitizer: global-buffer-overflow /var/tmp/portage/media-libs/ming-0.4.7/work/ming-0_4_7/util/listmp3.c:128:20 in printMP3Headers Shadow bytes around the buggy address: 0x0000800dc570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800dc580: 00 00 00 00 00 00 00 00 00 00 00 04 f9 f9 f9 f9 0x0000800dc590: 00 00 00 00 00 00 00 04 f9 f9 f9 f9 00 00 00 00 0x0000800dc5a0: 00 00 00 04 f9 f9 f9 f9 00 00 00 00 00 00 00 04 0x0000800dc5b0: f9 f9 f9 f9 00 00 00 00 00 00 00 04 f9 f9 f9 f9 =>0x0000800dc5c0: 00[04]f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x0000800dc5d0: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000800dc5e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800dc5f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800dc600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800dc610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==29519==ABORTING frame 1: MP25 layer 1, 8000 Hz, 0kbps, mono, length=0, protect off ``` Reproducer: [1.crashes.zip](https://github.com/libming/libming/files/541897/1.crashes.zip)
listmp3: global-buffer-overflow in printMP3Headers (listmp3.c)
https://api.github.com/repos/libming/libming/issues/51/comments
2
2016-10-20T14:11:18Z
2017-01-30T08:57:44Z
https://github.com/libming/libming/issues/51
184,240,792
51
[ "libming", "libming" ]
An attempt to compile the PHP extension of ming-0.4.7 ends with these errors: ``` Making all in php_ext make[1]: Entering directory '/builddir/build/BUILD/libming-ming-0_4_7/php_ext' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src `php-config --includes` -DCOMPILE_DL_MING -DHAVE_MING=1 -DHAVE_NEW_MING=1 -DHAVE_SWFVIDEOSTREAM_NEXTFRAME=1 -DHAVE_SWFVIDEOSTREAM_SEEK=1 -DHAVE_SWFVIDEOSTREAM_SETFRAMEMODE -UHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o ming_la-ming.lo `test -f 'ming.c' || echo './'`ming.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DCOMPILE_DL_MING -DHAVE_MING=1 -DHAVE_NEW_MING=1 -DHAVE_SWFVIDEOSTREAM_NEXTFRAME=1 -DHAVE_SWFVIDEOSTREAM_SEEK=1 -DHAVE_SWFVIDEOSTREAM_SETFRAMEMODE -UHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c ming.c -fPIC -DPIC -o .libs/ming_la-ming.o ming.c: In function 'SWFgetProperty': ming.c:254:39: warning: passing argument 2 of 'zend_hash_find' from incompatible pointer type [-Wincompatible-pointer-types] if (zend_hash_find(Z_OBJPROP_P(id), name, namelen+1, (void **)&tmp) == FAILURE) { ^~~~ In file included from /usr/include/php/Zend/zend.h:36:0, from /usr/include/php/main/php.h:35, from ming.c:30: /usr/include/php/Zend/zend_hash.h:154:30: note: expected 'zend_string * {aka struct _zend_string *}' but argument is of type 'char *' ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key); ^~~~~~~~~~~~~~ ming.c:254:7: error: too many arguments to function 'zend_hash_find' if (zend_hash_find(Z_OBJPROP_P(id), name, namelen+1, (void **)&tmp) == FAILURE) { ^~~~~~~~~~~~~~ [...] ``` and tons of other errors. PHP 7.0.9 RC1 is already shipped in Fedora development branch (rawhide) and will be included in the next Fedora release (25). It would be nice if ming could be ported to PHP7 before the Alpha Freeze of Fedora 25, which is planned on August 9th (https://fedoraproject.org/wiki/Releases/25/Schedule), or at least before the Beta Freeze on September 20th. For the record, I am the ming package maintainer in Fedora.
port to PHP 7.x
https://api.github.com/repos/libming/libming/issues/50/comments
1
2016-07-18T21:37:55Z
2017-03-24T21:13:03Z
https://github.com/libming/libming/issues/50
166,199,684
50
[ "libming", "libming" ]
While building ming-0.4.7 with make -j4, I get corrupted .tab.c and/or .tab.h files in src/actioncompiler. It looks like parallel calls to bison are the cause. Here is an example error log. It's usually different each time. ``` $ make V=1 -j4 Making all in src make[1]: Entering directory '/builddir/build/BUILD/libming-ming-0_4_7/src' make all-recursive make[2]: Entering directory '/builddir/build/BUILD/libming-ming-0_4_7/src' Making all in actioncompiler make[3]: Entering directory '/builddir/build/BUILD/libming-ming-0_4_7/src/actioncompiler' bison -y -p swf4 -b swf4compiler ./swf4compiler.y bison -y --defines --debug -p swf4 -b swf4compiler ./swf4compiler.y bison -y -p swf5 -b swf5compiler ./swf5compiler.y bison -y --defines --debug -p swf5 -b swf5compiler ./swf5compiler.y ./swf4compiler.y: warning: 52 shift/reduce conflicts [-Wconflicts-sr] ./swf4compiler.y: warning: 42 reduce/reduce conflicts [-Wconflicts-rr] ./swf4compiler.y: warning: 52 shift/reduce conflicts [-Wconflicts-sr] ./swf4compiler.y: warning: 42 reduce/reduce conflicts [-Wconflicts-rr] ./swf4compiler.y:196.25-38: warning: rule useless in parser due to conflicts [-Wother] : /* empty */ { $$ = NULL; } ^^^^^^^^^^^^^^ ./swf4compiler.y:700.11-704.29: warning: rule useless in parser due to conflicts [-Wother] | '-' NUMBER %prec NEGATE ^^^^^^^^^^^^./swf4compiler.y^^^:196^ .25-38: warning: rule useless in parser due to conflicts [-Wother] : /* empty */ { $$ = NULL; } ^^^^^^^^^^^^^^ ./swf4compiler.y:700.11-704.29: warning: rule useless in parser due to conflicts [-Wother] | '-' NUMBER %prec NEGATE ^^^^^^^^^^^^^^^^ flex -Pswf4 ./swf4compiler.flex flex -Pswf5 ./swf5compiler.flex make all-am make[4]: Entering directory '/builddir/build/BUILD/libming-ming-0_4_7/src/actioncompiler' /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o assembler.lo assembler.c /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o compile.lo compile.c /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o listaction.lo listaction.c /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o compileaction.lo compileaction.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c assembler.c -fPIC -DPIC -o .libs/assembler.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c listaction.c -fPIC -DPIC -o .libs/listaction.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c compileaction.c -fPIC -DPIC -o .libs/compileaction.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c compile.c -fPIC -DPIC -o .libs/compile.o /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o swf4compiler.tab.lo swf4compiler.tab.c /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o swf5compiler.tab.lo swf5compiler.tab.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c swf4compiler.tab.c -fPIC -DPIC -o .libs/swf4compiler.tab.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c swf5compiler.tab.c -fPIC -DPIC -o .libs/swf5compiler.tab.o swf4compiler.tab.c: In function 'swf4parse': swf4compiler.tab.c:3532:34: error: 'YYLASf' undeclared (first use in this function) if (0 <= yystate && yystate <= YYLASf the reduction. Determine what state ^~~~~~ swf4compiler.tab.c:3532:34: note: each undeclared identifier is reported only once for each function it appears in swf4compiler.tab.c:3532:41: error: expected ')' before 'the' if (0 <= yystate && yystate <= YYLASf the reduction. Determine what state ^~~ swf4compiler.tab.c:3737:1: error: expected expression before '}' token } ^ swf4compiler.tab.c:1979:5: error: label 'yyerrlab' used but not defined goto yyerrlab; ^~~~ swf4compiler.tab.c:1903:5: error: label 'yyacceptlab' used but not defined YYACCEPT; ^~~~~~~~ swf4compiler.tab.c:1897:9: error: label 'yyabortlab' used but not defined YYABORT; ^~~~~~~ swf4compiler.tab.c:1880:11: error: label 'yyexhaustedlab' used but not defined goto yyexhaustedlab; ^~~~ swf4compiler.tab.c:1807:12: warning: unused variable 'yymsg_alloc' [-Wunused-variable] YYSIZE_T yymsg_alloc = sizeof yymsgbuf; ^~~~~~~~~~~ swf4compiler.tab.c:1806:9: warning: unused variable 'yymsg' [-Wunused-variable] char *yymsg = yymsgbuf; ^~~~~ swf4compiler.tab.c:1796:7: warning: unused variable 'yyresult' [-Wunused-variable] int yyresult; ^~~~~~~~ swf4compiler.tab.c:3737:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c -o lex.swf4.lo lex.swf4.c At top level: swf4compiler.tab.c:1740:1: warning: 'yydestruct' defined but not used [-Wunused-function] yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *buffer) ^~~~~~~~~~ swf4compiler.tab.c:1608:1: warning: 'yysyntax_error' defined but not used [-Wunused-function] yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, ^~~~~~~~~~~~~~ swf4compiler.tab.c:1233:27: warning: 'yystos' defined but not used [-Wunused-const-variable=] static const yytype_uint8 yystos[] = ^~~~~~ swf4compiler.tab.c:875:27: warning: 'yydefgoto' defined but not used [-Wunused-const-variable=] static const yytype_int16 yydefgoto[] = ^~~~~~~~~ Makefile:459: recipe for target 'swf4compiler.tab.lo' failed make[4]: *** [swf4compiler.tab.lo] Error 1 make[4]: *** Waiting for unfinished jobs.... swf5compiler.tab.c: In function 'swf5parse': swf5compiler.tab.c:7007:26: warning: passing argument 2 of 'swf5error' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] yyerror (buffer, yymsgp); ^~~~~~ swf5compiler.tab.c:65:25: note: expected 'char *' but argument is of type 'const char *' #define yyerror swf5error ^ compile.h:20:6: note: in expansion of macro 'yyerror' void yyerror(void *buffer, char *msg); ^~~~~~~ libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src -I./.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wall -fPIC -DSWF_LITTLE_ENDIAN -c lex.swf4.c -fPIC -DPIC -o .libs/lex.swf4.o make[4]: Leaving directory '/builddir/build/BUILD/libming-ming-0_4_7/src/actioncompiler' Makefile:377: recipe for target 'all' failed make[3]: *** [all] Error 2 make[3]: Leaving directory '/builddir/build/BUILD/libming-ming-0_4_7/src/actioncompiler' Makefile:720: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/builddir/build/BUILD/libming-ming-0_4_7/src' Makefile:533: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/builddir/build/BUILD/libming-ming-0_4_7/src' Makefile:513: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 $ ``` A patch similar to this seems to resolve the issue: ``` diff -up libming-ming-0_4_7/src/actioncompiler/Makefile.am.pmake libming-ming-0_4_7/src/actioncompiler/Makefile.am --- libming-ming-0_4_7/src/actioncompiler/Makefile.am.pmake 2015-05-15 11:43:14.000000000 +0200 +++ libming-ming-0_4_7/src/actioncompiler/Makefile.am 2016-07-18 22:57:44.537713157 +0200 @@ -56,11 +56,11 @@ lex.swf5.c: $(srcdir)/swf5compiler.flex swf4compiler.tab.c: $(srcdir)/swf4compiler.y $(YACC) -p swf4 -b swf4compiler $(srcdir)/swf4compiler.y -swf4compiler.tab.h: $(srcdir)/swf4compiler.y +swf4compiler.tab.h: $(srcdir)/swf4compiler.y | swf4compiler.tab.c $(YACC) --defines $(DEBUG) -p swf4 -b swf4compiler $(srcdir)/swf4compiler.y swf5compiler.tab.c: $(srcdir)/swf5compiler.y $(YACC) -p swf5 -b swf5compiler $(srcdir)/swf5compiler.y -swf5compiler.tab.h: $(srcdir)/swf5compiler.y +swf5compiler.tab.h: $(srcdir)/swf5compiler.y | swf5compiler.tab.c $(YACC) --defines $(DEBUG) -p swf5 -b swf5compiler $(srcdir)/swf5compiler.y ```
make -jN build is broken
https://api.github.com/repos/libming/libming/issues/49/comments
1
2016-07-18T21:02:09Z
2018-01-27T09:42:02Z
https://github.com/libming/libming/issues/49
166,192,758
49
[ "libming", "libming" ]
Hello, I want to update homebrew package to 0.4.7. But I keep getting this compilation error. ``` bash-3.2$ make Making all in src /Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive Making all in actioncompiler /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am make[4]: Nothing to be done for `all-am'. Making all in blocks make[4]: Nothing to be done for `all-am'. /bin/sh ../libtool --tag=CC --mode=link clang -g -O2 -Wall -fPIC -DSWF_LITTLE_ENDIAN -version-info 5:6:4 -no-undefined -o libming.la -rpath /usr/local/Cellar/libming/0.4.7/lib blocklist.lo displaylist.lo fill.lo font_util.lo gc.lo ming.lo movie.lo movieclip.lo position.lo shape_cubic.lo shape_util.lo text_util.lo compat.lo actioncompiler/libactioncompiler.la blocks/libblock.la -lpng -lgif -lz -L/usr/local/Cellar/freetype/2.6_1/lib -lfreetype libtool: link: clang -dynamiclib -o .libs/libming.1.dylib .libs/blocklist.o .libs/displaylist.o .libs/fill.o .libs/font_util.o .libs/gc.o .libs/ming.o .libs/movie.o .libs/movieclip.o .libs/position.o .libs/shape_cubic.o .libs/shape_util.o .libs/text_util.o .libs/compat.o -Wl,-force_load,actioncompiler/.libs/libactioncompiler.a -Wl,-force_load,blocks/.libs/libblock.a -lpng -lgif -lz -L/usr/local/Cellar/freetype/2.6_1/lib -lfreetype -g -O2 -install_name /usr/local/Cellar/libming/0.4.7/lib/libming.1.dylib -compatibility_version 6 -current_version 6.6 -Wl,-single_module duplicate symbol _swf5debug in: actioncompiler/.libs/libactioncompiler.a(swf5compiler.tab.o) actioncompiler/.libs/libactioncompiler.a(lex.swf5.o) ld: 1 duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [libming.la] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1 bash-3.2$ brew --config HOMEBREW_VERSION: 0.9.5 ORIGIN: [email protected]:polishgeeks/homebrew.git HEAD: f44e857c78385a2af7ca186d6191daa0efad33fd Last commit: 3 hours ago HOMEBREW_PREFIX: /usr/local HOMEBREW_CELLAR: /usr/local/Cellar CPU: quad-core 64-bit haswell OS X: 10.10.4-x86_64 Xcode: 6.3.2 CLT: 6.3.2.0.1.1431401888 GCC-4.2: build 0 Clang: 6.1 build 602 X11: 2.7.7 => /opt/X11 System Ruby: 2.0.0-p481 Perl: /usr/bin/perl Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/bin/python2.7 Ruby: /Users/n/.rvm/rubies/ruby-2.2.2/bin/ruby Java: 1.8.0_45 ```
can't compile duplicate symbol _swf5debug
https://api.github.com/repos/libming/libming/issues/48/comments
5
2015-06-27T13:18:21Z
2021-05-11T04:01:02Z
https://github.com/libming/libming/issues/48
91,463,564
48
[ "libming", "libming" ]
Redirection to a http://www.libming.org/FrontPage, please. The following page is helpful. http://permalink.gmane.org/gmane.comp.jakarta.general/7695 (same issue) http://www.libming.org/%E3%83%95%E3%83%AD%E3%83%B3%E3%83%88%E3%83%9A%E3%83%BC%E3%82%B8 (FrontPage for Japanese. Please redirect me.)
Japanese doesn't see Wiki
https://api.github.com/repos/libming/libming/issues/45/comments
1
2015-01-23T11:02:41Z
2017-03-21T21:40:40Z
https://github.com/libming/libming/issues/45
55,269,602
45
[ "libming", "libming" ]
[ forwarding Debian bug https://bugs.debian.org/752629 ] php_ext/ming.c and php_ext/php_ming.h files are released under PHP License 3.01 which is not usable for anything else than PHP itself. Extending LGPL-2.1+ (or GPL-2+) to them would be fine.
Please relicense PHP extension
https://api.github.com/repos/libming/libming/issues/42/comments
19
2014-06-25T14:25:57Z
2017-04-12T09:30:43Z
https://github.com/libming/libming/issues/42
36,484,523
42
[ "libming", "libming" ]
Can't seem to get the current source to build for PHP 5.4.28 on CentOS. ming.c: In function ‘ZEND_GET_MODULE’: ming.c:6161: error: expected declaration specifiers before ‘PHP_MINFO_FUNCTION’ ming.c:6192: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘**attribute**’ before ‘{’ token ming.c:6207: error: expected declaration specifiers before ‘PHP_RINIT_FUNCTION’ ming.c:6228: error: expected declaration specifiers before ‘PHP_MINIT_FUNCTION’ ming.c:6535: error: expected ‘{’ at end of input make[1]: **\* [ming_la-ming.lo] Error 1 make[1]: Leaving directory `/root/src/libming/php_ext' make: **\* [all-recursive] Error 1
Build for PHP 5.4.28
https://api.github.com/repos/libming/libming/issues/41/comments
0
2014-06-05T12:14:47Z
2014-06-05T12:14:47Z
https://github.com/libming/libming/issues/41
35,051,298
41
[ "libming", "libming" ]
flex 2.5.35 bison (GNU Bison) 2.7.12-4996 gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 ``` In file included from ./swf4compiler.flex:10:0: swf4compiler.tab.h:302:5: error: conflicting types for 'swf4parse' int swf4parse (void); ^ In file included from ./swf4compiler.flex:7:0: compile.h:264:5: note: previous declaration of 'swf4parse' was here int swf4parse(void *b); ^ ```
error: conflicting types for 'swf4parse'
https://api.github.com/repos/libming/libming/issues/38/comments
1
2014-01-07T19:48:14Z
2014-01-09T08:39:16Z
https://github.com/libming/libming/issues/38
25,191,848
38
[ "libming", "libming" ]
here is the reproduce code: ``` python from ming import * s = SWFShape() s.setLine(2, 0x7f, 0, 0) s.movePenTo(100, 250) s.drawCubicTo(100,100,400,100,400,250) #debug s.setLine(2, 0, 0xff, 0) s.movePenTo(100, 250) s.drawLineTo(100,100) s.drawLineTo(400,100) s.drawLineTo(400,250) m = SWFMovie() m.setDimension(800, 600) m.setRate(12.0) m.add(s) m.nextFrame() m.save("test.swf") ``` here is the output ![image](https://f.cloud.github.com/assets/576863/1693691/def695cc-5e93-11e3-9759-fc6c7da1d0f0.png) the green border is the control points
Wrong output for drawCubicTo
https://api.github.com/repos/libming/libming/issues/37/comments
0
2013-12-06T16:32:16Z
2013-12-06T16:32:16Z
https://github.com/libming/libming/issues/37
23,868,881
37
[ "libming", "libming" ]
lion 2011-06-29 23:05:54 EDT When compile output of swftocxx with many flashes I get thousand of errors like: test.cpp:2381:10: error: redeclaration of ‘SWFFont\* f6’ test.cpp:2378:10: error: ‘SWFFont\* f6’ previously declared here It seems swftocxx don`t care about redeclarations at all. Also there deprecation warnings: mingpp.h: In member function ‘char\* SWFFont::getShape(short unsigned int)’: mingpp.h:856:14: warning: ‘char\* SWFFont_getShape(c_SWFFont, short unsigned int)’ is deprecated (declared at ming.h:445) [-Wdeprecated-declarations] mingpp.h:856:44: warning: ‘char\* SWFFont_getShape(c_SWFFont, short unsigned int)’ is deprecated (declared at ming.h:445) [-Wdeprecated-declarations] and default parameters problems: test.cpp:2577:26: error: no matching function for call to ‘SWFShape::setRightFill()’ test.cpp:2577:26: note: candidate is: mingpp.h:1369:8: note: void SWFShape::setRightFill(SWFFill*) mingpp.h:1369:8: note: candidate expects 1 argument, 0 provided
Bug 113 - swftocxx don`t care about objects redeclarations
https://api.github.com/repos/libming/libming/issues/36/comments
4
2013-08-18T18:03:25Z
2017-04-07T08:39:55Z
https://github.com/libming/libming/issues/36
18,210,983
36
[ "libming", "libming" ]
Brad Smith 2011-10-29 07:51:16 EDT The testsuite test ActionScriptTest is broken and fails like so.. Only SWF versions 4 to 9 are currently supported! Testing Function.as:6 with swfversion 0 FAIL: ActionScriptTest
Bug 116 - testsuite test ActionScriptTest is broken
https://api.github.com/repos/libming/libming/issues/35/comments
2
2013-08-18T18:02:15Z
2017-01-02T19:00:11Z
https://github.com/libming/libming/issues/35
18,210,970
35
[ "libming", "libming" ]
Brad Smith 2011-10-26 19:19:37 EDT Created an attachment (id=41) [details] png2bl printf patch Fix format specifier for a printf in png2dbl. The type used within struct pngdata for width and height are 32-bit types not 64-bit.
Bug 115 - Fix format specifier for printf in png2dbl
https://api.github.com/repos/libming/libming/issues/34/comments
2
2013-08-18T17:59:41Z
2013-08-18T18:01:26Z
https://github.com/libming/libming/issues/34
18,210,912
34
[ "libming", "libming" ]
Benjamin Wolsey 2011-07-01 07:22:20 EDT Setting an mp3 sound stream for a SWF with a very slow frame rate (e.g. 1 or 0.5 frames per second) results in the stream sound blocks containing much more data than they claim to. With a sample rate of 44kHz, a frame rate of 0.5 frames per second means each sound block contains 88000 stereo samples, but both the sound stream head and each sound stream block advertise a maximum of about 22000. I guess there is an integer overflow somewhere. Because the pp uses the value in the sound stream head to determine the frame rate while a streaming sound is playing, this means that the SWF plays at 2 frames per second. Also, because the sample count in each block is used to determine how much sound is played, the sound is truncated. All samples count value is a uint16_t, so if this is to work properly, I guess that several smaller blocks would have to be added between each showframe until all samples are written.
Bug 114 - Incorrect sound stream encoding for slow frame rates.
https://api.github.com/repos/libming/libming/issues/33/comments
0
2013-08-18T17:58:34Z
2013-08-18T17:58:34Z
https://github.com/libming/libming/issues/33
18,210,898
33
[ "libming", "libming" ]
Sreejith 2011-05-10 08:28:46 EDT We have the old code developed in ming 0.3a. Now we want upgrade to php 5.3.6 with the windows 2008 server. php_ming.dll not loading in Windows 2008 64 bit server. However it works in winxp and windows 2000. PHP version : 5.3.6 OS : Windows 2008 MIng extension: 0.3a and 0.4.3 (both are not working) Please share us what to do to fix this issue. Regards Sreejith
Bug 112 - php_ming.dll not loading in Windows 2008 64 bit server.
https://api.github.com/repos/libming/libming/issues/32/comments
2
2013-08-18T17:56:40Z
2013-08-18T17:57:05Z
https://github.com/libming/libming/issues/32
18,210,875
32
[ "libming", "libming" ]
[email protected] 2011-03-09 02:52:21 EST When compiling a C program that uses libming, the following warning can happen: /usr/local/ming/include/ming.h:32:1: warning: "__deprecated" redefined This is because ming.h tries to define __deprecated reserved identifier without first checking if it is already defined. It is safe to ignore this warning, but it is confusing to developers. ming.h should use "ifndef __deprecated" as below. --- # ifndef __deprecated # ifdef **GNUC** # define **deprecated __attribute**((deprecated)) # else # define __deprecated # endif # endif ---
Bug 111 - warning __deprecated redefined can happen when including ming.h
https://api.github.com/repos/libming/libming/issues/31/comments
0
2013-08-18T17:55:54Z
2013-08-18T17:55:54Z
https://github.com/libming/libming/issues/31
18,210,860
31
[ "libming", "libming" ]
[email protected] 2011-01-18 10:43:31 EST SWFGradient does not render properly, draes square half blue half yellow, using the below code:- <?php //Set the scale to TWIPS rather than PIXELS ming_setscale(1.0); //Create the movie $m = new SWFMovie(); $m->setRate(12.0); $m->setDimension(400,400); $m->setBackground(0xff, 0xff, 0xff); //Width and height of rectangle $sx = 300; $sy = 300; //Create rectangle $s = new SWFShape(); //Gradient file stuff here... $g = new SWFGradient(); $g->addEntry(0.0, 0x00, 0x00, 0xff); // Start off Blue $g->addEntry(1.0, 0xff, 0xff, 0x00); // Finish off Yellow // Add gradient fill to the shape $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); //Centre the gradient fill against the rectangle $f->moveTo($sx/2, $sy/2); //Scale it to the shape, so that the entire gradient fits inside the shape $f->scaleTo($sx/32768, 1); // Set the shapes fill to be the added gradient fill $s->setRightFill($f); //Draw the rectangle $s->drawLine($sx, 0); $s->drawLine(0, $sy); $s->drawLine(-$sx, 0); $s->drawLine(0, -$sy); //Add the shape to the movie $sh = $m->add($s); $sh->moveTo(50, 50); // Output the movie header("Content-type: application/x-shockwave-flash"); $m->output(); ?> In ming 0.3, it draws a square with a yellow to blue and back to yellow, on 0.4.3 it draws a square half blue and half yellow.
Bug 108 - SWFGradient does not work ming 0.4.3
https://api.github.com/repos/libming/libming/issues/30/comments
0
2013-08-18T17:55:00Z
2013-08-18T17:55:00Z
https://github.com/libming/libming/issues/30
18,210,851
30
[ "libming", "libming" ]
Benjamin Otte 2007-06-06 09:09:19 EDT I checked this for script code (Push action), but it's probably relevant to all contents of Flash files: Strings in Flash < 6 seem to be encoded as Latin-1. In Flash >= 6 strings are probably encoded as UTF-8. Ming always writes UTF-8 when creating Flash files. It would be nice if it did something sane for Flash < 6.
Bug 21 - Ming doesn't handle charsets correctly
https://api.github.com/repos/libming/libming/issues/29/comments
6
2013-08-18T17:53:15Z
2013-08-18T17:54:12Z
https://github.com/libming/libming/issues/29
18,210,827
29
[ "libming", "libming" ]
Jaron Wong 2009-12-09 22:05:09 EST Created an attachment (id=24) [details] test file I want to add a flv file with video and audio to movieclip, but the ouput swf file will contain no content if the rate is greater than or equal to the framerate of flv set by invoking SWFMovie_setRate when adding. If I have a avi.flv file, and its framerate is 25, then after I add using the following codes, the output swf file will be blank with neither image nor sound, it is a incorrect file m = newSWFMovieWithVersion(8); /*setting the rate the smae as the framerate of avi.flv will cause error. the parameter 2 of SWFMovie_setRate must be less than the framerate of avi.flv. */ SWFMovie_setRate (m, 25); SWFMovie_setDimension (m, 640, 480); SWFMovie_setBackground(m, 0xff, 0xff, 0xff); ``` SWFMovieClip mc=newSWFMovieClip(); //add audio to SWFMovieClip astream = ``` newSWFSoundStream_fromInput(newSWFInput_filename("resource/avi.flv")); if(!astream) { fprintf(stderr, "Could not create SWFSoundStream\n"); return EXIT_FAILURE; } SWFMovieClip_setSoundStream(mc, astream, SWFMovie_getRate(m)); ``` //add video to SWFMovieClip stream = ``` newSWFVideoStream_fromInput(newSWFInput_filename("resource/avi.flv")); if(!stream) { printf("Could not create SWFVideoStream from file\n"); return EXIT_FAILURE; } ``` SWFVideoStream_setDimension(stream, 640, 480); frames = SWFVideoStream_getNumFrames(stream); SWFMovieClip_add(mc, (SWFBlock)stream);//add video to SWFMovieClip for(int i = 0; i < frames; i++) SWFMovieClip_nextFrame(mc); SWFMovie_add(m, (SWFBlock)mc);//add SWFMovieClip to SWFMovie SWFMovie_save(m, "encodeSwf_test01.swf"); If I change the parameter of SWFMovie-setRate (m,25) from 25 to a value ``` less than it (eg 15), then the output swf file will have no problem. There will be no such problem if no audio is added to MC. For example, the output swf using the following codes will be correct. m = newSWFMovieWithVersion(8); SWFMovie_setRate (m, 25); SWFMovie_setDimension (m, 640, 480); SWFMovie_setBackground(m, 0xff, 0xff, 0xff); ``` SWFMovieClip mc=newSWFMovieClip(); //add video to SWFMovieClip stream = ``` newSWFVideoStream_fromInput(newSWFInput_filename("resource/avi.flv")); if(!stream) { printf("Could not create SWFVideoStream from file\n"); return EXIT_FAILURE; } ``` SWFVideoStream_setDimension(stream, 640, 480); frames = SWFVideoStream_getNumFrames(stream); SWFMovieClip_add(mc, (SWFBlock)stream); for(int i = 0; i < frames; i++) SWFMovieClip_nextFrame(mc); SWFMovie_add(m, (SWFBlock)mc);//add SWFMovieClip to SWFMovie SWFMovie_save(m, "encodeSwf_test02.swf"); ``` There will be no such problem if the flv file is added to SWFMovie directly. For example, if the follwing codes are used, the output swf file will be correct if the value of flv is set to the same vaule of framerate (or greater than it) m = newSWFMovieWithVersion(8); ``` SWFMovie_setBackground(m, 0xFF, 0xFF, 0xFF); SWFMovie_setRate(m, 25); SWFMovie_setDimension(m, 640, 480); //add sound to SWFMovie astream = ``` newSWFSoundStream_fromInput(newSWFInput_filename("resource\avi.flv")); if(!astream) { fprintf(stderr, "Could not create SWFSoundStream\n"); return EXIT_FAILURE; } SWFMovie_setSoundStream(m, astream); ``` //add video to SWFMovie stream = ``` newSWFVideoStream_fromInput(newSWFInput_filename("resource\avi.flv")); if(!stream) { printf("Could not create SWFVideoStream from file\n"); return EXIT_FAILURE; } ``` SWFVideoStream_setDimension(stream, 640, 480); frames = SWFVideoStream_getNumFrames(stream); SWFMovie_add(m, (SWFBlock)stream);//add video to SWFMovie for(int i = 0; i < frames; i++) SWFMovie_nextFrame(m); SWFMovie_save(m, "encodeSwf_test03.swf"); ```
Bug 91 - the output swf file can not be played if i add a flv file to movieclip with the smae rate as flv file
https://api.github.com/repos/libming/libming/issues/28/comments
4
2013-08-18T17:50:52Z
2013-08-18T17:51:40Z
https://github.com/libming/libming/issues/28
18,210,794
28
[ "libming", "libming" ]
Klaus Rechert 2008-07-24 07:04:48 EDT error threshold is not normalized. See url above for an example.
Bug 61 - drawCubic broke due static error estimation
https://api.github.com/repos/libming/libming/issues/27/comments
1
2013-08-18T17:49:10Z
2013-08-18T17:49:21Z
https://github.com/libming/libming/issues/27
18,210,774
27
[ "libming", "libming" ]
Klaus Rechert 2007-10-30 04:59:45 EDT see ECMA-262-4, chapter 7.9
Bug 40 - Add automatic semicolon support to AS compiler
https://api.github.com/repos/libming/libming/issues/26/comments
1
2013-08-18T17:48:19Z
2013-08-18T17:48:31Z
https://github.com/libming/libming/issues/26
18,210,766
26
[ "libming", "libming" ]
[email protected] 2010-01-05 11:39:13 EST Hello, I'm trying to build the current trunk of ming on a gentoo box (manually). Unfortunately it fails to build successfully (ran autogen.sh, ran ./configure --enable-php and when running make this happens): make[2]: Entering directory `/root/ming/php_ext/tmp' /bin/sh /root/ming/php_ext/tmp/libtool --mode=compile cc -I. -I/root/ming/php_ext/tmp -DPHP_ATOM_INC -I/root/ming/php_ext/tmp/include -I/root/ming/php_ext/tmp/main -I/root/ming/php_ext/tmp -I/usr/lib/php5/include/php -I/usr/lib/php5/include/php/main -I/usr/lib/php5/include/php/TSRM -I/usr/lib/php5/include/php/Zend -I/usr/lib/php5/include/php/ext -I/usr/lib/php5/include/php/ext/date/lib -I/root/ming/src -DHAVE_CONFIG_H -g -O2 -c /root/ming/php_ext/tmp/ming.c -o ming.lo /root/ming/php_ext/tmp/libtool: line 467: CDPATH: command not found /root/ming/php_ext/tmp/libtool: line 1152: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6b, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6b libtool: and run autoconf again. make[2]: *** [ming.lo] Error 63 make[2]: Leaving directory`/root/ming/php_ext/tmp' make[1]: **\* [all] Error 2 make[1]: Leaving directory `/root/ming/php_ext' make: **\* [all-recursive] Error 1 Any ideas of whats wrong?
Bug 92 - php_ext fails to build due to libtool
https://api.github.com/repos/libming/libming/issues/25/comments
2
2013-08-18T17:47:09Z
2013-08-18T17:47:37Z
https://github.com/libming/libming/issues/25
18,210,752
25
[ "libming", "libming" ]
Mike Graham 2010-05-18 15:10:16 EDT The Python package index(http://pypi.python.org/pypi/) is a repository of Python package packages used to manually and automatedly find and install Python packages. libming's Python bindings are not currently available via PyPI, which makes requiring ming as a dependency harder for other packagers.
Bug 97 - Python bindings not available through PyPI
https://api.github.com/repos/libming/libming/issues/24/comments
0
2013-08-18T17:46:19Z
2013-08-18T17:46:19Z
https://github.com/libming/libming/issues/24
18,210,741
24
[ "libming", "libming" ]
dx 2008-10-21 16:15:02 EDT Program received signal SIGSEGV, Segmentation fault. 0x00007fff466ceb2c in ming_gc_remove_node () from /usr/lib/libming.so.1 (gdb) bt #0 0x00007fff466ceb2c in ming_gc_remove_node () from /usr/lib/libming.so.1 #1 0x00007fff466eeaa6 in destroySWFJpegBitmap () from /usr/lib/libming.so.1 #2 0x00000000005d2ae2 in list_entry_destructor () #3 0x00000000005cf560 in ?? () #4 0x00000000005cf818 in zend_hash_graceful_reverse_destroy () #5 0x00000000005c4d72 in zend_deactivate () #6 0x000000000057f782 in php_request_shutdown () #7 0x000000000063bc34 in main () The following script reproduces the crash: <?php $movie = new SWFMovie(); $movie->add(new SWFBitmap(fopen('anything.jpg', 'r'), fopen('anything.msk', 'r'))); $movie->save("output.swf"); echo "done"; ?> "done" is printed before the segfault (using PHP-CLI), and output.swf does contain a valid flash movie. Libming version: 0.4.2 Distro: Arch linux Architecture: x86_64 Configured with: ./configure --prefix=/usr --disable-static --enable-python
Bug 75 - Segfault on destroySWFJpegBitmap when using masks
https://api.github.com/repos/libming/libming/issues/23/comments
3
2013-08-18T17:44:07Z
2013-08-18T17:44:36Z
https://github.com/libming/libming/issues/23
18,210,717
23
[ "libming", "libming" ]
Philip de Nier 2009-03-14 11:02:01 EDT Created an attachment (id=19) [details] fix truncation of sub-pixel line widths The functions to set the line width (in pixel units) in ming.h uses the "unsigned short" type. The value is then multiplied by Ming_scale internally. This means that a line width of < 1 pixel is stored as as a line width of 0 twips and flash renders this as a line with the minimum width. The ming.h API should be changed to accept pixel unit line widths as a float so that a pixel unit line width < 1 results in a twip unit line width of >= 0 and < Ming_scale and not 0. The attached patch file has this change. p.s. it is a pity that 1 pixel and sub-pixel line widths look the same unless you zoom in enough. The sub-pixel line would appear lighter in other formats.
Bug 82 - sub-pixel line width always results in 0 twip line width
https://api.github.com/repos/libming/libming/issues/22/comments
2
2013-08-18T17:42:27Z
2013-08-18T17:43:14Z
https://github.com/libming/libming/issues/22
18,210,693
22
[ "libming", "libming" ]
[email protected] 2009-03-27 04:45:24 EDT See http://sourceforge.net/mailarchive/forum.php?thread_name=20081213142008.GA19055%40keybit.net&forum_name=ming-devr
Bug 85 - ActionScript compiler doesn't support multiple breaks in a switch case
https://api.github.com/repos/libming/libming/issues/21/comments
0
2013-08-18T17:41:40Z
2013-08-18T17:41:40Z
https://github.com/libming/libming/issues/21
18,210,673
21
[ "libming", "libming" ]
Samuel Thibault 2009-01-16 12:27:26 EST Created an attachment (id=18) [details] fix Hello, I typically do something like putcircle_with_text(SWFShape shape, int x, int y) { SWFShape_MovePenTo(x,y); SWFShape_drawCircle(shape, 10); SWFShape_MovePen(10,10); SWFShape_drawSizedGlyph(shape, 'A', 10); } and then call putcircle_with_text with varying values of x and y. That however puts text in very odd places. This is because when pasting the glyph drawing events, the scale is applied to the offset as well, not only to the relative glyph drawing events. Here is a patch that works for me.
Bug 80 - Bogus glyph position
https://api.github.com/repos/libming/libming/issues/20/comments
1
2013-08-18T17:39:13Z
2013-08-18T17:40:22Z
https://github.com/libming/libming/issues/20
18,210,629
20
[ "libming", "libming" ]
Klaus Rechert 2008-10-21 08:11:39 EDT <?php dl('ming.so'); echo "Beginning of script : ".memory_get_usage()." bytes\n\n"; for ($x = 0;$x<5000;$x++) { $s = new SWFShape(); unset($s); $s = null; } echo "End of script : ".memory_get_usage()." bytes\n\n"; ?> result----------- Beginning of script : 57412 bytes End of script : 1122680 bytes Submitted by Alan Boudreault
Bug 74 - PHP binding leaks memory
https://api.github.com/repos/libming/libming/issues/19/comments
0
2013-08-18T17:37:48Z
2013-08-18T17:37:48Z
https://github.com/libming/libming/issues/19
18,210,610
19
[ "libming", "libming" ]
Klaus Rechert 2008-07-24 07:08:51 EDT
Bug 62 - Win32: perl man pages not installable because of "::" in filenames
https://api.github.com/repos/libming/libming/issues/18/comments
0
2013-08-18T17:36:59Z
2013-08-18T17:36:59Z
https://github.com/libming/libming/issues/18
18,210,593
18
[ "libming", "libming" ]
http://www.heynow.com/study/ming/artifacts/ Klaus Rechert 2008-07-24 07:02:28 EDT see URL
Bug 60 - Why does this 'C' shape have artifacts
https://api.github.com/repos/libming/libming/issues/17/comments
0
2013-08-18T17:35:47Z
2013-08-18T17:35:47Z
https://github.com/libming/libming/issues/17
18,210,577
17
[ "libming", "libming" ]
[email protected] 2008-07-22 10:40:20 EDT Would be nice to allow manual drawing of a font glyph set. Could be a function taking an SWFShape and using it as a given glyph number for a font (be it newly-created or created from file, in which case the glyph would be overwritten).
Bug 58 - Support for drawing font glyphs
https://api.github.com/repos/libming/libming/issues/16/comments
0
2013-08-18T17:34:31Z
2013-08-18T17:34:31Z
https://github.com/libming/libming/issues/16
18,210,558
16
[ "libming", "libming" ]
The page seems the default page of Wiki if the request header of `Accept-Language` is like below: ``` Accept-Language:ja,en-US;q=0.8,en;q=0.6 ``` The screen shot is here: ![screen shot 2013-06-19 at 23 42 46](https://f.cloud.github.com/assets/508822/675336/06db351e-d8ef-11e2-973b-7bb0c32605ec.png)
Top page of www.libming.org is confusing if `Accept-Language` is 'ja'
https://api.github.com/repos/libming/libming/issues/15/comments
2
2013-06-19T14:53:24Z
2017-12-06T18:26:00Z
https://github.com/libming/libming/issues/15
15,748,930
15
[ "libming", "libming" ]
Sorry. I catch exeption: Error: (ming) failed assertion 'SWFOutput_numSBits(dx) < 18' in shape.c:715 dx = 14
issue hardcode SWFOutput_numSBits(dx)
https://api.github.com/repos/libming/libming/issues/11/comments
0
2013-05-12T07:13:27Z
2013-05-12T07:13:27Z
https://github.com/libming/libming/issues/11
14,231,618
11
[ "libming", "libming" ]
After applying the patch from issue #9 for basic 5.4 compatibility, the build errors out with: ming.c: In function 'getInput_fromFileResource': ming.c:373:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfinput___construct': ming.c:413:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swffontcollection___construct': ming.c:452:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swffontcollection_getFont': ming.c:482:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfbrowserfont___construct': ming.c:530:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfcxform___construct': ming.c:576:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfinitaction___construct': ming.c:739:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfaction___construct': ming.c:788:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfbitmap___construct': ming.c:866:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:887:4: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:898:4: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:906:4: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfbutton___construct': ming.c:1167:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfbutton_addCharacter': ming.c:1300:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfbutton_addSound': ming.c:1387:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfdisplayitem_getMatrix': ming.c:1974:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfdisplayitem_getCharacter': ming.c:1995:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swffont___construct': ming.c:2369:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swffont_getShape': ming.c:2475:2: warning: 'SWFFont_getShape' is deprecated (declared at ../src/ming.h:445) [-Wdeprecated-declarations] ming.c: In function 'zim_swffiltermatrix___construct': ming.c:2540:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfshadow___construct': ming.c:2585:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfblur___construct': ming.c:2631:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfgradient___construct': ming.c:2668:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swffilter___construct': ming.c:3079:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmorph___construct': ming.c:3118:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmorph_getShape1': ming.c:3150:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmorph_getShape2': ming.c:3164:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfsoundstream___construct': ming.c:3208:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:3219:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfsound___construct': ming.c:3334:4: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:3346:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfvideostream___construct': ming.c:3482:4: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:3499:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfbinarydata___construct': ming.c:3649:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfprebuiltclip___construct': ming.c:3707:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c:3718:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmovie___construct': ming.c:3771:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmovie_add': ming.c:3883:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'phpStreamOutputMethod': ming.c:3960:2: warning: pointer targets in passing argument 2 of '_php_stream_write' differ in signedness [-Wpointer-sign] In file included from /usr/include/php/main/php.h:396:0, from ming.c:28: /usr/include/php/main/php_streams.h:300:15: note: expected 'const char _' but argument is of type 'byte *' ming.c: In function 'zim_swfmovie_streamMP3': ming.c:4245:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmovie_startSound': ming.c:4330:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmovie_importChar': ming.c:4372:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmovie_importFont': ming.c:4400:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfmovie_addFont': ming.c:4427:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfshape___construct': ming.c:4512:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfshape_addSolidFill': ming.c:4578:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfshape_addBitmapFill': ming.c:4621:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfshape_addGradientFill': ming.c:4667:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfshape_addFill': ming.c:4722:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfsprite___construct': ming.c:5212:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfsprite_add': ming.c:5262:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfsprite_startSound': ming.c:5345:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swfsprite_setSoundStream': ming.c:5403:3: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swftext___construct': ming.c:5524:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here ming.c: In function 'zim_swftextfield___construct': ming.c:5797:2: error: too few arguments to function 'zend_list_insert' In file included from /usr/include/php/Zend/zend_API.h:27:0, from /usr/include/php/main/php.h:38, from ming.c:28: /usr/include/php/Zend/zend_list.h:73:14: note: declared here make: *_\* [ming_la-ming.lo] Error 1
php extension does not compile against a ZTS enabled php 5.4
https://api.github.com/repos/libming/libming/issues/10/comments
1
2012-09-03T09:46:23Z
2017-10-01T22:03:03Z
https://github.com/libming/libming/issues/10
6,612,193
10
[ "libming", "libming" ]
ming 0.4.4's php extension fails to build with php 5.4. This was reported to debian here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662620 They applied a patch to fix it, but it contained a typo that made it fail to build with php < 5.4. I fixed the typo and applied it to MacPorts where it seems to work fine for php 5.3 and 5.4; I suggest you apply it to your sources: https://trac.macports.org/browser/trunk/dports/php/php-ming/files/patch-ming.c.diff?rev=93077
ming 0.4.4 php_ext fails to build with php 5.4
https://api.github.com/repos/libming/libming/issues/9/comments
0
2012-05-14T22:15:34Z
2013-06-08T19:38:34Z
https://github.com/libming/libming/issues/9
4,573,942
9
[ "libming", "libming" ]
The file php_ext/config.m4 which is in the repository and which was in the ming-0.4.3.tar.bz2 file available [on sourceforge](https://sourceforge.net/projects/ming/files/Releases/) is missing from the ming-0.4.4.tar.bz2 file available on sourceforge, therefore I can't run phpize, therefore the php module cannot be compiled. The php_ext/make_module.sh script is missing too, though I don't need that script.
php_ext/config.m4 missing
https://api.github.com/repos/libming/libming/issues/8/comments
0
2012-04-25T07:07:39Z
2012-04-25T07:07:39Z
https://github.com/libming/libming/issues/8
4,275,523
8
[ "libming", "libming" ]
Hi, I had brought this up on the mailing list a few weeks ago, about Ming_init() being called repeatedly by the php module. This has been working well: ``` diff --git a/php_ext/ming.c b/php_ext/ming.c index c4527a0..4504fe6 100644 --- a/php_ext/ming.c +++ b/php_ext/ming.c @@ -6199,12 +6199,20 @@ static void php_ming_error(const char *msg, ...) /* {{{ */ PHP_RINIT_FUNCTION(ming) /* {{{ */ { + /* guard against repeated calls to Ming_init() */ + static int guard = 0; + if ( guard ) { + /* repeat previous success */ + return SUCCESS; + } /* XXX - this didn't work so well last I tried.. */ if (Ming_init() != 0) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error initializing Ming module"); return FAILURE; } + /* guard against repeated calls to Ming_init() */ + guard = 1; return SUCCESS; } /* }}} */ ``` -Ed
PHP module: version warnings under httpd
https://api.github.com/repos/libming/libming/issues/6/comments
0
2012-01-05T12:06:54Z
2013-08-18T17:44:07Z
https://github.com/libming/libming/issues/6
2,734,560
6
[ "libming", "libming" ]
m = SWFBitmap('some.jpg') returns: swig/python detected a memory leak of type 'SWFInput *', no destructor found.
SWFBitmap cannot import JPG file in Python
https://api.github.com/repos/libming/libming/issues/5/comments
1
2011-12-11T01:13:24Z
2013-08-18T17:44:07Z
https://github.com/libming/libming/issues/5
2,514,244
5
[ "libming", "libming" ]
OpenBSD 4.9 i386 Build succeeds; make check stops in test/Font, listswf segfault. GDB: ``` #0 0x1c01507b in parseSWF_GLYPHENTRY (f=0x2f12b140, gerec=0x8acaa070, glyphbits=0, advancebits=9) at parser.c:245 245 gerec->GlyphIndex[0] = 0; /* for glyphbits == 0 */ (gdb) bt #0 0x1c01507b in parseSWF_GLYPHENTRY (f=0x2f12b140, gerec=0x8acaa070, glyphbits=0, advancebits=9) at parser.c:245 #1 0x1c0153e8 in parseSWF_TEXTRECORD (f=0x2f12b140, brec=0x7f46d1e0, glyphbits=0, advancebits=9, level=1) at parser.c:302 #2 0x1c01cc23 in parseSWF_DEFINETEXT (f=0x2f12b140, length=28) at parser.c:2262 #3 0x1c00a99f in blockParse (f=0x2f12b140, length=28, header=SWF_DEFINETEXT) at blocktypes.c:145 #4 0x1c008aa5 in readMovie (f=0x2f12b140) at main.c:265 #5 0x1c008e89 in main (argc=2, argv=0xcfbe93c4) at main.c:350 (gdb) p gerec->GlyphIndex[0] Cannot access memory at address 0x8a70a020 (gdb) p *gerec $1 = {GlyphIndex = 0x8a70a020, GlyphAdvance = 0x0} ```
In test/Font listswf is dumping core
https://api.github.com/repos/libming/libming/issues/4/comments
6
2011-12-07T15:02:45Z
2013-08-18T17:54:03Z
https://github.com/libming/libming/issues/4
2,475,455
4
[ "libming", "libming" ]
Apparently BSD and GNU make treat macros differently. ActionScriptTest.c loops over test cases from a string that originates in a Makefile macro; and expects ' ' (space) separators. Using isspace() lets the test run as expected. (This is likely the same for any *BSD.) diff -u: --- test/actionscript/ActionScriptTest.c-orig 2011-10-26 02:33:18.000000000 -0400 +++ test/actionscript/ActionScriptTest.c 2011-12-06 10:28:06.000000000 -0500 @@ -39,6 +39,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <limits.h> +#include <ctype.h> #include <makeswf.h> static SWFMovie @@ -82,18 +83,26 @@ const char *from, *to, *end; char *ptr; int version; - size_t len = strlen(all_tests); from = all_tests; - end = from+strlen(all_tests); - end = from+len; do { - while (*from && *from == ' ') ++from; - /\* EH: for BSD make, change test ' ' to isspace() */ - ``` while (*from && isspace(*from)) ++from; if ( ! *from ) break; ``` - ``` to=strchr(from, ' '); ``` - /\* strtok()? too much trouble */ - for (to = from; !isspace(*to); to++) { - if (*to == '\0') { - to = NULL; - break; - } - ``` } if ( ! to ) to = end; ``` - ``` size_t len = to-from; ``` - len = to-from; if ( len+1 >= PATH_MAX ) { fprintf(stderr,
test/actionscript/ActionScriptTest.c fails on OpenBSD 4.9
https://api.github.com/repos/libming/libming/issues/3/comments
12
2011-12-06T17:52:56Z
2013-08-18T17:51:40Z
https://github.com/libming/libming/issues/3
2,465,180
3
[ "libming", "libming" ]
I think this comment could be elaborated more. The first nibble in that byte is frame type, which could be either 1 for keyframe or 2 for inter frame, the next nibble (lower 4 bits) is codec id which should always be 3 for screen video.
src/blocks/videostream.c "special case" comment
https://api.github.com/repos/libming/libming/issues/2/comments
1
2011-09-07T14:16:49Z
2013-08-18T17:44:07Z
https://github.com/libming/libming/issues/2
1,589,662
2
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code I am using the exact example provided [here](https://ai.google.dev/gemma/docs/integrations/langchain): ```python from langchain_google_vertexai import GemmaVertexAIModelGarden llm = GemmaVertexAIModelGarden( endpoint_id=VERTEX_AI_ENDPOINT_ID, project=VERTEX_AI_PROJECT, location=VERTEX_AI_LOCATION, ) output = llm.invoke("What is the meaning of life?") print(output) ``` ### Error Message and Stack Trace (if applicable) ``` Traceback (most recent call last): File "C:\Users\18goldr\my_project\venv\Lib\site-packages\google\api_core\grpc_helpers.py", line 76, in error_remapped_callable return callable_(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\grpc\_channel.py", line 1181, in __call__ return _end_unary_response_blocking(state, call, False, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\grpc\_channel.py", line 1006, in _end_unary_response_blocking raise _InactiveRpcError(state) # pytype: disable=not-instantiable ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.FAILED_PRECONDITION details = "Failed to deserialize the JSON body into the target type: instances[0]: missing field `inputs` at line 1 column 55" debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.40.106:443 {created_time:"2024-08-10T20:51:37.8271213+00:00", grpc_status:9, grpc_message:"Failed to deserialize the JSON body into the target type: instances[0]: missing field `inputs` at line 1 column 55"}" > The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\18goldr\my_project\tests\gemma.py", line 14, in <module> output = llm.invoke("What is the meaning of life?") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\langchain_core\language_models\llms.py", line 344, in invoke self.generate_prompt( File "C:\Users\18goldr\my_project\venv\Lib\site-packages\langchain_core\language_models\llms.py", line 701, in generate_prompt return self.generate(prompt_strings, stop=stop, callbacks=callbacks, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\langchain_core\language_models\llms.py", line 880, in generate output = self._generate_helper( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\langchain_core\language_models\llms.py", line 738, in _generate_helper raise e File "C:\Users\18goldr\my_project\venv\Lib\site-packages\langchain_core\language_models\llms.py", line 725, in _generate_helper self._generate( File "C:\Users\18goldr\my_project\venv\Lib\site-packages\langchain_google_vertexai\model_garden.py", line 96, in _generate response = self.client.predict(endpoint=self.endpoint_path, instances=instances) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\google\cloud\aiplatform_v1\services\prediction_service\client.py", line 848, in predict response = rpc( ^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in __call__ return wrapped_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18goldr\my_project\venv\Lib\site-packages\google\api_core\grpc_helpers.py", line 78, in error_remapped_callable raise exceptions.from_grpc_error(exc) from exc google.api_core.exceptions.FailedPrecondition: 400 Failed to deserialize the JSON body into the target type: instances[0]: missing field `inputs` at line 1 column 55 ``` ### Description I'm trying to use the `langchain` library to use `Gemma2-9b-it` from `Google Vertex AI`. I expect it to do what's in the tutorial (ie. print the output). Instead, it prints an error about deserialization of JSON. ### System Info System Information ------------------ > OS: Windows > OS Version: 10.0.19045 > Python Version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] Package Information ------------------- > langchain_core: 0.2.29 > langchain: 0.2.12 > langsmith: 0.1.98 > langchain_google_vertexai: 1.0.8 > langchain_text_splitters: 0.2.2 Optional packages not installed ------------------------------- > langgraph > langserve Other Dependencies ------------------ > aiohttp: 3.10.3 > anthropic[vertexai]: Installed. No version info available. > async-timeout: Installed. No version info available. > google-cloud-aiplatform: 1.61.0 > google-cloud-storage: 2.18.2 > jsonpatch: 1.33 > numpy: 1.26.4 > orjson: 3.10.7 > packaging: 24.1 > pydantic: 2.8.2 > PyYAML: 6.0.2 > requests: 2.32.3 > SQLAlchemy: 2.0.32 > tenacity: 8.5.0 > typing-extensions: 4.12.2
JSON Deserialization Error When Trying To Run Gemma Through Vertex AI
https://api.github.com/repos/langchain-ai/langchain/issues/25268/comments
0
2024-08-10T21:08:48Z
2024-08-10T21:11:30Z
https://github.com/langchain-ai/langchain/issues/25268
2,459,290,965
25,268
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code ```shell cd libs/core poetry install --with test make test ``` ### Error Message and Stack Trace (if applicable) # output ```shell poetry run pytest tests/unit_tests/ ========================================================================= test session starts ========================================================================== platform linux -- Python 3.11.9, pytest-7.4.4, pluggy-1.5.0 rootdir: /home/cheney/expr/langchain/libs/core configfile: pyproject.toml plugins: asyncio-0.21.2, mock-3.14.0, vcr-1.0.2, cov-4.1.0, anyio-4.4.0, dotenv-0.5.2, profiling-1.7.0, requests-mock-1.12.1, syrupy-4.6.1, socket-0.6.0 asyncio: mode=Mode.AUTO collected 1040 items tests/unit_tests/test_globals.py . [ 0%] tests/unit_tests/test_graph_vectorstores.py .. [ 0%] tests/unit_tests/test_imports.py .. [ 0%] tests/unit_tests/test_messages.py .......................................... [ 4%] tests/unit_tests/test_outputs.py .. [ 4%] tests/unit_tests/test_sys_info.py . [ 4%] tests/unit_tests/test_tools.py ......................................................................................................s. [ 14%] tests/unit_tests/_api/test_beta_decorator.py ............. [ 16%] tests/unit_tests/_api/test_deprecation.py ............... [ 17%] tests/unit_tests/_api/test_imports.py . [ 17%] tests/unit_tests/_api/test_path.py . [ 17%] tests/unit_tests/caches/test_in_memory_cache.py ......... [ 18%] tests/unit_tests/callbacks/test_dispatch_custom_event.py ..... [ 19%] tests/unit_tests/callbacks/test_imports.py . [ 19%] tests/unit_tests/chat_history/test_chat_history.py ... [ 19%] tests/unit_tests/document_loaders/test_base.py .... [ 19%] tests/unit_tests/documents/test_imports.py . [ 19%] tests/unit_tests/documents/test_str.py .. [ 20%] tests/unit_tests/embeddings/test_deterministic_embedding.py . [ 20%] tests/unit_tests/example_selectors/test_base.py .. [ 20%] tests/unit_tests/example_selectors/test_imports.py . [ 20%] tests/unit_tests/example_selectors/test_length_based_example_selector.py .... [ 20%] tests/unit_tests/example_selectors/test_similarity.py .......... [ 21%] tests/unit_tests/fake/test_fake_chat_model.py ...... [ 22%] tests/unit_tests/indexing/test_hashed_document.py ..... [ 22%] tests/unit_tests/indexing/test_in_memory_indexer.py ........................ [ 25%] tests/unit_tests/indexing/test_in_memory_record_manager.py ......... [ 26%] tests/unit_tests/indexing/test_indexing.py .......................... [ 28%] tests/unit_tests/indexing/test_public_api.py . [ 28%] tests/unit_tests/language_models/test_imports.py . [ 28%] tests/unit_tests/language_models/chat_models/test_base.py .............. [ 30%] tests/unit_tests/language_models/chat_models/test_cache.py ........x... [ 31%] tests/unit_tests/language_models/chat_models/test_rate_limiting.py ......... [ 32%] tests/unit_tests/language_models/llms/test_base.py ........ [ 32%] tests/unit_tests/language_models/llms/test_cache.py .... [ 33%] tests/unit_tests/load/test_imports.py . [ 33%] tests/unit_tests/load/test_serializable.py ... [ 33%] tests/unit_tests/messages/test_ai.py .. [ 33%] tests/unit_tests/messages/test_imports.py . [ 33%] tests/unit_tests/messages/test_utils.py ........................... [ 36%] tests/unit_tests/output_parsers/test_base_parsers.py .. [ 36%] tests/unit_tests/output_parsers/test_imports.py . [ 36%] tests/unit_tests/output_parsers/test_json.py .................................. [ 40%] tests/unit_tests/output_parsers/test_list_parser.py ......... [ 40%] tests/unit_tests/output_parsers/test_openai_functions.py ............ [ 42%] tests/unit_tests/output_parsers/test_openai_tools.py ...........s [ 43%] tests/unit_tests/output_parsers/test_pydantic_parser.py ...... [ 43%] tests/unit_tests/output_parsers/test_xml_parser.py .............. [ 45%] tests/unit_tests/outputs/test_chat_generation.py ...... [ 45%] tests/unit_tests/outputs/test_imports.py . [ 45%] tests/unit_tests/prompts/test_chat.py .................................... [ 49%] tests/unit_tests/prompts/test_few_shot.py ................ [ 50%] tests/unit_tests/prompts/test_few_shot_with_templates.py .. [ 51%] tests/unit_tests/prompts/test_image.py .. [ 51%] tests/unit_tests/prompts/test_imports.py . [ 51%] tests/unit_tests/prompts/test_loading.py .......... [ 52%] tests/unit_tests/prompts/test_pipeline_prompt.py .... [ 52%] tests/unit_tests/prompts/test_prompt.py ........................................ [ 56%] tests/unit_tests/prompts/test_structured.py .. [ 56%] tests/unit_tests/prompts/test_utils.py . [ 56%] tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py ..... [ 57%] tests/unit_tests/runnables/test_config.py .... [ 57%] tests/unit_tests/runnables/test_configurable.py ..... [ 58%] tests/unit_tests/runnables/test_context.py ................ [ 59%] tests/unit_tests/runnables/test_fallbacks.py ............ [ 60%] tests/unit_tests/runnables/test_graph.py ....... [ 61%] tests/unit_tests/runnables/test_history.py .................... [ 63%] tests/unit_tests/runnables/test_imports.py . [ 63%] tests/unit_tests/runnables/test_runnable.py .............................................................................................. [ 72%] tests/unit_tests/runnables/test_runnable_events_v1.py ...........x.....x.X [ 74%] tests/unit_tests/runnables/test_runnable_events_v2.py .............x................... [ 77%] tests/unit_tests/runnables/test_tracing_interops.py .............. [ 79%] tests/unit_tests/runnables/test_utils.py ...... [ 79%] tests/unit_tests/stores/test_in_memory.py ................................ [ 82%] tests/unit_tests/tracers/test_async_base_tracer.py ............ [ 83%] tests/unit_tests/tracers/test_base_tracer.py ............. [ 85%] tests/unit_tests/tracers/test_imports.py . [ 85%] tests/unit_tests/tracers/test_langchain.py .... [ 85%] tests/unit_tests/tracers/test_memory_stream.py .... [ 85%] tests/unit_tests/tracers/test_run_collector.py . [ 86%] tests/unit_tests/tracers/test_schemas.py . [ 86%] tests/unit_tests/utils/test_aiter.py .... [ 86%] tests/unit_tests/utils/test_env.py . [ 86%] tests/unit_tests/utils/test_function_calling.py ..x.......... [ 87%] tests/unit_tests/utils/test_html.py ........... [ 88%] tests/unit_tests/utils/test_imports.py . [ 89%] tests/unit_tests/utils/test_iter.py .... [ 89%] tests/unit_tests/utils/test_json_schema.py .......... [ 90%] tests/unit_tests/utils/test_pydantic.py ......s.. [ 91%] tests/unit_tests/utils/test_rm_titles.py .... [ 91%] tests/unit_tests/utils/test_utils.py .....................................s.......... [ 96%] tests/unit_tests/vectorstores/test_in_memory.py ................................... [ 99%] tests/unit_tests/vectorstores/test_vectorstore.py .... [100%] =========================================================================== warnings summary =========================================================================== tests/unit_tests/test_messages.py::test_convert_to_messages /home/cheney/expr/langchain/libs/core/langchain_core/_api/beta_decorator.py:87: LangChainBetaWarning: The class `RemoveMessage` is in beta. It is actively being worked on, so the API may change. warn_beta( tests/unit_tests/test_messages.py::test_tool_message_serdes /home/cheney/expr/langchain/libs/core/langchain_core/_api/beta_decorator.py:87: LangChainBetaWarning: The function `load` is in beta. It is actively being worked on, so the API may change. warn_beta( tests/unit_tests/test_tools.py::test_convert_from_runnable_dict tests/unit_tests/runnables/test_runnable_events_v1.py::test_event_stream_with_simple_function_tool /home/cheney/expr/langchain/libs/core/langchain_core/_api/beta_decorator.py:87: LangChainBetaWarning: This API is in beta and may change in the future. warn_beta( tests/unit_tests/test_tools.py::test_args_schema_as_pydantic[FooProper] tests/unit_tests/test_tools.py::test_args_schema_as_pydantic[FooProper] tests/unit_tests/test_tools.py::test_args_schema_explicitly_typed tests/unit_tests/test_tools.py::test_args_schema_explicitly_typed tests/unit_tests/test_tools.py::test_structured_tool_with_different_pydantic_versions[FooProper] tests/unit_tests/test_tools.py::test_structured_tool_with_different_pydantic_versions[FooProper] tests/unit_tests/test_tools.py::test_tool_args_schema_pydantic_v2_with_metadata /home/cheney/expr/langchain/.venv/lib/python3.11/site-packages/pydantic/main.py:1328: PydanticDeprecatedSince20: The `schema` method is deprecated; use `model_json_schema` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/ warnings.warn( tests/unit_tests/test_tools.py::test_structured_tool_with_different_pydantic_versions[FooProper] tests/unit_tests/test_tools.py::test_tool_args_schema_pydantic_v2_with_metadata tests/unit_tests/test_tools.py::test_tool_args_schema_pydantic_v2_with_metadata /home/cheney/expr/langchain/.venv/lib/python3.11/site-packages/pydantic/main.py:1132: PydanticDeprecatedSince20: The `parse_obj` method is deprecated; use `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/ warnings.warn( tests/unit_tests/test_tools.py::test_structured_tool_with_different_pydantic_versions[FooProper] tests/unit_tests/test_tools.py::test_tool_args_schema_pydantic_v2_with_metadata /home/cheney/expr/langchain/.venv/lib/python3.11/site-packages/pydantic/main.py:1087: PydanticDeprecatedSince20: The `dict` method is deprecated; use `model_dump` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/ warnings.warn('The `dict` method is deprecated; use `model_dump` instead.', category=PydanticDeprecatedSince20) tests/unit_tests/indexing/test_in_memory_indexer.py::TestDocumentIndexerTestSuite::test_upsert_documents_has_no_ids /home/cheney/expr/langchain/libs/core/langchain_core/_api/beta_decorator.py:87: LangChainBetaWarning: Introduced in version 0.2.29. Underlying abstraction subject to change. warn_beta( tests/unit_tests/language_models/chat_models/test_rate_limiting.py::test_rate_limit_invoke /home/cheney/expr/langchain/libs/core/langchain_core/_api/beta_decorator.py:87: LangChainBetaWarning: Introduced in 0.2.24. API subject to change. warn_beta( tests/unit_tests/output_parsers/test_pydantic_parser.py::test_pydantic_parser_chaining[ForecastV2] tests/unit_tests/output_parsers/test_pydantic_parser.py::test_pydantic_parser_chaining[ForecastV2] tests/unit_tests/output_parsers/test_pydantic_parser.py::test_pydantic_parser_chaining[ForecastV2] tests/unit_tests/output_parsers/test_pydantic_parser.py::test_pydantic_parser_validation[ForecastV2] tests/unit_tests/output_parsers/test_pydantic_parser.py::test_pydantic_parser_validation[ForecastV2] tests/unit_tests/output_parsers/test_pydantic_parser.py::test_pydantic_parser_validation[ForecastV2] /home/cheney/expr/langchain/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py:268: PydanticDeprecatedSince20: The `__fields__` attribute is deprecated, use `model_fields` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/ warnings.warn( tests/unit_tests/prompts/test_chat.py::test_message_prompt_template_from_template_file tests/unit_tests/prompts/test_prompt.py::test_prompt_from_file /home/cheney/expr/langchain/libs/core/langchain_core/prompts/prompt.py:237: DeprecationWarning: `input_variables' is deprecated and ignored. warnings.warn( tests/unit_tests/prompts/test_image.py::test_image_prompt_template_deserializable /home/cheney/expr/langchain/libs/core/langchain_core/_api/beta_decorator.py:87: LangChainBetaWarning: The function `loads` is in beta. It is actively being worked on, so the API may change. warn_beta( tests/unit_tests/vectorstores/test_in_memory.py::test_inmemory_upsert tests/unit_tests/vectorstores/test_in_memory.py::test_inmemory_upsert /home/cheney/expr/langchain/libs/core/langchain_core/_api/deprecation.py:141: LangChainDeprecationWarning: This was a beta API that was added in 0.2.11. It'll be removed in 0.3.0. warn_deprecated( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ----------------------------------------------------------------------- snapshot report summary ------------------------------------------------------------------------ 54 snapshots passed. ========================================================================= slowest 5 durations ========================================================================== 5.11s call tests/unit_tests/test_imports.py::test_importable_all_via_subprocess 1.50s call tests/unit_tests/runnables/test_runnable.py::test_retrying 0.77s call tests/unit_tests/runnables/test_runnable.py::test_map_astream 0.61s call tests/unit_tests/runnables/test_runnable.py::test_map_stream 0.50s call tests/unit_tests/runnables/test_runnable_events_v2.py::test_cancel_astream_events ================================================= 1030 passed, 4 skipped, 5 xfailed, 1 xpassed, 29 warnings in 21.37s ================================================== ``` ### Description I haven't changed the code, the code is from the master branch. In `libs/core`, tests cannot pass all tests, and some test cases fail. ### System Info python: 3.11.9
(core)(test): core tests cannot pass all tests, and some test cases fail
https://api.github.com/repos/langchain-ai/langchain/issues/25261/comments
0
2024-08-10T09:13:45Z
2024-08-10T11:01:46Z
https://github.com/langchain-ai/langchain/issues/25261
2,459,001,188
25,261
[ "hwchase17", "langchain" ]
### Privileged issue - [X] I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here. ### Issue Content Currently, the Firecrawl loader only supports usage of the API and does not support self-hosted instances. I will create a pull request to fix this.
Enhancement: Adding Firecrawl API URL option for document loader for self-hosted Firecrawl instance
https://api.github.com/repos/langchain-ai/langchain/issues/25259/comments
0
2024-08-10T06:12:14Z
2024-08-10T06:13:50Z
https://github.com/langchain-ai/langchain/issues/25259
2,458,929,193
25,259
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Description Issue When using the ChatHuggingFace model from the langchain_huggingface library with a locally downloaded model, the system prompts for a Hugging Face API key. This behavior persists even though the model is stored locally and accessed without an internet connection. The issue does not occur when using the llm.invoke() method directly with the HuggingFacePipeline. Description I have downloaded an LLM model locally and want to access it without an internet connection. The model works correctly when invoked directly using llm.invoke(), but when attempting to use the ChatHuggingFace model, it requires a Hugging Face API key. ### Example Code from transformers import BitsAndBytesConfig from langchain_huggingface import HuggingFacePipeline from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline #### Define Quantization quantization_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype="bfloat16", bnb_4bit_use_double_quant=True ) #### Initialize LLM and Parameters model_id = "microsoft/Phi-3-mini-4k-instruct" tokenizer = AutoTokenizer.from_pretrained("../Phi-3-mini-4k-instruct/") model = AutoModelForCausalLM.from_pretrained("../Phi-3-mini-4k-instruct/", quantization_config=quantization_config) #### Initialize pipeline pipe = pipeline( task="text-generation", model=model, tokenizer=tokenizer, max_new_tokens=1024, do_sample=False, repetition_penalty=1.03, ) #### Initialize HuggingFace Pipeline llm = HuggingFacePipeline( pipeline=pipe, ) #### Successful Invocation llm.invoke("What is HuggingFace?") (Output: "What is HuggingFace?\n\nHuggingFace is a company and an open-source community...") #### Using Chat Model from langchain_huggingface import ChatHuggingFace llm_engine_hf = ChatHuggingFace(llm=llm) llm_engine_hf.invoke("Hugging Face is") #### Error encountered """ Error Message LocalTokenNotFoundError: Token is required (`token=True`), but no token found. You need to provide a token or be logged in to Hugging Face with `huggingface-cli login` or `huggingface_hub.login`. See https://huggingface.co/settings/tokens """ ### Error Message and Stack Trace (if applicable) Error Message LocalTokenNotFoundError: Token is required (`token=True`), but no token found. You need to provide a token or be logged in to Hugging Face with `huggingface-cli login` or `huggingface_hub.login`. See https://huggingface.co/settings/tokens ### System Info linux - ubuntu 20.04.06 LTS Python - 3.8 langchain-huggingface==0.0.3
`ChatHuggingFace` Asking for API Token Even for Locally Downloaded Model
https://api.github.com/repos/langchain-ai/langchain/issues/25258/comments
0
2024-08-10T02:32:41Z
2024-08-10T02:37:26Z
https://github.com/langchain-ai/langchain/issues/25258
2,458,859,649
25,258
[ "hwchase17", "langchain" ]
### URL https://python.langchain.com/v0.2/docs/tutorials/agents/ ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: Referencing this tutorial: https://python.langchain.com/v0.2/docs/tutorials/agents/ This does not work unless you import from langgraph-checkpoint-sqlite: langgraph.checkpoint.sqlite import SqliteSaver This generates an error: agent_executor = create_react_agent(model, tools, checkpointer=memory) The error is: Traceback (most recent call last): File "c:\Users\steph\source\repos\git-repos\LangChain-101-For-Beginners-Python\my-lesson-04a-build-an-agent.py", line 23, in <module> agent_executor = create_react_agent(model, tools, checkpointer=memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\steph\.virtualenvs\LangChain-101-For-Beginners-Python-fkBkJkaL\Lib\site-packages\langgraph\_api\deprecation.py", line 80, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\steph\.virtualenvs\LangChain-101-For-Beginners-Python-fkBkJkaL\Lib\site-packages\langgraph\prebuilt\chat_agent_executor.py", line 511, in create_react_agent return workflow.compile( ^^^^^^^^^^^^^^^^^ File "C:\Users\steph\.virtualenvs\LangChain-101-For-Beginners-Python-fkBkJkaL\Lib\site-packages\langgraph\graph\state.py", line 431, in compile compiled = CompiledStateGraph( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\steph\.virtualenvs\LangChain-101-For-Beginners-Python-fkBkJkaL\Lib\site-packages\langchain_core\load\serializable.py", line 113, in __init__ super().__init__(*args, **kwargs) File "C:\Users\steph\.virtualenvs\LangChain-101-For-Beginners-Python-fkBkJkaL\Lib\site-packages\pydantic\v1\main.py", line 341, in __init__ raise validation_error pydantic.v1.error_wrappers.ValidationError: 1 validation error for CompiledStateGraph checkpointer instance of BaseCheckpointSaver expected (type=type_error.arbitrary_type; expected_arbitrary_type=BaseCheckpointSaver) ### Idea or request for content: _No response_
DOC: <Issue related to /v0.2/docs/tutorials/agents/>
https://api.github.com/repos/langchain-ai/langchain/issues/25257/comments
0
2024-08-09T23:43:41Z
2024-08-09T23:46:09Z
https://github.com/langchain-ai/langchain/issues/25257
2,458,798,344
25,257
[ "hwchase17", "langchain" ]
### URL https://python.langchain.com/v0.2/docs/integrations/tools/tavily_search/ ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: In the [installation](https://python.langchain.com/v0.2/docs/integrations/tools/tavily_search/#instantiation) part of the TavilySearch the import of the TavilySearchResults is wrong. ### Idea or request for content: The import should be ```from langchain_community.tools.tavily_search import TavilySearchResults``` instead of ```from langchain_community.tools import TavilySearchResults``` (missing ```.tavily_search``` after **tools**)
Incorrect Import Statement DOC: <Issue related to /v0.2/docs/integrations/tools/tavily_search/>
https://api.github.com/repos/langchain-ai/langchain/issues/25256/comments
0
2024-08-09T21:39:28Z
2024-08-09T21:41:58Z
https://github.com/langchain-ai/langchain/issues/25256
2,458,697,633
25,256
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code VLLM._generate = generate self.model = VLLM(model= model_name, quantization="awq", trust_remote_code=config.trust_remote_code, max_new_tokens=config.max_new_tokens, batch_size = config.batch_size, top_k=config.top_k, top_p=config.top_p, temperature=config.temperature, repetition_penalty=1.1, stream=True, vllm_kwargs={"max_model_len":4096,"gpu_memory_utilization":0.5} ) #self.cache = OrderedDict() #self.capacity = 500 self.logger.info("model loaded succesfully") except TypeError as e: self.logger.error(f"TypeError initializing model: {e}") except ValueError as e: self.logger.error(f"ValueError initializing model: {e}") except Exception as e: self.logger.error(f"Error initializing model: {e}") ### Error Message and Stack Trace (if applicable) 2024-08-09 20:01:33,991 - INFO - Model Name: /home/llama3.1-instruct-8b-sft-lora 2024-08-09 20:01:35,845 - ERROR - Error initializing model: 'type' ### Description I am trying to load the llama model with langchain vllm,, but unable to do so ### System Info langchain==0.1.20 langchain-community==0.0.38 langchain-core==0.1.52 langchain-experimental==0.0.47 langchain-text-splitters==0.0.1
not able to load llama 3.1 quantised model with langchain vllm
https://api.github.com/repos/langchain-ai/langchain/issues/25251/comments
0
2024-08-09T20:10:10Z
2024-08-09T20:12:40Z
https://github.com/langchain-ai/langchain/issues/25251
2,458,599,755
25,251
[ "hwchase17", "langchain" ]
### URL https://python.langchain.com/v0.2/docs/integrations/text_embedding/cohere/ ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: ModuleNotFoundError Traceback (most recent call last) [<ipython-input-5-3c65dae4e654>](https://localhost:8080/#) in <cell line: 3>() 1 from langchain_community.document_loaders import WebBaseLoader 2 from langchain_community.vectorstores import FAISS ----> 3 from langchain_cohere import CohereEmbeddings 4 from langchain_text_splitters import RecursiveCharacterTextSplitter ModuleNotFoundError: No module named 'langchain_cohere' the link for the documentation i am referring to is: https://python.langchain.com/v0.2/docs/integrations/text_embedding/cohere/ ### Idea or request for content: This is the modification i have done! from langchain_community.document_loaders import WebBaseLoader from langchain_community.vectorstores import FAISS from langchain.embeddings import CohereEmbeddings from langchain_text_splitters import RecursiveCharacterTextSplitter
DOC: <Issue related to /v0.2/docs/integrations/text_embedding/cohere/>
https://api.github.com/repos/langchain-ai/langchain/issues/25238/comments
0
2024-08-09T15:51:59Z
2024-08-09T15:54:37Z
https://github.com/langchain-ai/langchain/issues/25238
2,458,215,625
25,238
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code The following code causes an issue where the AI is unable to invoke the tool properly This is happening because the argument name is "config" The error being thrown is - `TypeError: get_save_create_table_config.<locals>.save_create_table_config() missing 1 required positional argument: 'config'` ``` @tool def save_create_table_config(config: CreateTableConfig) -> str: '''Calls the endpoint to save the CreateTableConfig''' .... return ... ``` By simply renaming the argument to something else, the tool invocation works perfectly ``` @tool def save_create_table_config(create_table_config: CreateTableConfig) -> str: '''Calls the endpoint to save the CreateTableConfig''' .... return ... ``` ### Error Message and Stack Trace (if applicable) ```TypeError("get_save_create_table_config.<locals>.save_create_table_config() missing 1 required positional argument: 'config'")Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/langchain/agents/agent_iterator.py", line 266, in __aiter__ async for chunk in self.agent_executor._aiter_next_step( File "/usr/local/lib/python3.11/site-packages/langchain/agents/agent.py", line 1539, in _aiter_next_step result = await asyncio.gather( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain/agents/agent.py", line 1572, in _aperform_agent_action observation = await tool.arun( ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/tools.py", line 729, in arun raise error_to_raise File "/usr/local/lib/python3.11/site-packages/langchain_core/tools.py", line 696, in arun response = await asyncio.create_task(coro, context=context) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/tools.py", line 947, in _arun return await super()._arun( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/tools.py", line 496, in _arun return await run_in_executor(None, self._run, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/runnables/config.py", line 619, in run_in_executor return await asyncio.get_running_loop().run_in_executor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/runnables/config.py", line 610, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/tools.py", line 927, in _run return self.func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: get_save_create_table_config.<locals>.save_create_table_config() missing 1 required positional argument: 'config'``` ### System Info System Information ------------------ > OS: Darwin > OS Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 > Python Version: 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] Package Information ------------------- > langchain_core: 0.2.29 > langchain: 0.2.12 > langchain_community: 0.2.11 > langsmith: 0.1.81 > langchain_anthropic: 0.1.22 > langchain_experimental: 0.0.64 > langchain_google_community: 1.0.7 > langchain_google_genai: 1.0.4 > langchain_google_vertexai: 1.0.8 > langchain_postgres: 0.0.9 > langchain_text_splitters: 0.2.0 > langgraph: 0.0.51 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > aiohttp: 3.9.5 > anthropic: 0.33.0 > anthropic[vertexai]: Installed. No version info available. > async-timeout: Installed. No version info available. > beautifulsoup4: 4.12.3 > dataclasses-json: 0.6.6 > db-dtypes: Installed. No version info available. > defusedxml: 0.7.1 > gapic-google-longrunning: Installed. No version info available. > google-api-core: 2.19.1 > google-api-python-client: 2.133.0 > google-auth-httplib2: 0.2.0 > google-auth-oauthlib: 1.2.0 > google-cloud-aiplatform: 1.61.0 > google-cloud-bigquery: 3.25.0 > google-cloud-bigquery-storage: Installed. No version info available. > google-cloud-contentwarehouse: Installed. No version info available. > google-cloud-discoveryengine: Installed. No version info available. > google-cloud-documentai: Installed. No version info available. > google-cloud-documentai-toolbox: Installed. No version info available. > google-cloud-speech: Installed. No version info available. > google-cloud-storage: 2.18.2 > google-cloud-texttospeech: Installed. No version info available. > google-cloud-translate: Installed. No version info available. > google-cloud-vision: 3.7.2 > google-generativeai: 0.5.4 > googlemaps: Installed. No version info available. > grpcio: 1.65.4 > jsonpatch: 1.33 > lxml: 5.2.2 > numpy: 1.26.4 > orjson: 3.10.5 > packaging: 24.1 > pandas: 2.2.2 > pgvector: 0.2.5 > pillow: 10.3.0 > psycopg: 3.2.1 > psycopg-pool: 3.2.2 > pyarrow: 16.1.0 > pydantic: 2.8.2 > PyYAML: 6.0.1 > requests: 2.32.3 > SQLAlchemy: 2.0.30 > sqlalchemy: 2.0.30 > tenacity: 8.3.0 > typing-extensions: 4.12.2 > uuid6: 2024.1.12
Show proper error when tool function argument is named "config"
https://api.github.com/repos/langchain-ai/langchain/issues/25228/comments
0
2024-08-09T11:11:18Z
2024-08-09T11:15:24Z
https://github.com/langchain-ai/langchain/issues/25228
2,457,686,325
25,228
[ "hwchase17", "langchain" ]
### URL https://python.langchain.com/v0.2/docs/integrations/chat/zhipuai/ ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: import os import platform from typing import Optional, Type from langchain.pydantic_v1 import BaseModel, Field from langchain.tools import BaseTool, StructuredTool, tool from langchain.callbacks.manager import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) # 创建一个桌面文件夹 def create_folder_on_desktop(folder_name: Optional[str] = None) -> str: if not folder_name: folder_name = 'workspace' # 获取当前操作系统 os_type = platform.system() # print(os_type) # 根据操作系统获取桌面路径 if os_type == "Windows": desktop_path = os.path.join(os.path.expanduser("~"), "Desktop") elif os_type == "Darwin": # macOS 的系统名称是 "Darwin" desktop_path = os.path.join(os.path.expanduser("~"), "Desktop") else: raise OSError("Unsupported operating system") # 创建文件夹路径 folder_path = os.path.join(desktop_path, folder_name) # 如果文件夹不存在,则创建 if not os.path.exists(folder_path): os.makedirs(folder_path) return folder_path # langchain 使用2个或以上参数时会报错,暂时无解决方案 class WriteDocument(BaseModel): filename: str = Field(description="The name of the file") file_content: str = Field(description="Contents of the file") class WriteFilesTool(BaseTool): name = "write_document" description = "Write the file contents to the file." args_schema: Type[BaseModel] = WriteDocument return_direct: bool = False def _run( self, filename: str, file_content: str, run_manager: Optional[CallbackManagerForToolRun] = None ) -> str: """Write the file contents to the file.""" # 文件夹的名称 folder_name = 'workspace' # 获取桌面文件夹路径 current_path = create_folder_on_desktop(folder_name) # 创建并写入内容到 .md 文件 file_path = os.path.join(current_path, filename) with open(file_path, 'w', encoding='utf-8') as f: f.write(file_content) return "The file has been written successfully." async def _arun( self, a: int, b: int, run_manager: Optional[AsyncCallbackManagerForToolRun] = None, ) -> str: """Use the tool asynchronously.""" raise NotImplementedError("Calculator does not support async") # exector from langchain_community.chat_models import ChatZhipuAI from langchain import hub from langchain.agents import AgentExecutor, create_json_chat_agent, create_tool_calling_agent, create_react_agent from langchain_community.tools.tavily_search import TavilySearchResults from langchain_experimental.tools import PythonREPLTool from write_file_tool import WriteFilesTool from dotenv import load_dotenv, find_dotenv import os load_dotenv(find_dotenv()) key = os.environ['ZHIPUAI_API_KEY'] tools = [TavilySearchResults(max_results=3), WriteFilesTool()] # prompt = hub.pull("hwchase17/react-chat-json") prompt = hub.pull("hwchase17/react") llm = ChatZhipuAI(temperature=0.6, model="glm-4") # agent = create_json_chat_agent(llm, tools, prompt) agent = create_react_agent(llm, tools, prompt) # 代理执行器 agent_executor = AgentExecutor( agent=agent, tools=tools, verbose=True ) # langchain的使用教程,并把内容写入到markdown文件中 result = agent_executor.invoke({'input': 'langchain的使用教程,并把内容写入到markdown文件中'}) print(result['output']) ### Idea or request for content: langchain 0.2.12 langchain-anthropic 0.1.22 langchain-community 0.2.11 langchain-core 0.2.29 langchain-experimental 0.0.64 langchain-openai 0.1.20 langchain-text-splitters 0.2.2 langchainhub 0.1.20 langgraph 0.2.2 langgraph-checkpoint 1.0.2 langsmith 0.1.98 pydantic 2.8.2 pydantic_core 2.20.1
DOC: <Issue related to /v0.2/docs/integrations/chat/zhipuai/>
https://api.github.com/repos/langchain-ai/langchain/issues/25224/comments
0
2024-08-09T09:18:38Z
2024-08-09T09:21:19Z
https://github.com/langchain-ai/langchain/issues/25224
2,457,490,436
25,224
[ "hwchase17", "langchain" ]
### URL https://python.langchain.com/v0.2/docs/how_to/functions/ ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: At the end of the second paragraph: Note that all inputs to these functions need to be a SINGLE argument. If you have a function that accepts multiple arguments, you should write a wrapper that accepts a single dict input and unpacks it into multiple **argument**. May be "arguments"? ### Idea or request for content: _No response_
Grammar Error?
https://api.github.com/repos/langchain-ai/langchain/issues/25222/comments
0
2024-08-09T08:07:21Z
2024-08-09T08:09:53Z
https://github.com/langchain-ai/langchain/issues/25222
2,457,362,330
25,222
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace from langchain_community.callbacks import get_openai_callback llm = HuggingFaceEndpoint( repo_id=repo_id, temperature=0.01,max_new_tokens=2048, huggingfacehub_api_token=HUGGINGFACE_API_KEY) llm = ChatHuggingFace(llm=llm) messages = [ ( "system", "You are a smart AI that understand the tabular data structure.", ), ("user", f"{prompt}"), ] with get_openai_callback() as cb: response = llm.invoke(messages) print(cb) if not isinstance(response, str): response = response.content print(response)**** ### Error Message and Stack Trace (if applicable) Tokens Used: 1668 Prompt Tokens: 1568 Completion Tokens: 100 Successful Requests: 1 ### Description I am trying to use the `Mistral-7B` model from the huggingface. While I am using the `HuggingFaceEndpoint` I am getting the expected answer. But while using the `ChatHuggingFace` , I am always getting 100 tokens. I have gone through the existing issues but couldn't find the solutions yet. ### System Info System Information ------------------ > OS: Linux > OS Version: #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 > Python Version: 3.10.0 (default, Mar 3 2022, 09:58:08) [GCC 7.5.0] Package Information ------------------- > langchain_core: 0.2.29 > langchain: 0.2.12 > langchain_community: 0.2.11 > langsmith: 0.1.98 > langchain_huggingface: 0.0.3 > langchain_text_splitters: 0.2.2
ChatHuggingFace always returns only 100 tokens as response without considering the `max_new_tokens` parameter
https://api.github.com/repos/langchain-ai/langchain/issues/25219/comments
4
2024-08-09T05:31:22Z
2024-08-10T13:20:44Z
https://github.com/langchain-ai/langchain/issues/25219
2,457,136,389
25,219
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code Top ``` python import logging import os import random from concurrent.futures import ThreadPoolExecutor, as_completed from enum import Enum from typing import BinaryIO from typing import cast, Literal, Union from langchain_community.document_loaders.generic import GenericLoader from langchain_community.document_loaders.parsers.audio import OpenAIWhisperParser from pydub import AudioSegment from cache import conditional_lru_cache from youtube.loader import YoutubeAudioLoader .... loader = GenericLoader(YoutubeAudioLoader([url], save_dir, proxy_servers), OpenAIWhisperParser(api_key=get_settings().openai_api_key, language=lang.value, response_format="srt", temperature=0 )) ``` YoutubeAudioLoader is my customization of Langchain YoutubeAudioLoader which allows the use of a proxy for Youtube. ```python import random from typing import Iterable, List from langchain_community.document_loaders.blob_loaders import FileSystemBlobLoader from langchain_community.document_loaders.blob_loaders.schema import Blob, BlobLoader class YoutubeAudioLoader(BlobLoader): """Load YouTube urls as audio file(s).""" def __init__(self, urls: List[str], save_dir: str, proxy_servers: List[str] = None): if not isinstance(urls, list): raise TypeError("urls must be a list") self.urls = urls self.save_dir = save_dir self.proxy_servers = proxy_servers def yield_blobs(self) -> Iterable[Blob]: """Yield audio blobs for each url.""" try: import yt_dlp except ImportError: raise ImportError( "yt_dlp package not found, please install it with " "`pip install yt_dlp`" ) # Use yt_dlp to download audio given a YouTube url ydl_opts = { "format": "m4a/bestaudio/best", "noplaylist": True, "outtmpl": self.save_dir + "/%(title)s.%(ext)s", "postprocessors": [ { "key": "FFmpegExtractAudio", "preferredcodec": "m4a", } ], 'netrc': True, 'verbose': True, "extractor_args": {"youtube": "youtube:player_skip=webpage"} } if (self.proxy_servers): ydl_opts["proxy"] = random.choice(self.proxy_servers) for url in self.urls: # Download file with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download(url) # Yield the written blobs loader = FileSystemBlobLoader(self.save_dir, glob="*.m4a") for blob in loader.yield_blobs(): yield blob ``` ## My workaround in `OpenAIWhisperParser` class ``` python if hasattr(transcript, 'text'): yield Document( page_content=transcript.text, metadata={"source": blob.source, "chunk": split_number}, ) else: yield Document( page_content=transcript, metadata={"source": blob.source, "chunk": split_number}, ) ``` ### Error Message and Stack Trace (if applicable) ```bash 2024-08-09 04:54:51,225 [DEBUG] [AnyIO worker thread] HTTP Response: POST https://api.openai.com/v1/audio/transcriptions "200 OK" Headers([('date', 'Fri, 09 Aug 2024 04:54:51 GMT'), ('content-type', 'text/plain; charset=utf-8'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('openai-organization', 'user-imywxd1x3dz2koid5nl3pykg'), ('openai-processing-ms', '65120'), ('openai-version', '2020-10-01'), ('strict-transport-security', 'max-age=15552000; includeSubDomains; preload'), ('x-ratelimit-limit-requests', '50'), ('x-ratelimit-remaining-requests', '49'), ('x-ratelimit-reset-requests', '1.2s'), ('x-request-id', 'req_ee43e9b5d13b87213865e038c5cb2b27'), ('cf-cache-status', 'DYNAMIC'), ('set-cookie', '__cf_bm=fIoOXAGFHjq12ZFNqV2aJW9VpSZ7F.EEwLZCLjQE7xE-1723179291-1.0.1.1-QwPirU_LuFjrc4wkDkk9Trr5C9.th_1ZY3_DpiXDelVA7LMsWOyKBwyQ18l.4.H42VyroK.spHCXh.pW.1LZVA; path=/; expires=Fri, 09-Aug-24 05:24:51 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None'), ('x-content-type-options', 'nosniff'), ('set-cookie', '_cfuvid=LI.AshH8TiEGFHWzAy95eYdOziTNvrGLH9.bRjsl_d8-1723179291106-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None'), ('server', 'cloudflare'), ('cf-ray', '8b0524df2babc7a7-DUS'), ('content-encoding', 'br'), ('alt-svc', 'h3=":443"; ma=86400')]) 2024-08-09 04:54:51,226 [DEBUG] [AnyIO worker thread] request_id: req_ee43e9b5d13b87213865e038c5cb2b27 2024-08-09 04:54:51,227 [DEBUG] [AnyIO worker thread] Could not read JSON from response data due to <class 'json.decoder.JSONDecodeError'> - Extra data: line 2 column 1 (char 2) Transcribing part 1! INFO: 172.18.0.1:59254 - "POST /youtube/summarize HTTP/1.0" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool return await anyio.to_thread.run_sync(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 851, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/code/app/routers/youtube.py", line 30, in yt_summarize transcription = yt_transcribe(request.url, ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/code/app/transcribe/utils.py", line 69, in yt_transcribe docs = loader.load() ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/langchain_core/document_loaders/base.py", line 30, in load return list(self.lazy_load()) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/langchain_community/document_loaders/generic.py", line 116, in lazy_load yield from self.blob_parser.lazy_parse(blob) File "/usr/local/lib/python3.12/site-packages/langchain_community/document_loaders/parsers/audio.py", line 132, in lazy_parse page_content=transcript.text, ^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'text' ``` ### Description * I'm expecting to get YT video transcription in any supported formats like srt, txt, vtt using OpenAI whisper integration. ### System Info langchain_openai>=0.1.8 langchain_community>=0.2.5
AttributeError: 'str' object has no attribute 'text' in OpenAI document_loaders/audio
https://api.github.com/repos/langchain-ai/langchain/issues/25218/comments
0
2024-08-09T05:10:36Z
2024-08-09T12:35:12Z
https://github.com/langchain-ai/langchain/issues/25218
2,457,114,837
25,218
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code from langchain_chroma import Chroma from langchain_ollama import OllamaEmbeddings local_embeddings = OllamaEmbeddings(model="nomic-embed-text") vectorstore = Chroma.from_documents(documents=all_splits, embedding=local_embeddings) ### Error Message and Stack Trace (if applicable) _No response_ ### Description I'm stuck at the [code](https://python.langchain.com/v0.2/docs/tutorials/local_rag/#:~:text=RecursiveCharacterTextSplitter%20%7C%20WebBaseLoader-,Next,-%2C%20the%20below%20steps) of vector store creation in the official document. The output error information is: ```shell { "name": "ResponseError", "message": "404 page not found", "stack": "--------------------------------------------------------------------------- ResponseError Traceback (most recent call last) Cell In[2], line 6 2 from langchain_ollama import OllamaEmbeddings 4 local_embeddings = OllamaEmbeddings(model=\"nomic-embed-text\") ----> 6 vectorstore = Chroma.from_documents(documents=all_splits, embedding=local_embeddings) File ~/miniconda3/lib/python3.10/site-packages/langchain_chroma/vectorstores.py:921, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs) 919 texts = [doc.page_content for doc in documents] 920 metadatas = [doc.metadata for doc in documents] --> 921 return cls.from_texts( 922 texts=texts, 923 embedding=embedding, 924 metadatas=metadatas, 925 ids=ids, 926 collection_name=collection_name, 927 persist_directory=persist_directory, 928 client_settings=client_settings, 929 client=client, 930 collection_metadata=collection_metadata, 931 **kwargs, 932 ) File ~/miniconda3/lib/python3.10/site-packages/langchain_chroma/vectorstores.py:882, in Chroma.from_texts(cls, texts, embedding, metadatas, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs) 876 chroma_collection.add_texts( 877 texts=batch[3] if batch[3] else [], 878 metadatas=batch[2] if batch[2] else None, # type: ignore 879 ids=batch[0], 880 ) 881 else: --> 882 chroma_collection.add_texts(texts=texts, metadatas=metadatas, ids=ids) 883 return chroma_collection File ~/miniconda3/lib/python3.10/site-packages/langchain_chroma/vectorstores.py:389, in Chroma.add_texts(self, texts, metadatas, ids, **kwargs) 387 texts = list(texts) 388 if self._embedding_function is not None: --> 389 embeddings = self._embedding_function.embed_documents(texts) 390 if metadatas: 391 # fill metadatas with empty dicts if somebody 392 # did not specify metadata for all texts 393 length_diff = len(texts) - len(metadatas) File ~/miniconda3/lib/python3.10/site-packages/langchain_ollama/embeddings.py:31, in OllamaEmbeddings.embed_documents(self, texts) 29 def embed_documents(self, texts: List[str]) -> List[List[float]]: 30 \"\"\"Embed search docs.\"\"\" ---> 31 embedded_docs = ollama.embed(self.model, texts)[\"embedding\"] 32 return embedded_docs File ~/miniconda3/lib/python3.10/site-packages/ollama/_client.py:261, in Client.embed(self, model, input, truncate, options, keep_alive) 258 if not model: 259 raise RequestError('must provide a model') --> 261 return self._request( 262 'POST', 263 '/api/embed', 264 json={ 265 'model': model, 266 'input': input, 267 'truncate': truncate, 268 'options': options or {}, 269 'keep_alive': keep_alive, 270 }, 271 ).json() File ~/miniconda3/lib/python3.10/site-packages/ollama/_client.py:74, in Client._request(self, method, url, **kwargs) 72 response.raise_for_status() 73 except httpx.HTTPStatusError as e: ---> 74 raise ResponseError(e.response.text, e.response.status_code) from None 76 return response ResponseError: 404 page not found" } ``` It seems that ollama with version of 0.3.1 can't work well with ollama.embed: Code for reproducing: ```python import ollama ollama.embed( model="nomic-embed-text", input=["hello"] ) ``` and the output is: ```shell { "name": "ResponseError", "message": "404 page not found", "stack": "--------------------------------------------------------------------------- ResponseError Traceback (most recent call last) Cell In[3], line 2 1 import ollama ----> 2 ollama.embed( 3 model=\"nomic-embed-text\", 4 input=[\"hello\"] 5 ) File ~/miniconda3/lib/python3.10/site-packages/ollama/_client.py:261, in Client.embed(self, model, input, truncate, options, keep_alive) 258 if not model: 259 raise RequestError('must provide a model') --> 261 return self._request( 262 'POST', 263 '/api/embed', 264 json={ 265 'model': model, 266 'input': input, 267 'truncate': truncate, 268 'options': options or {}, 269 'keep_alive': keep_alive, 270 }, 271 ).json() File ~/miniconda3/lib/python3.10/site-packages/ollama/_client.py:74, in Client._request(self, method, url, **kwargs) 72 response.raise_for_status() 73 except httpx.HTTPStatusError as e: ---> 74 raise ResponseError(e.response.text, e.response.status_code) from None 76 return response ResponseError: 404 page not found" } ``` It seems similar with the error before. We can also experiment with the code: ```shell curl http://localhost:11434/api/embed -d '{ "model": "nomic-embed-text:latest", "prompt": "Here is an article about llamas..." }' ``` and then the output is `404 page not found`. ### System Info ```shell langchain-ollama 0.1.1 ollama 0.3.1 ``` Extra info:The version of ollama in linux system is 0.1.45.
Error with Chroma.from_documents and OllamaEmbeddings: ResponseError: 404 page not found
https://api.github.com/repos/langchain-ai/langchain/issues/25216/comments
1
2024-08-09T03:14:44Z
2024-08-09T07:42:15Z
https://github.com/langchain-ai/langchain/issues/25216
2,457,007,824
25,216
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code Hi - I am trying to pip install langchain but am getting the below error. This error starting coming from today morning. Please let me know how I can get this resolved? Cargo, the Rust package manager, is not installed or is not on PATH. This package requires Rust and Cargo to compile extensions. Install it through the system's package manager or via https://rustup.rs/ Checking for Rust toolchain.... error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /usr/bin/python3 /usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpcq29s8av cwd: /tmp/pip-install-2ldceiwf/orjson_4e150d9758f64d94abda37bb761d1916 Preparing metadata (pyproject.toml) ... error error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. ### Error Message and Stack Trace (if applicable) Cargo, the Rust package manager, is not installed or is not on PATH. This package requires Rust and Cargo to compile extensions. Install it through the system's package manager or via https://rustup.rs/ Checking for Rust toolchain.... error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /usr/bin/python3 /usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpcq29s8av cwd: /tmp/pip-install-2ldceiwf/orjson_4e150d9758f64d94abda37bb761d1916 Preparing metadata (pyproject.toml) ... error error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. ### Description I am getting errors when trying to pip install langchain modules. The error seems to be related to Rust being required but even after trying to install the packages related to Rust , the same error persists. ### System Info Windows, Python 3.10
Getting issues when pip installing langchain modules
https://api.github.com/repos/langchain-ai/langchain/issues/25215/comments
4
2024-08-09T02:59:54Z
2024-08-09T03:09:36Z
https://github.com/langchain-ai/langchain/issues/25215
2,456,995,772
25,215
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code ```python from dotenv import load_dotenv from langchain_openai import ChatOpenAI from langchain_core.tools import tool, StructuredTool from langchain.agents import AgentExecutor, create_tool_calling_agent from langchain_core.prompts import ChatPromptTemplate load_dotenv() def add_numbers(a: int, b: int) -> int: """Adds a and b. Args: a: first int b: second int """ return a + b def multiply_numbers(a: int, b: int) -> int: """Multiplies a and b. Args: a: first int b: second int """ return a * b add_numbers_tool = StructuredTool.from_function( func=add_numbers, name="Add numbers", description="Adds a and b." ) multiply_numbers_tool = StructuredTool.from_function( func=multiply_numbers, name="Multiply numbers", description="Multiplies a and b." ) llm = ChatOpenAI(model="gpt-4o", temperature=0) tools = [add_numbers_tool, multiply_numbers_tool] prompt = ChatPromptTemplate.from_messages( [ ( "system", "You are a helpful assistant. Make sure to respond to teh user with most accurate results and information.", ), ("placeholder", "{chat_history}"), ("human", "{input}"), ("placeholder", "{agent_scratchpad}"), ] ) # Construct the Tools agent agent = create_tool_calling_agent(llm, tools, prompt) query = "What is 3 * 12? Also, what is 11 + 49?" agent_executor = AgentExecutor( agent=agent, tools=tools, verbose=True, return_intermediate_steps=True ) result = agent_executor.invoke({"input": query}) print(result) ``` ### Error Message and Stack Trace (if applicable) (.venv) Cipher@Crippd assistcx-agent % python task.py Entering new AgentExecutor chain... Traceback (most recent call last): File "/Users/Cipher/AssistCX/assistcx-agent/task.py", line 63, in <module> result = agent_executor.invoke({"input": query}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/chains/base.py", line 166, in invoke raise e File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/chains/base.py", line 156, in invoke self._call(inputs, run_manager=run_manager) File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/agents/agent.py", line 1612, in _call next_step_output = self._take_next_step( ^^^^^^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/agents/agent.py", line 1318, in _take_next_step [ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/agents/agent.py", line 1318, in <listcomp> [ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/agents/agent.py", line 1346, in _iter_next_step output = self.agent.plan( ^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain/agents/agent.py", line 580, in plan for chunk in self.runnable.stream(inputs, config={"callbacks": callbacks}): File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3253, in stream yield from self.transform(iter([input]), config, **kwargs) File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3240, in transform yield from self._transform_stream_with_config( File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3202, in _transform for output in final_pipeline: File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 1271, in transform for ichunk in input: File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 5267, in transform yield from self.bound.transform( File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 1289, in transform yield from self.stream(final, config, **kwargs) File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 373, in stream raise e File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 353, in stream for chunk in self._stream(messages, stop=stop, **kwargs): File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/langchain_openai/chat_models/base.py", line 521, in _stream response = self.client.create(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/openai/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 646, in create return self._post( ^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/openai/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/openai/_base_client.py", line 942, in request return self._request( ^^^^^^^^^^^^^^ File "/Users/Cipher/AssistCX/assistcx-agent/.venv/lib/python3.11/site-packages/openai/_base_client.py", line 1046, in _request raise self._make_status_error_from_response(err.response) from None openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'tools[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.", 'type': 'invalid_request_error', 'param': 'tools[0].function.name', 'code': 'invalid_value'}} (.venv) Cipher@Crippd assistcx-agent % ### Description I have setup a simple tool calling agent following the guide here: https://python.langchain.com/v0.1/docs/modules/agents/agent_types/tool_calling/ I have defined tools using `StructuredTool` class as shown in my code. When I try to run this code I get the error that shared above. If I remove the space in tool names and replace it with dash (-) or underscore (_), the code works fine and agent execution happens successfully. I haven't seen anywhere that tool name shouldn't include space and several Langchain documentation uses space in tool names. Am I missing something or making any silly error? ### System Info langchain==0.2.11 langchain-community==0.2.10 langchain-core==0.2.25 langchain-groq==0.1.8 langchain-ollama==0.1.0 langchain-openai==0.1.19 langchain-text-splitters==0.2.2 langchain-together==0.1.4 platform: Mac python version: 3.11.7
Tool calling agent: Function name error in calling tool
https://api.github.com/repos/langchain-ai/langchain/issues/25211/comments
1
2024-08-09T01:17:32Z
2024-08-10T13:26:12Z
https://github.com/langchain-ai/langchain/issues/25211
2,456,917,100
25,211
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code from langchain_elasticsearch import ElasticsearchStore, DenseVectorStrategy, BM25Strategy elastic_vector_search = ElasticsearchStore( es_url=YOUR_URL, index_name=YOUR_INDEX, es_user=YOUR_LOGIN, es_params = {'verify_certs':False,'request_timeout':1000}, es_password=YOUR_PASSWORD, embedding=embeddings, strategy=DenseVectorStrategy() ) retriever = elastic_vector_search.as_retriever(search_type="similarity_score_threshold",search_kwargs={'score_threshold': 0.85, 'k':150,'fetch_k' : 10000}, include_original=True) retriever.get_relevant_documents('query') ### Error Message and Stack Trace (if applicable) --------------------------------------------------------------------------- BadRequestError Traceback (most recent call last) Cell In[6], line 1 ----> 1 retriever.get_relevant_documents('réseau') File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\_api\deprecation.py:168, in deprecated.<locals>.deprecate.<locals>.warning_emitting_wrapper(*args, **kwargs) 166 warned = True 167 emit_warning() --> 168 return wrapped(*args, **kwargs) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\retrievers.py:358, in BaseRetriever.get_relevant_documents(self, query, callbacks, tags, metadata, run_name, **kwargs) 356 if run_name: 357 config["run_name"] = run_name --> 358 return self.invoke(query, config, **kwargs) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\retrievers.py:219, in BaseRetriever.invoke(self, input, config, **kwargs) 217 except Exception as e: 218 run_manager.on_retriever_error(e) --> 219 raise e 220 else: 221 run_manager.on_retriever_end( 222 result, 223 ) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\retrievers.py:212, in BaseRetriever.invoke(self, input, config, **kwargs) 210 _kwargs = kwargs if self._expects_other_args else {} 211 if self._new_arg_supported: --> 212 result = self._get_relevant_documents( 213 input, run_manager=run_manager, **_kwargs 214 ) 215 else: 216 result = self._get_relevant_documents(input, **_kwargs) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\vectorstores\base.py:1249, in VectorStoreRetriever._get_relevant_documents(self, query, run_manager) 1246 docs = self.vectorstore.similarity_search(query, **self.search_kwargs) 1247 elif self.search_type == "similarity_score_threshold": 1248 docs_and_similarities = ( -> 1249 self.vectorstore.similarity_search_with_relevance_scores( 1250 query, **self.search_kwargs 1251 ) 1252 ) 1253 docs = [doc for doc, _ in docs_and_similarities] 1254 elif self.search_type == "mmr": File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\vectorstores\base.py:777, in VectorStore.similarity_search_with_relevance_scores(self, query, k, **kwargs) 761 """Return docs and relevance scores in the range [0, 1]. 762 763 0 is dissimilar, 1 is most similar. (...) 773 List of Tuples of (doc, similarity_score). 774 """ 775 score_threshold = kwargs.pop("score_threshold", None) --> 777 docs_and_similarities = self._similarity_search_with_relevance_scores( 778 query, k=k, **kwargs 779 ) 780 if any( 781 similarity < 0.0 or similarity > 1.0 782 for _, similarity in docs_and_similarities 783 ): 784 warnings.warn( 785 "Relevance scores must be between" 786 f" 0 and 1, got {docs_and_similarities}" 787 ) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\vectorstores\base.py:725, in VectorStore._similarity_search_with_relevance_scores(self, query, k, **kwargs) 707 """ 708 Default similarity search with relevance scores. Modify if necessary 709 in subclass. (...) 722 List of Tuples of (doc, similarity_score) 723 """ 724 relevance_score_fn = self._select_relevance_score_fn() --> 725 docs_and_scores = self.similarity_search_with_score(query, k, **kwargs) 726 return [(doc, relevance_score_fn(score)) for doc, score in docs_and_scores] File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_elasticsearch\vectorstores.py:883, in ElasticsearchStore.similarity_search_with_score(self, query, k, filter, custom_query, doc_builder, **kwargs) 877 if ( 878 isinstance(self._store.retrieval_strategy, DenseVectorStrategy) 879 and self._store.retrieval_strategy.hybrid 880 ): 881 raise ValueError("scores are currently not supported in hybrid mode") --> 883 hits = self._store.search( 884 query=query, k=k, filter=filter, custom_query=custom_query 885 ) 886 return _hits_to_docs_scores( 887 hits=hits, 888 content_field=self.query_field, 889 doc_builder=doc_builder, 890 ) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\elasticsearch\helpers\vectorstore\_sync\vectorstore.py:274, in VectorStore.search(self, query, query_vector, k, num_candidates, fields, filter, custom_query) 271 query_body = custom_query(query_body, query) 272 logger.debug(f"Calling custom_query, Query body now: {query_body}") --> 274 response = self.client.search( 275 index=self.index, 276 **query_body, 277 size=k, 278 source=True, 279 source_includes=fields, 280 ) 281 hits: List[Dict[str, Any]] = response["hits"]["hits"] 283 return hits File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\elasticsearch\_sync\client\utils.py:446, in _rewrite_parameters.<locals>.wrapper.<locals>.wrapped(*args, **kwargs) 443 except KeyError: 444 pass --> 446 return api(*args, **kwargs) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\elasticsearch\_sync\client\__init__.py:4119, in Elasticsearch.search(self, index, aggregations, aggs, allow_no_indices, allow_partial_search_results, analyze_wildcard, analyzer, batched_reduce_size, ccs_minimize_roundtrips, collapse, default_operator, df, docvalue_fields, error_trace, expand_wildcards, explain, ext, fields, filter_path, force_synthetic_source, from_, highlight, human, ignore_throttled, ignore_unavailable, indices_boost, knn, lenient, max_concurrent_shard_requests, min_compatible_shard_node, min_score, pit, post_filter, pre_filter_shard_size, preference, pretty, profile, q, query, rank, request_cache, rescore, rest_total_hits_as_int, retriever, routing, runtime_mappings, script_fields, scroll, search_after, search_type, seq_no_primary_term, size, slice, sort, source, source_excludes, source_includes, stats, stored_fields, suggest, suggest_field, suggest_mode, suggest_size, suggest_text, terminate_after, timeout, track_scores, track_total_hits, typed_keys, version, body) 4117 if __body is not None: 4118 __headers["content-type"] = "application/json" -> 4119 return self.perform_request( # type: ignore[return-value] 4120 "POST", 4121 __path, 4122 params=__query, 4123 headers=__headers, 4124 body=__body, 4125 endpoint_id="search", 4126 path_parts=__path_parts, 4127 ) File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\elasticsearch\_sync\client\_base.py:271, in BaseClient.perform_request(self, method, path, params, headers, body, endpoint_id, path_parts) 255 def perform_request( 256 self, 257 method: str, (...) 264 path_parts: Optional[Mapping[str, Any]] = None, 265 ) -> ApiResponse[Any]: 266 with self._otel.span( 267 method, 268 endpoint_id=endpoint_id, 269 path_parts=path_parts or {}, 270 ) as otel_span: --> 271 response = self._perform_request( 272 method, 273 path, 274 params=params, 275 headers=headers, 276 body=body, 277 otel_span=otel_span, 278 ) 279 otel_span.set_elastic_cloud_metadata(response.meta.headers) 280 return response File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\elasticsearch\_sync\client\_base.py:352, in BaseClient._perform_request(self, method, path, params, headers, body, otel_span) 349 except (ValueError, KeyError, TypeError): 350 pass --> 352 raise HTTP_EXCEPTIONS.get(meta.status, ApiError)( 353 message=message, meta=meta, body=resp_body 354 ) 356 # 'X-Elastic-Product: Elasticsearch' should be on every 2XX response. 357 if not self._verified_elasticsearch: 358 # If the header is set we mark the server as verified. BadRequestError: BadRequestError(400, 'illegal_argument_exception', '[num_candidates] cannot be less than [k]') ### Description I am trying to fetch 150 documents (k) and I specify the fetch_k (supposed to be num_candidates) and it does not work: '[num_candidates] cannot be less than [k]') Two options: - either it is a bug and the fetch_k is not working - either the num_candidates has to be specified in a different way, and I would like to know how because I have tried everything ### System Info langchain-0.2.12 python 3.9
num_candidates as fetch_k won't work on langchain
https://api.github.com/repos/langchain-ai/langchain/issues/25180/comments
0
2024-08-08T14:03:31Z
2024-08-08T14:06:09Z
https://github.com/langchain-ai/langchain/issues/25180
2,455,900,231
25,180
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code ``` import torch from transformers import AutoModelForCausalLM, AutoTokenizer, AwqConfig model_id = "hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4" llm = HuggingFaceLLM( context_window=8192, #4096 max_new_tokens=512, generate_kwargs={"temperature": 0, "do_sample": False}, system_prompt=system_prompt, query_wrapper_prompt=query_wrapper_prompt, tokenizer_name=model_id, model_name=model_id, device_map="auto", tokenizer_kwargs={"max_length": 8192} # 4096 ) ``` ``` from pandasai import PandasAI import pandas as pd langchain_llm = LangchainLLM(langchain_llm=llm) pandas_ai = PandasAI(llm=langchain_llm) df = pd.read_csv("data/deneme.csv") result = pandas_ai.run(df, "question??") ``` ### Error Message and Stack Trace (if applicable) ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[17], line 10 6 pandas_ai = PandasAI(llm=langchain_llm) 8 df = pd.read_csv("data/deneme.csv") ---> 10 result = pandas_ai.run(df, "question??") 12 result File /usr/local/lib/python3.10/dist-packages/pandasai/__init__.py:298, in PandasAI.run(self, data_frame, prompt, is_conversational_answer, show_code, anonymize_df, use_error_correction_framework) 278 """ 279 Run the PandasAI to make Dataframes Conversational. 280 (...) 293 294 """ 296 self._start_time = time.time() --> 298 self.log(f"Running PandasAI with {self._llm.type} LLM...") 300 self._prompt_id = str(uuid.uuid4()) 301 self.log(f"Prompt ID: {self._prompt_id}") Cell In[16], line 60, in LangchainLLM.type(self) 58 @property 59 def type(self) -> str: ---> 60 return f"langchain_{self.langchain_llm._llm_type}" AttributeError: 'HuggingFaceLLM' object has no attribute '_llm_type' ``` ### Description I noticed that `PandasAI` is generally used with OpenAI's LLM. Am I getting errors because I use it with HuggingFace? How can I resolve this issue? ### System Info .
AttributeError: 'HuggingFaceLLM' object has no attribute '_llm_type'
https://api.github.com/repos/langchain-ai/langchain/issues/25178/comments
0
2024-08-08T13:43:57Z
2024-08-08T13:46:41Z
https://github.com/langchain-ai/langchain/issues/25178
2,455,853,854
25,178
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code ```python from langchain.chains import OpenAIModerationChain from langchain_core.prompts import ChatPromptTemplate from langchain_openai import OpenAI api_key = "..." model = OpenAI(openai_api_key=api_key) prompt = ChatPromptTemplate.from_messages([("human", "the sky is")]) moderate = OpenAIModerationChain(openai_api_key=api_key) chain = prompt | model | moderate print(chain.invoke({})) ``` ### Error Message and Stack Trace (if applicable) ``` Traceback (most recent call last): File "/app/demo.py", line 8, in <module> moderate = OpenAIModerationChain(openai_api_key=api_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/langchain_core/load/serializable.py", line 113, in __init__ super().__init__(*args, **kwargs) File "/usr/local/lib/python3.12/site-packages/pydantic/v1/main.py", line 339, in __init__ values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pydantic/v1/main.py", line 1048, in validate_model input_data = validator(cls_, input_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/langchain/chains/moderation.py", line 69, in validate_environment values["client"] = openai.OpenAI() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/openai/_client.py", line 105, in __init__ raise OpenAIError( openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable ``` ### Description It appears that the fix for #13685 may be incomplete. openai >= v1.0.0 moved to prefer explicit instantiation of clients, but `OpenAIModerationChain.validate_environment` still assigns the API key to `openai.api_key` regardless of the version of openai that's installed. https://github.com/langchain-ai/langchain/blob/d77c7c4236df8e56fbe3acc8e0a71b57b48f1678/libs/langchain/langchain/chains/moderation.py#L58 Using `OpenAIModerationChain(openai_api_key="...")` instead of using the `OPENAI_API_KEY` env var results in `openai.OpenAI` throwing an exception because it expects the key to be passed to the `api_key` parameter if the env var isn't present. https://github.com/langchain-ai/langchain/blob/d77c7c4236df8e56fbe3acc8e0a71b57b48f1678/libs/langchain/langchain/chains/moderation.py#L69-L70 Looking at [where the key is checked](https://github.com/openai/openai-python/blob/90dd21531efe351b72ce0a72150048b6c7f640e0/src/openai/_client.py#L102-L112) in `openai.OpenAI`, it looks like the same is also true of the organization. ### System Info ``` System Information ------------------ > OS: Linux > OS Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024 > Python Version: 3.12.5 (main, Aug 7 2024, 19:13:36) [GCC 12.2.0] Package Information ------------------- > langchain_core: 0.2.29 > langchain: 0.2.12 > langsmith: 0.1.98 > langchain_openai: 0.1.20 > langchain_text_splitters: 0.2.2 Optional packages not installed ------------------------------- > langgraph > langserve Other Dependencies ------------------ > aiohttp: 3.10.1 > async-timeout: Installed. No version info available. > jsonpatch: 1.33 > numpy: 1.26.4 > openai: 1.40.1 > orjson: 3.10.6 > packaging: 24.1 > pydantic: 2.8.2 > PyYAML: 6.0.2 > requests: 2.32.3 > SQLAlchemy: 2.0.32 > tenacity: 8.5.0 > tiktoken: 0.7.0 > typing-extensions: 4.12.2 ```
OpenAIModerationChain doesn't handle API key correctly for openai>=v1.0.0
https://api.github.com/repos/langchain-ai/langchain/issues/25176/comments
0
2024-08-08T12:33:39Z
2024-08-08T13:11:30Z
https://github.com/langchain-ai/langchain/issues/25176
2,455,684,951
25,176
[ "hwchase17", "langchain" ]
### URL https://python.langchain.com/v0.2/docs/integrations/document_loaders/aws_s3_directory/ ### Checklist - [X] I added a very descriptive title to this issue. - [X] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: can't able to read folders inside bucket e.g. I have bucket name "demo" inside demo i have two folders folder1 and folder2 i want read load document from folder1 only then how can i do that currently it is directly throwing error Process finished with exit code -1073741819 (0xC0000005)
DOC: <Issue related to /v0.2/docs/integrations/document_loaders/aws_s3_directory/>
https://api.github.com/repos/langchain-ai/langchain/issues/25170/comments
0
2024-08-08T11:08:43Z
2024-08-08T13:29:17Z
https://github.com/langchain-ai/langchain/issues/25170
2,455,520,007
25,170
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code I have attached two notebooks one for redis cache semantic search and another for Azure Cosmos db for Mongo db v Core for caching. [semantic_caching.zip](https://github.com/user-attachments/files/16537170/semantic_caching.zip) ### Error Message and Stack Trace (if applicable) _No response_ ### Description I am trying to use the semantic caching feature of the langchain with Azure Cosmos db for Mongodb vCore for quicker response. I tried the same example that is given in the langchain [documentation](https://python.langchain.com/v0.2/docs/integrations/llm_caching/#azure-cosmos-db-semantic-cache). In my code if i ask it "Tell me a joke" it is returning response from the cache in very less time. But when the question is changed to "What to do when bored?" i am expecting the langchain to hit the LLM instead of returning the response from the cache. But it is returning the same cached response for "Tell me a joke". I have attached the code and its output. I have tried the same with the Redis Semantic caching and i see the same response. ### System Info System Information ------------------ > OS: Linux > OS Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024 > Python Version: 3.10.14 (main, May 6 2024, 19:42:50) [GCC 11.2.0] Package Information ------------------- > langchain_core: 0.2.28 > langchain: 0.2.12 > langchain_community: 0.2.11 > langsmith: 0.1.98 > langchain_openai: 0.1.20 > langchain_text_splitters: 0.2.2 Packages not installed (Not Necessarily a Problem) -------------------------------------------------- The following packages were not found: > langgraph > langserve
Azure Cosmos DB Semantic Cache and Redis Semantic Cache not working as expected when the prompt is different
https://api.github.com/repos/langchain-ai/langchain/issues/25161/comments
0
2024-08-08T03:27:41Z
2024-08-08T03:30:08Z
https://github.com/langchain-ai/langchain/issues/25161
2,454,793,900
25,161
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code llm = ChatGroq(base_url="http://10.xx.xx.127:8080",temperature=0, groq_api_key="gsk_...", model_name="llama3-8b-8192") input = "how to restart linux server" agent_executor.invoke({"input": input}) ### Error Message and Stack Trace (if applicable) errInfo:: how to restart linux server > Entering new AgentExecutor chain... Traceback (most recent call last): File "/Usr-xxx/pyProj/testLangchainCompileAssist.py", line 101, in <module> agent_executor.invoke({"input": input}) File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/chains/base.py", line 166, in invoke raise e File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/chains/base.py", line 156, in invoke self._call(inputs, run_manager=run_manager) File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/agents/agent.py", line 1636, in _call next_step_output = self._take_next_step( ^^^^^^^^^^^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/agents/agent.py", line 1342, in _take_next_step [ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/agents/agent.py", line 1342, in <listcomp> [ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/agents/agent.py", line 1370, in _iter_next_step output = self.agent.plan( ^^^^^^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain/agents/agent.py", line 580, in plan for chunk in self.runnable.stream(inputs, config={"callbacks": callbacks}): File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3253, in stream yield from self.transform(iter([input]), config, **kwargs) File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3240, in transform yield from self._transform_stream_with_config( File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 3202, in _transform for output in final_pipeline: File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 1271, in transform for ichunk in input: File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 5267, in transform yield from self.bound.transform( File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/runnables/base.py", line 1289, in transform yield from self.stream(final, config, **kwargs) File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 373, in stream raise e File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 353, in stream for chunk in self._stream(messages, stop=stop, **kwargs): File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/langchain_groq/chat_models.py", line 507, in _stream response = self.client.create( ^^^^^^^^^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/groq/resources/chat/completions.py", line 289, in create return self._post( ^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/groq/_base_client.py", line 1225, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/groq/_base_client.py", line 920, in request return self._request( ^^^^^^^^^^^^^^ File "/Usr-xxx/anaconda3/lib/python3.11/site-packages/groq/_base_client.py", line 1018, in _request raise self._make_status_error_from_response(err.response) from None groq.NotFoundError: Error code: 404 - {'message': 'Route POST:/openai/v1/chat/completions not found', 'error': 'Not Found', 'statusCode': 404} ### Description run jan and api server on 10.xxxx.127:8080, and can visit the apis on my mac get: http://10.xxxx.127:8080/v1/models rsp: {"object":"list","data":[{"sources":[{"filename":"aya-23-35B-Q4_K_M.gguf",..... get:http://localhost:8080/v1/models/llama3-8b-8192 rsp: {"sources":[{"url":"https://groq.com"}],"id":"llama3-8b-8192","object":"model","name":"Groq Llama 3 8b","version":"1.1","description":"Groq Llama 3 8b with supercharged speed!","format":"api","settings":{},"parameters":{"max_tokens":8192,"temperature":0.7,"top_p":0.95,"stream":true,"stop":[],"frequency_penalty":0,"presence_penalty":0},"metadata":{"author":"Meta","tags":["General","Big Context Length"]},"engine":"groq"} get: http://10.xxx.127:8080/openai/v1/chat/completions rsp: {"message":"Route GET:/openai/v1/chat/completions not found","error":"Not Found","statusCode":404} ### System Info pip freeze | grep langchain langchain==0.2.7 langchain-cli==0.0.25 langchain-community==0.2.7 langchain-core==0.2.25 langchain-experimental==0.0.62 langchain-google-community==1.0.6 langchain-groq==0.1.6 langchain-ollama==0.1.0 langchain-openai==0.1.15 langchain-text-splitters==0.2.2 langchainhub==0.1.20 Python 3.11.3 (main, Apr 19 2023, 18:49:55) [Clang 14.0.6 ] on darwin
groq.NotFoundError: Error code: 404 , Route POST:/openai/v1/chat/completions not found
https://api.github.com/repos/langchain-ai/langchain/issues/25160/comments
0
2024-08-08T01:45:25Z
2024-08-08T01:48:02Z
https://github.com/langchain-ai/langchain/issues/25160
2,454,689,480
25,160
[ "hwchase17", "langchain" ]
### Privileged issue - [X] I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here. ### Issue Content We want to start enforcing that all public interfaces have proper Google-style docstrings. This is both to improve our code readability and the quality of our API reference. We can do this by turning on the lint rules shown here: https://github.com/langchain-ai/langchain/pull/23187 For each package in the repo we should turn this on and fix all the resulting lint errors.
Add docstring linting
https://api.github.com/repos/langchain-ai/langchain/issues/25154/comments
0
2024-08-07T21:14:54Z
2024-08-07T21:17:22Z
https://github.com/langchain-ai/langchain/issues/25154
2,454,362,912
25,154
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code The `update()` function in the Redis cache implementation does not overwrite an existing key with the same prompt: https://github.com/langchain-ai/langchain/blob/a4086119f8e97adaeae337ceaaffbd413dd1795e/libs/community/langchain_community/cache.py#L727 It invokes [add_texts()](https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/vectorstores/redis/base.py#L733-L739) which creates a new key when `keys` or `ids` are not passed as kwards to `add_texts()`: https://github.com/langchain-ai/langchain/blob/a4086119f8e97adaeae337ceaaffbd413dd1795e/libs/community/langchain_community/vectorstores/redis/base.py#L717 As a result, for the same prompt being cached, there are multiple hset keys being added, each with a different UUID: https://github.com/langchain-ai/langchain/blob/a4086119f8e97adaeae337ceaaffbd413dd1795e/libs/community/langchain_community/vectorstores/redis/base.py#L733 This is problematic because when the cache is updated for the same prompt with a different value, it can use a stale copy of the text to serve as a cached response. Ideally, I would expect the same prompt to overwrite the key in the hset versus creating a new key. ### Error Message and Stack Trace (if applicable) _No response_ ### Description See above. ### System Info ``` langchain==0.2.6 langchain-community==0.2.6 langchain-core==0.2.11 langchain-openai==0.1.14 langchain-postgres==0.0.9 langchain-text-splitters==0.2.2 langchainhub==0.1.20 ```
Redis cache update() does not overwrite existing key/prompt
https://api.github.com/repos/langchain-ai/langchain/issues/25147/comments
0
2024-08-07T17:41:57Z
2024-08-07T18:39:14Z
https://github.com/langchain-ai/langchain/issues/25147
2,454,004,324
25,147
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code ```python from langgraph.prebuilt import create_react_agent agent_executor = create_react_agent(model, tools) ``` ### Error Message and Stack Trace (if applicable) ```python --------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[10], line 1 ----> 1 from langgraph.prebuilt import create_react_agent 3 agent_executor = create_react_agent(model, tools) File ~/Documents/courses/Langchain0_2/.venv/lib/python3.12/site-packages/langgraph/prebuilt/__init__.py:2 1 """langgraph.prebuilt exposes a higher-level API for creating and executing agents and tools.""" ----> 2 from langgraph.prebuilt.chat_agent_executor import create_react_agent 3 from langgraph.prebuilt.tool_executor import ToolExecutor, ToolInvocation 4 from langgraph.prebuilt.tool_node import InjectedState, ToolNode, tools_condition File ~/Documents/courses/Langchain0_2/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:28 26 from langgraph.managed import IsLastStep 27 from langgraph.prebuilt.tool_executor import ToolExecutor ---> 28 from langgraph.prebuilt.tool_node import ToolNode 31 # We create the AgentState that we will pass around 32 # This simply involves a list of messages 33 # We want steps to return messages to append to the list 34 # So we annotate the messages attribute with operator.add 35 class AgentState(TypedDict): File ~/Documents/courses/Langchain0_2/.venv/lib/python3.12/site-packages/langgraph/prebuilt/tool_node.py:20 18 from langchain_core.runnables import RunnableConfig 19 from langchain_core.runnables.config import get_config_list, get_executor_for_config ---> 20 from langchain_core.tools import BaseTool, InjectedToolArg 21 from langchain_core.tools import tool as create_tool 22 from typing_extensions import get_args ImportError: cannot import name 'InjectedToolArg' from 'langchain_core.tools' ``` ### Description When executing the following import from langgraph it fails as it can't find the 'InjectedToolArg' from 'langchain_core.tools'. Based on searches in the Docs, I have tried to * reinstall langchain, l * langchain_core, and * langgraph, but the same error keeps appearing. Note: when installing langgraph, langchain_core is upgraded to 0.2.18, however, that gives an error already during installation. To resolve that, I downgrade to 0.2.13. ### System Info langchain_core.sys_info: > langsmith: 0.1.85 > langchain_chroma: 0.1.2 > langchain_groq: 0.1.6 > langchain_objectbox: 0.1.0 > langchain_openai: 0.1.15 > langchain_text_splitters: 0.2.2 > langchainhub: 0.1.20 > langgraph: 0.2.1 > langserve: 0.2.2 pip freeze | grep langchain: langchain==0.2.7 langchain-chroma==0.1.2 langchain-community==0.2.7 langchain-core==0.2.13 langchain-groq==0.1.6 langchain-objectbox==0.1.0 langchain-openai==0.1.15 langchain-text-splitters==0.2.2 langchainhub==0.1.20 System: macOS Sonoma 14.5 Python: 3.12.4
Not possible to import 'InjectedToolArg' from langchain_core.tools
https://api.github.com/repos/langchain-ai/langchain/issues/25144/comments
4
2024-08-07T16:45:43Z
2024-08-07T20:40:17Z
https://github.com/langchain-ai/langchain/issues/25144
2,453,910,363
25,144
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code The goal of my code is to create a RAG with Elasticserch and make request to it. Here is the way to reproduce the error . Here is the creation of my RAG : ```python embeddings = OllamaEmbeddings( model="mxbai-embed-large ) vectorstore = ElasticsearchStore( embedding=embeddings, index_name=collection, # Replace with your actual index name es_url=ES_ENDPOINT, vector_query_field ="vector", query_field="content", strategy=DenseVectorStrategy(hybrid=False) #es_user="your_user", # Replace with your actual user #es_password="your_password" # Replace with your actual password ) llm = getLLM() metadata_field_info, document_content_description, examples = METADATAS[collection] # Create SelfQueryRetriever self_query_retriever = SelfQueryRetriever.from_llm( llm=llm,#_MultiQueryRetriever, vectorstore=vectorstore, document_contents=document_content_description, metadata_field_info=metadata_field_info, enable_limit=True, chain_kwargs={ "examples": examples }, search_kwargs={ 'k': 5, # Limite le nombre de documents récupérés 'num_candidates': 5, }, verbose=True ) return self_query_retriever ``` With METADATAS : ```python DOCUMENTS_METADATA = ( [ AttributeInfo( name="name", description="The name of the candidate, resource, or the enterprise related to an opportunity.", type="string", ), AttributeInfo( name="document_source", description="The origin of the document, such as a resume, skill set, criteria, job description, or any specific role-related document for opportunities or candidates.", type="string", ), ], """ This dataset comprises a diverse array of documents indexed in Elasticsearch. Resource and candidate are the same not as opportunity. The documents can vary widely, encompassing resumes, skill sets, text files, and detailed descriptions related to both candidates and opportunities. You will need to search in each documents. For instance, documents may include resumes of candidates, skill requirements, criteria for job roles, or detailed job descriptions for various opportunities. """, [ ( "Can you provide detailed information about Henry James, including his skills and experience?", { "query": "information, skills, experience, Henry James", "filter": { "bool": { "should": [ {"match": {"name": "Henry James"}} ], "minimum_should_match": 1 } } } ), ] ``` Here is my Elastic index for uses : ![image](https://github.com/user-attachments/assets/a5c248ff-20c4-452d-860f-0dacd8b8ba51) I am using an Ollama LLM : ```python def getLLM(system = ""): model_name = "llama3.1"#"qwen2" llm = Ollama( model=model_name, temperature=0.01, #keep_alive=-1, num_ctx=50000, system=system, ) return llm ``` Now you can ask what you want to produce the error. If what you are asking is to complex it will make this error message : ```python print("Création du chain LLM...") llm = getLLM() print("Mise en place du système d'historique de chat") history_aware_retriever = create_history_aware_retriever( llm, retriever, contextualize_q_prompt, ) qa_prompt = ChatPromptTemplate.from_messages( [ ("system", QA_SYTEM_PROMPT), MessagesPlaceholder("chat_history"), ("user", context), ("human", "{input}"), ] ) print("Création du chain RAG") question_answer_chain = create_stuff_documents_chain(llm, qa_prompt) rag_chain = create_retrieval_chain(history_aware_retriever, question_answer_chain) conversational_rag_chain = RunnableWithMessageHistory( rag_chain, get_session_history, input_messages_key="input", history_messages_key="chat_history", output_messages_key="answer", ) print("Chain LLM créé.") conversational_rag_chain.invoke("What can you tell me about Yeo?") ``` ### Error Message and Stack Trace (if applicable) WARNING:langchain_core.callbacks.manager:Error in RootListenersTracer.on_chain_end callback: KeyError('answer') WARNING:langchain_core.callbacks.manager:Error in callback coroutine: KeyError('answer') {'input': 'Que peux-tu me dire sur Yeo ?', 'chat_history': []} {'query': 'Yeo', 'filter': {'bool': {'should': [{'match': {'matadata.name': 'Yeo'}}], 'minimum_should_match': 1}}, 'limit': None} Traceback (most recent call last): Traceback (most recent call last): File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain/chains/query_constructor/base.py", line 54, in parse if parsed["query"] is None or len(parsed["query"]) == 0: ~~~~~~^^^^^^^^^ TypeError: string indices must be integers, not 'str' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/skikk/maia/api/LLM/Chat.py", line 23, in answer_stream for chunk in llm.stream( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5231, in stream yield from self.bound.stream( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5231, in stream yield from self.bound.stream( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3253, in stream yield from self.transform(iter([input]), config, **kwargs) File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3240, in transform yield from self._transform_stream_with_config( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3202, in _transform for output in final_pipeline: File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1289, in transform yield from self.stream(final, config, **kwargs) File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/branch.py", line 364, in stream for chunk in self.default.stream( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5231, in stream yield from self.bound.stream( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3253, in stream yield from self.transform(iter([input]), config, **kwargs) File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3240, in transform yield from self._transform_stream_with_config( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3202, in _transform for output in final_pipeline: File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/passthrough.py", line 577, in transform yield from self._transform_stream_with_config( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/passthrough.py", line 556, in _transform for chunk in for_passthrough: File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/utils/iter.py", line 66, in tee_peer item = next(iterator) ^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/passthrough.py", line 577, in transform yield from self._transform_stream_with_config( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/passthrough.py", line 567, in _transform yield cast(Dict[str, Any], first_map_chunk_future.result()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3666, in transform yield from self._transform_stream_with_config( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3651, in _transform chunk = AddableDict({step_name: future.result()}) ^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5267, in transform yield from self.bound.transform( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1289, in transform yield from self.stream(final, config, **kwargs) File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/branch.py", line 344, in stream for chunk in runnable.stream( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3253, in stream yield from self.transform(iter([input]), config, **kwargs) File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3240, in transform yield from self._transform_stream_with_config( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config chunk: Output = context.run(next, iterator) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3202, in _transform for output in final_pipeline: File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1289, in transform yield from self.stream(final, config, **kwargs) File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 854, in stream yield self.invoke(input, config, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/retrievers.py", line 221, in invoke raise e File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/retrievers.py", line 214, in invoke result = self._get_relevant_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain/retrievers/self_query/base.py", line 263, in _get_relevant_documents structured_query = self.query_constructor.invoke( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5060, in invoke return self.bound.invoke( ^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2875, in invoke input = step.invoke(input, config) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 192, in invoke return self._call_with_config( ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1784, in _call_with_config context.run( File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/runnables/config.py", line 404, in call_func_with_variable_args return func(input, **kwargs) # type: ignore[call-arg] ^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 193, in <lambda> lambda inner_input: self.parse_result([Generation(text=inner_input)]), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 237, in parse_result return self.parse(result[0].text) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/skikk/maia/.venv/lib/python3.12/site-packages/langchain/chains/query_constructor/base.py", line 66, in parse raise OutputParserException( langchain_core.exceptions.OutputParserException: Parsing text ```json { "query": "Yeo", "filter": { "bool": { "should": [ { "match": { "matadata.name": "Yeo" } } ], "minimum_should_match": 1 } }, "limit": null } ``` raised following error: string indices must be integers, not 'str' ### Description It is impossible to make complex request without modify the code. To create a RAG that call on your metadata with elasticsearch in langchain you need to use the method "SelfQueryRetriever". When you using it by the default way with simple request it is working : ```log INFO: Generated text to structured : Here is the structured request for the user query "What about skills of Yeo ?": json { "query": "skills, Yeo", "filter": "and(eq(\"name\", \"Yeo\"))" } This matches the schema provided earlier. The `query` field contains the text string "skills, Yeo", and the `filter` field contains a logical condition statement using the `eq` comparator to match the attribute `name` with the value `"Yeo"`. INFO: Query intern RAG to Elastic: skills, Yeo INFO: Filter intern RAG to Elastic: and(eq("name", "Yeo")) INFO:langchain.retrievers.self_query.base:Generated Query: query='skills, Yeo' filter=Comparison(comparator=<Comparator.EQ: 'eq'>, attribute='name', value='Yeo') limit=None ``` Here you can watch that the part "filter=Comparison(comparator=<Comparator.EQ: 'eq'>" is not empty because it is using the function "ast_parse" in the "langchain/chains/query_constructor/base.py" [file](https://github.com/langchain-ai/langchain/tree/master/libs/langchain/langchain/chains/query_constructor) : ```python parsed["filter"] = self.ast_parse(parsed["filter"]) ``` In the function "parse" : ```python def parse(self, text: str) -> StructuredQuery: try: expected_keys = ["query", "filter"] allowed_keys = ["query", "filter", "limit"] parsed = parse_and_check_json_markdown(text, expected_keys) if parsed["query"] is None or len(parsed["query"]) == 0: parsed["query"] = " " if parsed["filter"] == "NO_FILTER" or not parsed["filter"]: parsed["filter"] = None else: parsed["filter"] = self.ast_parse(parsed["filter"]) if not parsed.get("limit"): parsed.pop("limit", None) return StructuredQuery( **{k: v for k, v in parsed.items() if k in allowed_keys} ) except Exception as e: raise OutputParserException( f"Parsing text\n{text}\n raised following error:\n{e}" ) ``` It is created the error cause my parsed["filter"] is not anymore a str. So to resolve the problem I created an other parse function for the dict : ```python def parse_dict_to_filter_directive(self, filter_dict) -> Optional[FilterDirective]: if "bool" in filter_dict: bool_filter = filter_dict["bool"] if "should" in bool_filter: return Operation( operator=Operator.OR, arguments=[self.parse_dict_to_filter_directive(cond) for cond in bool_filter["should"]] ) # Add handling for other bool conditions like 'must' (AND), 'must_not' (NOT) here elif "match" in filter_dict: return Comparison( comparator=Comparator.EQ, # Simplification, actual implementation might need mapping attribute=list(filter_dict["match"].keys())[0], value=list(filter_dict["match"].values())[0] ) elif "terms" in filter_dict: # Handling 'terms' as multiple EQ conditions wrapped in an OR operation attribute, values = next(iter(filter_dict["terms"].items())) return Operation( operator=Operator.OR, arguments=[ Comparison(comparator=Comparator.EQ, attribute=attribute, value=value) for value in values ] ) # Extend this function to handle other cases as needed return None ``` Then I modify the parse function : ```python def parse(self, text: str) -> StructuredQuery: try: print("INFO: Generated text to structured :", text) expected_keys = ["query", "filter"] allowed_keys = ["query", "filter", "limit"] parsed = parse_and_check_json_markdown(text, expected_keys) print("INFO: Query intern RAG to Elastic: ",parsed["query"]) print("INFO: Filter intern RAG to Elastic: ", parsed["filter"]) if parsed["query"] is None or len(parsed["query"]) == 0: parsed["query"] = " " if parsed["filter"] == "NO_FILTER" or not parsed["filter"]: parsed["filter"] = None elif isinstance(parsed["filter"], dict): parsed["filter"] = self.parse_dict_to_filter_directive(parsed["filter"]) else: parsed["filter"] = self.ast_parse(parsed["filter"]) if not parsed.get("limit"): parsed.pop("limit", None) return StructuredQuery( **{k: v for k, v in parsed.items() if k in allowed_keys} ) except Exception as e: raise OutputParserException( f"Parsing text\n{text}\n raised following error:\n{e}" ) ``` I let the print to have backlog of the request. I would like to know if there is another way than changing the langchain code. Should it be possible to create a parse function in a parent "SelfQueryRetriever" ? ### System Info System Information ------------------ > OS: Linux > OS Version: #39-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 21:49:14 UTC 2024 > Python Version: 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] Package Information ------------------- > langchain_core: 0.2.24 > langchain: 0.2.11 > langchain_community: 0.2.6 > langsmith: 0.1.83 > langchain_elasticsearch: 0.2.2 > langchain_openai: 0.1.19 > langchain_text_splitters: 0.2.2 > langchainhub: 0.1.20 Packages not installed (Not Necessarily a Problem) -------------------------------------------------- The following packages were not found: > langgraph > langserve
Complex request to Elasticsearch provide "langchain_core.exceptions.OutputParserException: Parsing text" when using "from langchain.retrievers.self_query.base import SelfQueryRetriever"
https://api.github.com/repos/langchain-ai/langchain/issues/25141/comments
0
2024-08-07T14:27:48Z
2024-08-07T14:30:33Z
https://github.com/langchain-ai/langchain/issues/25141
2,453,637,838
25,141
[ "hwchase17", "langchain" ]
### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangChain rather than my code. - [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). ### Example Code ```python import os from langchain_google_vertexai import ChatVertexAI from langchain_community.tools.tavily_search import TavilySearchResults from langgraph.prebuilt import create_react_agent from langgraph.checkpoint.sqlite import SqliteSaver # The following environment variables have to be set # os.environ["GOOGLE_API_KEY"] = loaded from .zshrc # os.environ["LANGCHAIN_API_KEY"] = loaded from .zshrc # os.environ["TAVILY_API_KEY"] = loaded from .zshrc model = ChatVertexAI(model="gemini-1.5-flash") search = TavilySearchResults(max_results=2) tools = [search] memory = SqliteSaver.from_conn_string(":memory:") agent_executor = create_react_agent(model, tools, checkpointer=memory) ``` ### Error Message and Stack Trace (if applicable) --------------------------------------------------------------------------- ValidationError Traceback (most recent call last) Cell In[3], [line 18](vscode-notebook-cell:?execution_count=3&line=18) [14](vscode-notebook-cell:?execution_count=3&line=14) tools = [search] [16](vscode-notebook-cell:?execution_count=3&line=16) memory = SqliteSaver.from_conn_string(":memory:") ---> [18](vscode-notebook-cell:?execution_count=3&line=18) agent_executor = create_react_agent(model, tools, checkpointer=memory) File ~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:80, in deprecated_parameter.<locals>.decorator.<locals>.wrapper(*args, **kwargs) [72](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:72) if arg_name in kwargs: [73](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:73) warnings.warn( [74](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:74) f"Parameter '{arg_name}' in function '{func.__name__}' is " [75](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:75) f"deprecated as of version {since} and will be removed in version {removal}. " (...) [78](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:78) stacklevel=2, [79](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:79) ) ---> [80](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/_api/deprecation.py:80) return func(*args, **kwargs) File ~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:511, in create_react_agent(model, tools, state_schema, messages_modifier, state_modifier, checkpointer, interrupt_before, interrupt_after, debug) [506](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:506) workflow.add_edge("tools", "agent") [508](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:508) # Finally, we compile it! [509](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:509) # This compiles it into a LangChain Runnable, [510](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:510) # meaning you can use it as you would any other runnable --> [511](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:511) return workflow.compile( [512](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:512) checkpointer=checkpointer, [513](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:513) interrupt_before=interrupt_before, [514](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:514) interrupt_after=interrupt_after, [515](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:515) debug=debug, [516](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/prebuilt/chat_agent_executor.py:516) ) File ~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:431, in StateGraph.compile(self, checkpointer, interrupt_before, interrupt_after, debug) [411](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:411) output_channels = ( [412](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:412) "__root__" [413](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:413) if len(self.schemas[self.output]) == 1 (...) [419](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:419) ] [420](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:420) ) [421](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:421) stream_channels = ( [422](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:422) "__root__" [423](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:423) if len(self.channels) == 1 and "__root__" in self.channels (...) [428](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:428) ] [429](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:429) ) --> [431](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:431) compiled = CompiledStateGraph( [432](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:432) builder=self, [433](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:433) config_type=self.config_schema, [434](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:434) nodes={}, [435](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:435) channels={**self.channels, START: EphemeralValue(self.input)}, [436](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:436) input_channels=START, [437](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:437) stream_mode="updates", [438](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:438) output_channels=output_channels, [439](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:439) stream_channels=stream_channels, [440](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:440) checkpointer=checkpointer, [441](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:441) interrupt_before_nodes=interrupt_before, [442](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:442) interrupt_after_nodes=interrupt_after, [443](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:443) auto_validate=False, [444](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:444) debug=debug, [445](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:445) ) [447](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:447) compiled.attach_node(START, None) [448](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/langgraph/graph/state.py:448) for key, node in self.nodes.items(): File ~/Development/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:341, in BaseModel.__init__(__pydantic_self__, **data) [339](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:339) values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data) [340](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:340) if validation_error: --> [341](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:341) raise validation_error [342](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:342) try: [343](https://file+.vscode-resource.vscode-cdn.net/Users/florentremis/Development/~/Development/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:343) object_setattr(__pydantic_self__, '__dict__', values) ValidationError: 1 validation error for CompiledStateGraph checkpointer instance of BaseCheckpointSaver expected (type=type_error.arbitrary_type; expected_arbitrary_type=BaseCheckpointSaver) ### Description I'm trying to follow the Agent tutorial [here](https://python.langchain.com/v0.2/docs/tutorials/agents/). When I reach the "Adding in Memory" section, I get an error message when creating the agent. It's validation error complaining that BaseCheckpointSaver was expected. The surprising thing is that SqliteSaver does inherit from BaseCheckpointSaver so I don't understand what the problem is. I've tried replacing SqliteSaver with the async version but I get the same error. ### System Info langchain==0.2.12 langchain-chroma==0.1.2 langchain-community==0.2.11 langchain-core==0.2.28 langchain-google-vertexai==1.0.8 langchain-text-splitters==0.2.2 Platform: MacOS Python 3.12.3
Validation Error in Agent Tutorial when calling create_react_agent with SqliteSaver checkpointer
https://api.github.com/repos/langchain-ai/langchain/issues/25137/comments
3
2024-08-07T12:21:02Z
2024-08-09T11:40:35Z
https://github.com/langchain-ai/langchain/issues/25137
2,453,348,729
25,137