threads: t/src/embed.t and t/src/extend.t: test failures on Darwin/Intel. #856

Closed
jkeenan opened this Issue Oct 3, 2012 · 11 comments

Comments

Projects
None yet
3 participants
Contributor

jkeenan commented Oct 3, 2012

This ticket documents test failures in the 'threads' branch when run on Darwin/Intel (in this case, x86_64). They have previously been reported on the parrot-dev mailing list. (See, e.g., http://lists.parrot.org/pipermail/parrot-dev/2012-September/007184.html.)

Per request from dukeleto, I am creating a git issue ticket for this problem.

[parrot] 508 $ export DYLD_LIBRARY_PATH=/Users/jkeenan/gitwork/parrot/blib/lib/
[parrot] 509 $ echo $DYLD_LIBRARY_PATH
/Users/jkeenan/gitwork/parrot/blib/lib/
[parrot] 510 $ prove -v t/src/embed.t t/src/extend.t 
t/src/embed.t ... 
1..13
ok 1 - Minimal embed, create multiple interps
not ok 2 - Minimal embed, create multiple interps without giving 1st interp to Parrot_interp_new 

#   Failed test 'Minimal embed, create multiple interps without giving 1st interp to Parrot_interp_new '
#   at t/src/embed.t line 113.
# Done
# Really done
# 
not ok 3 - Parrot_compile_string populates the error string when an opcode is given improper arguments # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'Parrot_compile_string populates the error string when an opcode is given improper arguments'
#   at t/src/embed.t line 151.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_3
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_3
#   Expected in: flat namespace
# 
# 
not ok 4 - Parrot_compile_string populates the error string when given invalid language string # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'Parrot_compile_string populates the error string when given invalid language string'
#   at t/src/embed.t line 174.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_4
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_4
#   Expected in: flat namespace
# 
# 
not ok 5 - Parrot_compile_string populates the error string when there is an IMCC syntax error # TODO TT #1610 : does not properly catch IMCC errors

#   Failed (TODO) test 'Parrot_compile_string populates the error string when there is an IMCC syntax error'
#   at t/src/embed.t line 198.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_5
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_5
#   Expected in: flat namespace
# 
# 
not ok 6 - Hello world from main # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'Hello world from main'
#   at t/src/embed.t line 224.
# Hello, parrot
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_6
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_6
#   Expected in: flat namespace
# 
# 
not ok 7 - Hello world from a sub # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'Hello world from a sub'
#   at t/src/embed.t line 259.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_7
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_7
#   Expected in: flat namespace
# 
# 
not ok 8 - calling a sub with string argument and return a string # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'calling a sub with string argument and return a string'
#   at t/src/embed.t line 311.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_8
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_8
#   Expected in: flat namespace
# 
# 
not ok 9 - returning a Float PMC # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'returning a Float PMC'
#   at t/src/embed.t line 370.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_9
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_9
#   Expected in: flat namespace
# 
# 
not ok 10 - returning two Float PMCs in a ResizablePMCArray # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'returning two Float PMCs in a ResizablePMCArray'
#   at t/src/embed.t line 425.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_10
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_10
#   Expected in: flat namespace
# 
# 
not ok 11 - calling a sub with string argument and return a numeric # TODO Must explicitly set a PIR compreg
#   Failed (TODO) test 'calling a sub with string argument and return a numeric'
#   at t/src/embed.t line 485.
# dyld: lazy symbol binding failed: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_11
#   Expected in: flat namespace
# 
# dyld: Symbol not found: _Parrot_new_string
#   Referenced from: /Users/jkeenan/gitwork/parrot/./t/src/embed_11
#   Expected in: flat namespace
# 
# 
# 'cc -fno-common  -pipe -fstack-protector -I/usr/local/include -pipe -fno-common  -DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT  -g  -I./include -c -o t/src/embed_12.o t/src/embed_12.c' failed with exit code 1
# Failed to build 't/src/embed_12.o': t/src/embed.t: In function ‘createstring’:
# t/src/embed.t:62: warning: return makes pointer from integer without a cast
# t/src/embed.t: In function ‘main’:
# t/src/embed.t:579: warning: assignment makes pointer from integer without a cast
# t/src/embed.t:582: warning: assignment makes pointer from integer without a cast
# t/src/embed.t:586: error: ‘hellosub’ undeclared (first use in this function)
# t/src/embed.t:586: error: (Each undeclared identifier is reported only once
# t/src/embed.t:586: error: for each function it appears in.)
not ok 12 - Insert external sub in namespace # TODO Must explicitly set a PIR compreg

#   Failed (TODO) test 'Insert external sub in namespace'
#   at t/src/embed.t line 543.
ok 13 # skip TT #306; many symbols not exported, embedding parrot fails
# Looks like you failed 1 test of 13.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/13 subtests 
    (less 1 skipped subtest: 11 okay)
t/src/extend.t .. 
1..19
ok 1 - Parrot_PMC_null
ok 2 - Parrot_get_root_namespace/Parrot_(un)register_pmc
ok 3 - Parrot_fprintf
ok 4 - Parrot_printf/Parrot_eprintf with no interp
ok 5 - Parrot_new_string
ok 6 - Parrot_new_string/Parrot_(un)register_string
ok 7 - PMC_set/get_integer
ok 8 - PMC_set/get_integer_keyed_int
ok 9 - PMC_set/get_number
ok 10 - PMC_set/get_string
ok 11 - call a parrot sub
ok 12 - call a parrot sub using the unified interface
ok 13 - call a parrot sub and return an integer
ok 14 - call a parrot sub, catch exception
ok 15 # skip Outdated test with the old embed API [GH #829]
ok 16 # skip Outdated test with the old embed API [GH #829]
ok 17 - call multi sub from C - \#41511
ok 18 - call multi sub from C - unified interface
not ok 19 - multiple Parrot_interp_new/Parrot_x_exit cycles

#   Failed test 'multiple Parrot_interp_new/Parrot_x_exit cycles'
#   at t/src/extend.t line 743.
# Starting interp 1
# Destroying interp 1
# Starting interp 2
# Destroying interp 2
# 
# Looks like you failed 1 test of 19.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/19 subtests 
    (less 2 skipped subtests: 16 okay)

Test Summary Report
-------------------
t/src/embed.t (Wstat: 256 Tests: 13 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
t/src/extend.t (Wstat: 256 Tests: 19 Failed: 1)
  Failed test:  19
  Non-zero exit status: 1
Files=2, Tests=32,  7 wallclock secs ( 0.05 usr  0.01 sys +  2.79 cusr  1.15 csys =  4.00 CPU)
Result: FAIL

The same tests pass on the same platform in 'master'. They also pass (for me, at least) on the 'threads' branch on the older Darwin/PPC.

Thank you very much.
Jim Keenan

Owner

leto commented Oct 12, 2012

I am still seeing this problem, as of c73ae65 . Here is what I see:

It is complaining that it doesn't know about Parrot_new_string and Parrot_compile_string, which are part of the embed/extend API. It almost seems like the embed/extend API are not being linked against properly in the threads branch, but only on darwin. This could have something to do with LD_LIBRARY_PATH vs. DYLD_LIBRARY_PATH

Owner

leto commented Oct 12, 2012

I still see the same behavior, with and without DYLD_LIBRARY_PATH set

Owner

leto commented Oct 12, 2012

Just for reference, I have tried including both the ./lib and ./blib directories of the installed Parrot in DYLD_LIBRARY_PATH to no avail.

Also, which version of darwin are you using, @jkennan ? The output of uname -a is what I seek. Do you have Xcode installed, or is it a machine sans-Xcode?

leto was assigned Oct 12, 2012

Contributor

jkeenan commented Oct 12, 2012

On 10/12/12, letonotifications@github.com wrote:

Just for reference, I have tried including both the ./lib and ./blib directories of the installed Parrot
in DYLD_LIBRARY_PATH to no avail.

Also, which version of darwin are you using, @jkennan ? The output of uname -a is what I seek.
Do you have Xcode installed, or is it a machine sans-Xcode?

Darwin -MacBook-Pro.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

Xcode version 4.4 installed.

?
Reply to this email directly or view it on GitHub.

Member

rurban commented Oct 12, 2012

Cannot reproduce this problem. Do you have by chance a /usr/local/lib/libparrot.dylib installed?

Contributor

jkeenan commented Oct 12, 2012

On 10/12/12, Reini Urbannotifications@github.com wrote:

Cannot reproduce this problem. Do you have by chance a /usr/local/lib/libparrot.dylib installed?

No, not on the Darwin/Intel box where the test failures are being observed.

Jim Keenan
?
Reply to this email directly or view it on GitHub.

Member

rurban commented Nov 18, 2012

t/src/embed_2 on darwin:
puts fails in t/src/embed_2.c.
Somehow Parrot_interp_allocate_interpreter without parent corrupts IO with threads. Without threads it works ok.

$ /usr/bin/clang -g -O2 -fno-common -I/opt/local/include -no-cpp-precomp -fstack-protector -I/opt/local/include -Wno-long-double -isystem /opt/local/include -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHAS_GETTEXT -I/opt/local/lib/libffi-3.0.11/include -g -I./include src/parrot_config.o -L"/usr/src/parrot/threads/blib/lib" -lparrot "-L/usr/src/parrot/threads/blib/lib" -undefined dynamic_lookup -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -licuuc -licudata -lm -lutil -lgmp -lreadline -lintl -lffi t/src/embed_2.c

(threads↑=524efde a.out a.out.dSYM/ t/) air2 /usr/src/parrot/threads

$ ./a.out
Abort trap: 6134 (threads↑=524efde a.out a.out.dSYM/ t/)
$ lldb ./a.out
Current executable set to './a.out' (x86_64).
(lldb) r
Process 75643 launched: '/usr/src/parrot/threads/a.out' (x86_64)
Process 75643 stopped* thread #1: tid = 0x1c03, 0x00007fff891921b3 
libsystem_c.dylib`memchr + 15, stop reason = signal SIGABRT
frame #0: 0x00007fff891921b3 libsystem_c.dylib`memchr + 15
libsystem_c.dylib`memchr + 15:
-> 0x7fff891921b3:  movzbl (%rdi), %eax
 0x7fff891921b6:  cmpl   %ecx, %eax
 0x7fff891921b8:  je     0x7fff891921c6            ; memchr + 34
 0x7fff891921ba:  incq   %rdi

(lldb) bt
* thread #1: tid = 0x1c03, 0x00007fff891921b3 libsystem_c.dylib`memchr + 15, stop reason = signal SIGABRT
frame #0: 0x00007fff891921b3 libsystem_c.dylib`memchr + 15
frame #1: 0x00007fff891c345a libsystem_c.dylib`__sfvwrite + 578
frame #2: 0x00007fff891c3861 libsystem_c.dylib`fwrite + 114
frame #3: 0x00000001000012c8 a.out`main + 72 at embed_2.c:28
frame #4: 0x00007fff8d4b87e1 libdyld.dylib`start + 1

(lldb) p $eax
(unsigned int) $0 = 0

(lldb) p $rdi
(unsigned long) $1 = 4294999702

(lldb) p/x $rdi
(unsigned long) $2 = 0x0000000100007e96

(lldb) target modules lookup -a 0x0000000100007e96
  Address: a.out[0x0000000100007e96] (a.out.__TEXT.__cstring + 86)
  Summary: "Done\n"

@rurban rurban pushed a commit that referenced this issue Nov 18, 2012

Reini Urban fix [GH #856]: a 2nd interp on threaded parrot needs a parent
On darwin IO fails when a second interp has no parent. Disable the failing
tests for now. To fix this we would need to change the specs for Parrot_interp_new
that either the interp are automatically connected, are subsequent NULL (empty parent)
are disallowed.
e9dea3c

@rurban rurban pushed a commit that referenced this issue Nov 18, 2012

Reini Urban [GH #856] Clarify the Parrot_interp_new API for subsequent empty parents
Fixed the last blocking threads bugs, by automatically connecting subsequent new interpreters
to the very first interpreter. Revert the test changes in the previous commit.
t/src/extend_19 still fails for mysterious reasons, manually it passes, so TODO it.
24f8548

@rurban rurban pushed a commit that referenced this issue Nov 18, 2012

Reini Urban [GH #856] init the first emergeny_interp parent properly, hard tabs
Remove hard tabs. Init emergency_interp->parent_interpreter = NULL
316916a
Member

rurban commented Nov 21, 2012

There is only t/src/extend.t test 19 still failing, but not a blocker anymore.
Reduced it to Todo.

Member

rurban commented Dec 4, 2012

Cleared the threads milestone

Member

rurban commented Jan 10, 2013

The tests are not failing anymore. See also the duplicate #827 report.

rurban closed this Jan 10, 2013

@rurban rurban pushed a commit that referenced this issue Jan 24, 2015

Reini Urban [test] un-todo t/src/extend.t 19 on darwin
not repro anymore, at least with yosemite.
GH #856 SIGABRT with darwin threads
4ebcbe9

@rurban rurban pushed a commit that referenced this issue Jan 29, 2015

Reini Urban [test] un-todo t/src/extend.t 19 on darwin
not repro anymore, at least with yosemite.
GH #856 SIGABRT with darwin threads
dd32738

@rurban rurban pushed a commit that referenced this issue Oct 19, 2015

Reini Urban [test] un-todo t/src/extend.t 19 on darwin
not repro anymore, at least with yosemite.
GH #856 SIGABRT with darwin threads
02b3428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment